hello all,
I am currently extending the standard sap gateway service( /SCMTMS/EVENT_NOT) for SAP TM collaboration portal.
My requirement is to display the event comments into columns in the Freight order service ( /SCMTMS/TENDERING).
So I have used BOBF methods to retrieve all the event collection into one local internal table. Now I'am trying to read the event collection inside freight order loop, and move the corresponding comments to freight order.
DATA : lo_dac TYPE REF TO /scmtms/if_gw_data_access,
lo_srv TYPE REF TO /bobf/if_tra_service_manager,
lo_msg TYPE REF TO /bobf/if_frw_message.
DATA : lv_service TYPE string VALUE '/SCMTMS/EVENT_NOT',
lv_entity_name TYPE string VALUE 'Event',
lv_entity_set_name TYPE string VALUE 'EventCollection',
lv_fo TYPE string VALUE 'FreightOrder',
lv_trail TYPE string VALUE 'Z_TSP_TRAILER',
lv_tract TYPE string VALUE 'Z_TSP_TRACTOR',
lt_key TYPE /bobf/t_frw_key,
lt_selpar TYPE /bobf/t_frw_query_selparam,
lt_filter_selopt TYPE /bobf/t_frw_query_selparam,
lt_filter_selopt_cache TYPE /bobf/t_frw_query_selparam,
lt_data_events TYPE STANDARD TABLE OF /scmtms/s_gw_ev_not_event,
ls_data_events TYPE /scmtms/s_gw_ev_not_event,
ls_query_options TYPE /bobf/s_frw_query_options.
DATA : BEGIN OF ls_expanded.
INCLUDE TYPE /scmtms/s_gw_ev_not_fo.
DATA: freightordertonotes TYPE STANDARD TABLE OF /scmtms/s_gw_gen_note,
END OF ls_expanded.
DATA: ls_data LIKE ls_expanded,
lt_data LIKE TABLE OF ls_expanded.
FIELD-SYMBOLS : <er_entity> TYPE ANY TABLE.
lo_dac = /scmtms/cl_gw_service_mgr=>get_gw_dac(
iv_service_name = lv_service
iv_entity_name = lv_entity_name
iv_entity_set_name = lv_entity_set_name ).
lo_srv = /bobf/cl_tra_serv_mgr_factory=>get_service_manager( iv_bo_key = lo_dac->mv_bo_key ).
/scmtms/cl_q_superclass=>mv_query_pack_size = lo_dac->mv_query_package_size.
lo_dac->get_data( EXPORTING io_srvmgr = lo_srv
it_bopf_key = lt_key
it_bopf_selpar = lt_selpar
it_filter_selopt = lt_filter_selopt
it_filter_selopt_entity = lt_filter_selopt_cache
is_query_options = ls_query_options
IMPORTING et_data = lt_data_events
eo_message = lo_msg ).
IF sy-subrc = 0.
IF iv_entity_name = lv_fo.
ASSIGN er_entityset->* TO <er_entity>.
>>>> LOOP AT <er_entity> into ls_data.
READ TABLE lt_data_events
INTO ls_data_events with key tor_uuid = ls_data-tor_uuid.
IF ls_data_events-event_code = lv_trail.
ls_data-ztrailer = ls_data_events-event_comment.
APPEND ls_data to lt_data.
ENDIF.
IF ls_data_events-event_code = lv_tract.
ls_data-ztractor = ls_data_events-event_comment.
APPEND ls_data to lt_data.
ENDIF.
ENDLOOP.
<er_entity> = lt_data.
ENDIF.
ENDIF.
ENDMETHOD.
I am getting short dump stating type compatible error in the loop. I dont know If this is the correct approach. Please suggest.
could anyone please help me here?
Regards,
Ramya Soundar