温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

SAP CRM get_children 方法里面参数iv_as_copy 有什么用

发布时间:2021-12-04 15:17:30 来源:亿速云 阅读:174 作者:柒染 栏目:互联网科技

这篇文章将为大家详细讲解有关SAP CRM get_children 方法里面参数iv_as_copy 有什么用,文章内容质量较高,因此小编分享给大家做个参考,希望大家阅读完这篇文章后对相关知识有一定的了解。

lv_children = iv_account->get_children( iv_as_copy = abap_true ). 的参数啥意思

lo_children = iv_account->get_relation( iv_relation_name = <rel>

iv_as_copy = abap_false ).

解释没太看懂

> There is one special thing you need to know on the parameter IV_AS_COPY of GET_CHILDREN. It has

only effect on the iterator GET_FIRST etc. of the container list you will receive back. If set to true the

iterator will iterate only on the children inside the container list when it was created. If the parameter is

set to false the iterator will take into account children that are added to the container (or which are deleted

from it) after the container list was get. It is a misunderstanding that you get a copy of the content of the

container if you use this parameter. Knowing this you now have the knowledge going through the

relations of your model getting a separate nested container for every 1:n relation.

# Rule of thumb:

(1) iv_as_copy = true => you get a snapshot (preffered)

(2) iv_as_copy = false => list gets updated; use only if you want to keep the list; has negative impact on

performance/memory consumption

其实对于做过debug的developer,看了文档里对这个参数的解释后理解就会更加深刻。但是的确刚刚接触的developer看了解释可能仍然似懂非懂。

这个参数关键起作用的地方就在container object list的构造函数里:

SAP CRM get_children 方法里面参数iv_as_copy 有什么用

如果你使用iv_as_copy = true得到一个container object list,那么这个container object list A 只是当前parent container object的children的一个snapshot,今后parent container object 如果有新的children加进来之后,新的child不会反映到你得到的snapshot A去,因为technical上讲,你的snapshot并没有注册 parent container object的CHILD_ADDED event,因为不会被通知到。

举一个例子:

我在从Account navigate 到AccountAddress的地方加一段代码,分别存储两种方式得到的account address container object list,这个时候还没有真正取Account address,所以两个container object list里面都只有一个dummy的entry,is_handle = X

SAP CRM get_children 方法里面参数iv_as_copy 有什么用

我新建一个Address,然后save

SAP CRM get_children 方法里面参数iv_as_copy 有什么用

因为当前的Account DB里面有50个address,我又在当前session里面添加了1个,所以iv_as_copy = false的有51个item,而snapshot仍然只有1个dummy的。

SAP CRM get_children 方法里面参数iv_as_copy 有什么用

关于SAP CRM get_children 方法里面参数iv_as_copy 有什么用就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI