Show TOC

Example documentationImplementation of Determination: Derive Dependent Data Immediately After Modification Locate this document in the navigation structure

 

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

Syntax Syntax

  1. METHOD /bobf/if_frw_determination~execute.
  2.  DATA:
  3.   lt_item_data    TYPE    bobf_t_ci_item.
  4.   ls_item_data    TYPE REF TO bobf_s_ci_item,
  5.  " clear exporting parameter CLEAR:
  6.   eo_message
  7.   et_failed_key.
  8.  " read the instance data of the item
  9.  io_read->retrieve(
  10.   EXPORTING
  11.    iv_node = if_ci_bopf_customer_invoi_c=>sc_node-item
  12.    it_key = it_key
  13.   IMPORTING
  14.    et_data = lt_item_data ).
  15.  " loop over all instances
  16.  LOOP AT lt_item_data REFERENCE INTO ls_item_data.
  17.   " calculate new amount
  18.   ls_item_data->net_amount = ls_item_data->quantity * ls_item_data->price_amount.
  19.   " update data
  20.   io_modify->update(
  21.    EXPORTING
  22.     iv_node = is_ctx-node_key
  23.     iv_key = ls_item_data->key
  24.     is_data = ls_item_data ).
  25.  ENDLOOP.
  26. ENDMETHOD.
End of the code.