Hello Experts,
I am new to BOPF and trying to create ROOT and Dependent from se38 report.
I created a Root and while creating the dependent i am only passing Root Key for dependent creation. Mean while i tried doing it using ASSOCIATION field in call to service MODIFY method, but its giving Dump.
My question is , is it sufficient to pass only Root key for dependent creation ? How can i make use of Association marked in Bold color below.
Following is the Code snippet i have written.
**** Data Declarations
DATA : lo_txn_manager TYPE REF TO /bobf/if_tra_transaction_mgr,
lo_serv_mgr TYPE REF TO /bobf/if_tra_service_manager,
lo_bo_config TYPE REF TO /bobf/if_frw_configuration,
lx_bopf TYPE REF TO /bobf/cx_frw,
lv_error TYPE string,
lt_modification TYPE /bobf/t_frw_modification,
ls_modification TYPE /bobf/s_frw_modification,
lr_chnge TYPE REF TO /bobf/if_tra_change,
lr_message TYPE REF TO /bobf/if_frw_message,
lr_data TYPE REF TO zmay1_s_root,
lr_data1 TYPE REF TO zmay1_s_item,
lv_rejected TYPE boole_d,
lr_eo_change TYPE REF TO /bobf/if_tra_change,
lr_eo_message TYPE REF TO /bobf/if_frw_message,
lt_rejecting_bo_key TYPE /bobf/t_frw_key2,
ls_root_key TYPE /bobf/conf_key..
TRY.
lo_txn_manager = /bobf/cl_tra_trans_mgr_factory=>get_transaction_manager( ).
lo_serv_mgr = /bobf/cl_tra_serv_mgr_factory=>get_service_manager( zif_may1_trq1_c=>sc_bo_key ). " ZIF_MAY1_TRQ1_C - Constant interface
lo_bo_config = /bobf/cl_frw_factory=>get_configuration( zif_may1_trq1_c=>sc_bo_key ).
CATCH /bobf/cx_frw INTO lx_bopf.
lv_error = lx_bopf->get_text( ).
ASSERT CONDITION 1 = 2.
ENDTRY.
CHECK lo_serv_mgr IS BOUND.
CREATE DATA lr_data.
CHECK lr_data IS BOUND.
**** Root Creation
lr_data->trq_id = '200'.
lr_data->trq_desc = 'final'.
lr_data->src_loc = 'Mum'.
lr_data->des_loc = 'DEL'.
ls_modification-node = zif_may1_trq1_c=>sc_node-root.
ls_modification-change_mode = 'C'.
ls_modification-data = lr_data.
APPEND ls_modification TO lt_modification.
CALL METHOD lo_serv_mgr->modify
EXPORTING
it_modification = lt_modification
IMPORTING
eo_change = lr_chnge
eo_message = lr_message.
CLEAR: ls_modification,lt_modification.
**** Get the Root key from Buffer
ls_root_key = lo_serv_mgr->get_new_key( ).
**** Dependent Creation and finally Root and Dependent Saving
CREATE DATA lr_data1.
CHECK lr_data1 IS BOUND.
CLEAR ls_modification.
lr_data1->item_id = ' 25'.
lr_data1->item_desc = 'Done'.
ls_modification-node = zif_may1_trq1_c=>sc_node-item.
ls_modification-change_mode = 'C'.
ls_modification-data = lr_data1.
ls_modification-root_key = ls_root_key.
*ls_modification-association = zif_may1_trq1_c=>sc_association-root-item.
CLEAR lt_modification.
APPEND ls_modification TO lt_modification.
CALL METHOD lo_serv_mgr->modify
EXPORTING
it_modification = lt_modification
IMPORTING
eo_change = lr_chnge
eo_message = lr_message.
lo_txn_manager->save(
EXPORTING
iv_transaction_pattern = /bobf/if_tra_c=>gc_tp_save_and_continue " Data element for a transaction pattern
IMPORTING
ev_rejected = lv_rejected " Data element for domain BOOLE: TRUE (='X') and FALSE (=' ')
eo_change = lr_eo_change " Interface for transaction change objects
eo_message = lr_eo_message " Interface of Message Object
et_rejecting_bo_key = lt_rejecting_bo_key " Key table
).
Please suggest. Please do not block it as i didnot find any code snippets discussed in forum.
BR,
Nikhil Kulkarni