/scmtms/cl_tcc_dispute_utility=>get_do_node_bo_view(
EXPORTING
iv_node_key = /bobf/if_txc_c=>sc_node-root
iv_host_do_bo_key = /scmtms/if_tcc_trnsp_chrg_c=>sc_bo_key
iv_host_bo_key = /scmtms/if_tor_c=>sc_bo_key
iv_host_do_root_node_key = /scmtms/if_tor_c=>sc_node-transportcharges
iv_do_root_node_key = /scmtms/if_tcc_trnsp_chrg_c=>sc_node-itemchrgelemtextcollection
iv_content_cat = /bobf/if_conf_c=>sc_content_nod
RECEIVING
rv_do_key = DATA(v_txc_root_node_key) ).
/scmtms/cl_common_helper=>get_do_entity_key
EXPORTING
iv_host_bo_key = /scmtms/if_tor_c=>sc_bo_key
iv_host_do_node_key = /scmtms/if_tor_c=>sc_node-transportcharges
iv_do_entity_cat = /bobf/if_conf_c=>sc_content_assc
iv_do_entity_key = /scmtms/if_tcc_trnsp_chrg_c=>sc_association-itemchargeelement-
itemchrgelemtextcollection
RECEIVING
rv_entity_key = DATA(v_chel_txc_assoc_key).
/scmtms/cl_common_helper=>get_do_keys_4_rba
EXPORTING
iv_host_bo_key = /scmtms/if_tcc_trnsp_chrg_c=>sc_bo_key
iv_host_do_node_key = /scmtms/if_tcc_trnsp_chrg_c=>sc_node-itemchrgelemtextcollection
iv_do_node_key = /bobf/if_txc_c=>sc_node-text
iv_do_assoc_key = /bobf/if_txc_c=>sc_association-root-text
IMPORTING
ev_assoc_key = DATA(v_txc_root_text_assoc_key_temp).
/scmtms/cl_common_helper=>get_do_entity_key
EXPORTING
iv_host_bo_key = /scmtms/if_tor_c=>sc_bo_key
iv_host_do_node_key = /scmtms/if_tor_c=>sc_node-transportcharges
iv_do_entity_cat = /bobf/if_conf_c=>sc_content_assc
iv_do_entity_key = v_txc_root_text_assoc_key_temp
RECEIVING
rv_entity_key = DATA(v_txc_root_text_assoc_key).
** Get Service Manager for the TOR.
DATA(o_srvmgr_tor) = /bobf/cl_tra_serv_mgr_factory=>get_service_manager( /scmtms/if_tor_c=>sc_bo_key ).
** Get Runtime node keys for ChargeItem & ItemChargeelement with respect to main BO(TOR).
/scmtms/cl_tcc_utilities=>get_do_keys(
EXPORTING
iv_bo_key = /scmtms/if_tor_c=>sc_bo_key
iv_bo_node_key = /scmtms/if_tor_c=>sc_node-root
IMPORTING
ev_root_node_key = DATA(v_root_node_key)
ev_chrgit_node_key = DATA(v_chrgit_node_key)
ev_it_chrg_el_node_key = DATA(v_chrgel_node_key)
ev_root_chrgit_assoc_key = DATA(v_root_chrgit_assoc_key)
ev_chrgit_itchrgel_assoc_key = DATA(v_chrgit_chrgel_assoc_key) ).
** Get runtime Node key for root node of DO ChargeElementTextCollection.
/scmtms/cl_tcc_dispute_utility=>get_do_node_bo_view(
EXPORTING
iv_node_key = /bobf/if_txc_c=>sc_node-root
iv_host_do_bo_key = /scmtms/if_tcc_trnsp_chrg_c=>sc_bo_key
iv_host_bo_key = /scmtms/if_tor_c=>sc_bo_key
iv_host_do_root_node_key = /scmtms/if_tor_c=>sc_node-transportcharges
iv_do_root_node_key = /scmtms/if_tcc_trnsp_chrg_c=>sc_node-itemchrgelemtextcollection
iv_content_cat = /bobf/if_conf_c=>sc_content_nod
RECEIVING
rv_do_key = DATA(v_txc_root_node_key) ).
** Get runtime Association key for DO’s root node element with respect to Item Charge element.
/scmtms/cl_common_helper=>get_do_entity_key
EXPORTING
iv_host_bo_key = /scmtms/if_tor_c=>sc_bo_key
iv_host_do_node_key = /scmtms/if_tor_c=>sc_node-transportcharges
iv_do_entity_cat = /bobf/if_conf_c=>sc_content_assc
iv_do_entity_key = /scmtms/if_tcc_trnsp_chrg_c=>sc_association-itemchargeelement-itemchrgelemtextcollection " DO Node Key
RECEIVING
rv_entity_key = DATA(v_chel_txc_assoc_key).
** Get runtime Node key for the text node of DO.
/scmtms/cl_tcc_dispute_utility=>get_do_node_bo_view(
EXPORTING
iv_node_key = /bobf/if_txc_c=>sc_node-text
iv_host_do_bo_key = /scmtms/if_tcc_trnsp_chrg_c=>sc_bo_key
iv_host_bo_key = /scmtms/if_tor_c=>sc_bo_key
iv_host_do_root_node_key = /scmtms/if_tor_c=>sc_node-transportcharges
iv_do_root_node_key = /scmtms/if_tcc_trnsp_chrg_c=>sc_node-itemchrgelemtextcollection
iv_content_cat = /bobf/if_conf_c=>sc_content_nod
RECEIVING
rv_do_key = DATA(v_txc_text_node_key)
).
** Get runtime association key for DO’s Text Node element with respect to the Root Node.
/scmtms/cl_common_helper=>get_do_keys_4_rba
EXPORTING
iv_host_bo_key = /scmtms/if_tcc_trnsp_chrg_c=>sc_bo_key
iv_host_do_node_key = /scmtms/if_tcc_trnsp_chrg_c=>sc_node-itemchrgelemtextcollection
iv_do_node_key = /bobf/if_txc_c=>sc_node-text
iv_do_assoc_key = /bobf/if_txc_c=>sc_association-root-text
IMPORTING
ev_assoc_key = DATA(v_txc_root_text_assoc_key_temp).
/scmtms/cl_common_helper=>get_do_entity_key
EXPORTING
iv_host_bo_key = /scmtms/if_tor_c=>sc_bo_key
iv_host_do_node_key = /scmtms/if_tor_c=>sc_node-transportcharges
iv_do_entity_cat = /bobf/if_conf_c=>sc_content_assc
iv_do_entity_key = v_txc_root_text_assoc_key_temp
RECEIVING
rv_entity_key = DATA(v_txc_root_text_assoc_key).
** Get runtime Node key for text content node of DO.
/scmtms/cl_tcc_dispute_utility=>get_do_node_bo_view(
EXPORTING
iv_node_key = /bobf/if_txc_c=>sc_node-text_content
iv_host_do_bo_key = /scmtms/if_tcc_trnsp_chrg_c=>sc_bo_key
iv_host_bo_key = /scmtms/if_tor_c=>sc_bo_key
iv_host_do_root_node_key = /scmtms/if_tor_c=>sc_node-transportcharges
iv_do_root_node_key = /scmtms/if_tcc_trnsp_chrg_c=>sc_node-itemchrgelemtextcollection
iv_content_cat = /bobf/if_conf_c=>sc_content_nod
RECEIVING
rv_do_key = DATA(v_txc_cont_node_key) ).
** Get runtime association key for DO’s Text Content Node with respect to the Text Node.
/scmtms/cl_common_helper=>get_do_keys_4_rba
EXPORTING
iv_host_bo_key = /scmtms/if_tcc_trnsp_chrg_c=>sc_bo_key
iv_host_do_node_key = /scmtms/if_tcc_trnsp_chrg_c=>sc_node-itemchrgelemtextcollection
iv_do_node_key = /bobf/if_txc_c=>sc_node-text_content
iv_do_assoc_key = /bobf/if_txc_c=>sc_association-text-text_content
IMPORTING
ev_assoc_key = DATA(v_txc_text_cont_assoc_key_temp).
/scmtms/cl_common_helper=>get_do_entity_key
EXPORTING
iv_host_bo_key = /scmtms/if_tor_c=>sc_bo_key
iv_host_do_node_key = /scmtms/if_tor_c=>sc_node-transportcharges
iv_do_entity_cat = /bobf/if_conf_c=>sc_content_assc
iv_do_entity_key = v_txc_text_cont_assoc_key_temp
RECEIVING
rv_entity_key = DATA(v_txc_text_cont_assoc_key).
** Retrieve the Charge elements data
o_srvmgr_tor->retrieve_by_association(
EXPORTING
iv_node_key = v_chrgit_node_key
it_key = t_chitemkeys
iv_association = v_chrgit_chrgel_assoc_key
iv_fill_data = abap_true
IMPORTING
et_data = t_chelements
).
**Read the relevant charge element entry from internal table t_chelements based on your **requirement to which Text Note needs to be inserted.
** Prepare data for Text collection root node -
DATA(v_txc_key) = /bobf/cl_frw_factory=>get_new_key( ).
o_txc->key = v_txc_key.
o_txc->parent_key = s_chelements-key.
o_txc->root_key = s_chelements-root_key.
o_txc->text_schema_id = “As per the business requirement
o_txc->text_exists_ind = ‘X’.
** Prepare data for Modification table.
CLEAR s_modification.
s_modification-key = v_txc_key.
s_modification-node = v_txc_root_node_key.
s_modification-change_mode = /bobf/if_frw_c=>sc_modify_create.
s_modification-data = o_txc.
s_modification-association = v_chel_txc_assoc_key.
s_modification-source_node = v_chrgel_node_key.
s_modification-source_key = s_chelements-key.
s_modification-root_key = s_chelements-root_key.
APPEND s_modification TO t_modification.
** Prepare data for Text Node -
DATA(v_txt_key) = /bobf/cl_frw_factory=>get_new_key( ).
o_text->key = v_txt_key.
o_text->parent_key = v_txc_key.
o_text->root_key = s_chelements-root_key.
o_text->text_type = “As per the business requirement
o_text->eew_txc_text = ‘X’.
o_text->language_code = ‘E’.
** Prepare data for Modification table.
CLEAR s_modification.
s_modification-key = v_txt_key.
s_modification-source_key = v_txc_key.
s_modification-source_node = v_txc_root_node_key.
s_modification-root_key = s_chelements-root_key.
s_modification-node = v_txc_text_node_key.
s_modification-association = v_txc_root_text_assoc_key.
s_modification-change_mode = /bobf/if_frw_c=>sc_modify_create.
s_modification-data = o_text.
APPEND s_modification TO t_modification.
** Prepare data for Text Content Node -
DATA(v_txtcon_key) = /bobf/cl_frw_factory=>get_new_key( ).
o_text_content->key = v_txtcon_key.
o_text_content->parent_key = v_txt_key.
o_text_content->root_key = s_chelements-root_key.
o_text_content->text = “Pass the Text note which needs to be inserted here.
** Prepare data for Modification table.
CLEAR s_modification.
s_modification-key = v_txtcon_key.
s_modification-source_key = v_txt_key.
s_modification-source_node = v_txc_text_node_key.
s_modification-root_key = s_chelements-root_key.
s_modification-node = v_txc_cont_node_key.
s_modification-association = v_txc_text_cont_assoc_key.
s_modification-change_mode = /bobf/if_frw_c=>sc_modify_create.
s_modification-data = o_text_content.
APPEND s_modification TO t_modification.
** Call the modify method
o_srvmgr_tor->modify(
EXPORTING
it_modification = t_modification
IMPORTING
eo_message = DATA(o_message)
eo_change = DATA(o_change)
).
** Transaction manager object
DATA(o_trans_mgr) = /bobf/cl_tra_trans_mgr_factory=>get_transaction_manager( ).
** Call Save method of the Transaction manager to commit the changes to DB.
o_trans_mgr->save(
IMPORTING
ev_rejected = DATA(v_rejected)
eo_message = DATA(o_message)
).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
4 | |
3 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 |