您好,登錄后才能下訂單哦!
這篇文章將為大家詳細講解有關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的構造函數里:
如果你使用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
我新建一個Address,然后save
因為當前的Account DB里面有50個address,我又在當前session里面添加了1個,所以iv_as_copy = false的有51個item,而snapshot仍然只有1個dummy的。
關于SAP CRM get_children 方法里面參數iv_as_copy 有什么用就分享到這里了,希望以上內容可以對大家有一定的幫助,可以學到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。