Show TOC

Implementation of Determination: Derive Dependent Data Immediately After ModificationLocate this document in the navigation structure

Concept

The following source code describes the ITEM_AMOUNT determination that is configured in the Derive dependent data immediately after modification pattern.

METHOD /bobf/if_frw_determination~execute.
 DATA:
  lt_item_data    TYPE    bobf_t_ci_item.
  ls_item_data    TYPE REF TO bobf_s_ci_item,
 " clear exporting parameter CLEAR:
  eo_message
  et_failed_key.
 " read the instance data of the item
 io_read->retrieve(
  EXPORTING
   iv_node = if_ci_bopf_customer_invoi_c=>sc_node-item
   it_key = it_key
  IMPORTING
   et_data = lt_item_data ).
 " loop over all instances
 LOOP AT lt_item_data REFERENCE INTO ls_item_data.
  " calculate new amount
  ls_item_data->net_amount = ls_item_data->quantity * ls_item_data->price_amount.
  " update data
  io_modify->update(
   EXPORTING
    iv_node = is_ctx-node_key
    iv_key = ls_item_data->key
    is_data = ls_item_data ).
 ENDLOOP.
ENDMETHOD.