Sei sulla pagina 1di 2

Test: Simple report to demonstrate use of Retrieve and Retrieve by association methods. REPORT ztest_m1.

DATA: lr_srv_mgr TYPE REF TO /bobf/if_tra_service_manager, lt_trq_id TYPE ztrq_id_t, lt_trq_key TYPE /bobf/t_frw_key, lt_dbtable TYPE TABLE OF zmay_d_root, ls_dbtable TYPE zmay_d_root, ls_trq_id TYPE ztrq_id_s, lt_item_data TYPE zmay_t_item, lt_message TYPE REF TO /bobf/if_frw_message, lt_change TYPE REF TO /bobf/if_tra_change, lt_root_data TYPE zmay_t_root, lt_failed_key TYPE /bobf/t_frw_key. DATA: lt_key_link TYPE /bobf/t_frw_key_link, lt_target_key TYPE /bobf/t_frw_key.

IF ( lr_srv_mgr IS NOT BOUND ). lr_srv_mgr = /bobf/cl_tra_serv_mgr_factory=>get_service_manager( zif_may_trq1_c=>sc_bo_key ). "Passing Node ID ENDIF. SELECT * FROM zmay_d_root INTO TABLE lt_dbtable. LOOP AT lt_dbtable INTO ls_dbtable. ls_trq_id-trq_id = ls_dbtable-trq_id. APPEND ls_trq_id TO lt_trq_id. ENDLOOP. CALL METHOD lr_srv_mgr>convert_altern_key "Convert an alternative key to the technical key. * Convert IDs into BOPF keys **converts a list of TRQ IDs into the corresponding Root node keys EXPORTING iv_node_key = zif_may_trq1_c=>sc_node-root " Node iv_altkey_key = zif_may_trq1_c=>sc_alternative_key-rootztrq_id " Alternative Key it_key = lt_trq_id "Node Key IMPORTING et_key = lt_trq_key " Key Table . CALL METHOD lr_srv_mgr->retrieve "retrieve the data for the Root node keys * Use method RRETRIEVE to retrieve ROOT data EXPORTING iv_node_key = zif_may_trq1_c=>sc_node-root " Node it_key = lt_trq_key " Key Table iv_fill_data = abap_true ", Data. element for domain BOOLE: TRUE (='X') and FALSE (=' ') IMPORTING et_data = lt_root_data * et_failed_key = lt_failed_key " Key Table . CALL METHOD lr_srv_mgr->retrieve_by_association * Use method Retrieve by Association to retrieve ITEM node data EXPORTING iv_node_key = zif_may_trq1_c=>sc_node-root " Node

it_key = iv_association = item " Association iv_fill_data = : TRUE (='X') and FALSE (=' ') IMPORTING eo_message = ect eo_change = et_data = et_key_link = et_target_key = et_failed_key = . BREAK-POINT.

lt_trq_key " Key Table zif_may_trq1_c=>sc_association-rootabap_true " Data element for domain BOOLE

lt_message

" Interface of Message Obj

lt_change " Interface of Change Object lt_item_data lt_key_link " Key Link lt_target_key " Key Table lt_failed_key " Key Table

Potrebbero piacerti anche