ls_ctx-host_bo_key = /scmtms/if_tor_c=>sc_bo_key. " HOST BO KEY , in this case TOR as TOR is hosting "the DO (Delegated Node).
ls_ctx-host_root_node_key = /scmtms/if_tor_c=>sc_node-root. "TOR ROOT Key as the DO is inside the "ROOT NODE
ls_ctx-host_node_key = /scmtms/if_tor_c=>sc_node-transportcharges. "HOST Node , here host is the DO "TRANSPORTCHARGES
"Also Provide the Parameter IT_ROOT_KEY with the TOR Keys, in this case, the Freight Order keys.
TRY.
"use transportation charge helper class to get the charge details.
/scmtms/cl_tcc_do_helper=>retrive_do_nodes(
EXPORTING
is_ctx = ls_ctx
it_root_key = lt_tor_root_key " Key Table
IMPORTING
et_charge_item = DATA(lt_item) " Charge Item
et_charge_element = DATA(lt_charge_ele) " Charge Element
et_do_root = lt_do_root " Root
).
CATCH /bobf/cx_frw_contrct_violation ##NO_HANDLER. " Caller violates a BOPF contract
ENDTRY.
io_serv_manager = /bobf/cl_tra_serv_mgr_factory=>get_service_manager( /scmtms/if_tor_c=>sc_bo_key ).
CREATE DATA ls_mod-data TYPE /scmtms/s_tcc_root_k. "Create reference of root structure of DO
ASSIGN ls_mod-data->* TO <fs_root>.
CHECK <fs_root> IS ASSIGNED.
<fs_root> = is_do_root.
<fs_root>-zcustfield = abap_true.
"add changed field.
APPEND 'ZCUSTFIELD' TO ls_mod-changed_fields.
ls_mod-key = is_do_root-key. "Root Key of Delegated Node , can be fetched using the Helper "shown above
ls_mod-source_node = /scmtms/if_tor_c=>sc_node-root. "Source is the TOR ROOT
ls_mod-source_key = it_key[ 1 ]-key. "Key is the TOR key, in this case the Freight order "key
ls_mod-root_key = it_key[ 1 ]-key. "Key is the same as TOR key, in this case the Freight order "key
ls_mod-node = /scmtms/if_tor_c=>sc_node-transportcharges. "Node is the node to update , in "this case the DO Node in TOR transportcharges
ls_mod-association = /scmtms/if_tor_c=>sc_association-root-transportcharges. "Association to " the DO node from the TOR root node
ls_mod-change_mode = /bobf/if_frw_c=>sc_modify_update. "Indicator to Update
APPEND ls_mod TO lt_mod.
"io_serv_manager is the for the TOR BO node / HOST BO Node
io_serv_manager->modify(
EXPORTING
it_modification = lt_mod " Changes
IMPORTING
* eo_change = " Interface of Change Object
eo_message = lo_message " Interface of Message Object
).
" Finally call the transaction manager to save the data
lo_txn_mngr = /bobf/cl_tra_trans_mgr_factory=>get_transaction_manager( ).
lo_txn_mngr->save(
IMPORTING
ev_rejected = DATA(lv_reject) " Data
).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
4 | |
3 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 |