on 2020 Nov 21 11:45 AM
hi,
in Tm embedded function module /SAPTRX/BAPI_EH_ADDEVENTMSG_02 does not exist any more. it was used to raise an event before. I found /SCMTMS/CL_TOR_HELPER_EVENT, method REPORT_EVENT instead, but it is unclear what the mandatory fields are. the below code has no syntax errors, but the event is not raised/visible in the FO.
"get first location
lo_srv_tor->retrieve_by_association(
EXPORTING
iv_node_key = /scmtms/if_tor_c=>sc_node-root
it_key = lt_fo_key
iv_fill_data = abap_true
iv_association = /scmtms/if_tor_c=>sc_association-root-stop_first
IMPORTING
eo_message = lo_message
et_data = lt_stop_first
et_failed_key = lt_failed_key ).
"Move source location into variable
READ TABLE lt_stop_first ASSIGNING FIELD-SYMBOL(<ls_stop_first>) INDEX 1.
lv_src_loc = <ls_stop_first>-log_locid.
lv_first_stop_key = <ls_stop_first>-key.
APPEND VALUE #( target_key = lv_first_stop_key ) TO lt_first_stop_key.
"Move today´s date into variable
CONVERT DATE sy-datum INTO TIME STAMP lv_event_date_time TIME ZONE 'CET'.
"Set event LOAD_BEGIN
CALL METHOD /scmtms/cl_tor_helper_event=>report_event
EXPORTING
iv_event_code = 'LOAD_BEGIN'
iv_ref_event_code = 'LOAD_BEGIN'
it_tor_key = lt_fo_key
it_tor_root_stop = lt_first_stop_key
iv_event_status = 'R'
* it_tor_stop_item =
" io_modify = 'X'
iv_actual_date = lv_event_date_time
iv_actual_tz = 'CET'
iv_exec_info_source = 'T'
iv_register_action = 'X'
IMPORTING
et_failed_key = lt_failed_key
eo_message = lo_message.
Request clarification before answering.
Hi Petra and Arun,
I am new to SAP TM and am looking for a solution to report events into a Freight Order during deliveries /pick up's.
We have a requirement where we need to report events for different activities like shift start, shift end, the truck entering and leaving warehouse etc.
I am not sure if the above solution from Petra works for our scenario. I did some research and found the class /SCMTMS/CL_TOR_HELPER_EVENT and the method REPORT_EVENT appears to match the requirement but I am not sure if this works. Looking for your inputs for reporting the events in the right approach and also the input parameters please.
Here is the class method signature.

Thank you in advance.
Kind regards,
Naga Chaitanya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 6 | |
| 3 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.