Hello,
I want to post events in Transportation Management for ‘Freight Order/Booking with an own program. I’m using BAPI “/SAPTRX/BAPI_EH_POST”.
Business Requirement is:
Creating Event (e.g. DEPARTURE) for a freight order/booking with event date.
The program does not insert/change the event (in tab "EXECUTION” of freight order)
Remark: we are not using an own system for SAP EM.
SAP TM and SAP EM are running in the same system
I’m using the following settings
In freight order type application object "ODT30_TO" is assigned, allowed events for the order types are:
ARRIV_DEST
COUPLING
DECOUPLING
DEPARTURE
LOAD_BEGIN
LOAD_END
POD
POPU
UNLOAD_BEGIN
UNLOAD_END
The program has the following coding:
Some information to the coding:
- Application Object ID: “56EAB2E0CCBC5D91E1000000AC101684” is the DB-Key of table /SCMTMS/D_TORROT
- Control value: 4100000351 is theTOR_ID of table/SCMTMS/D_TORROT
** Fill table prior to BAPI call.
* Mandatory Data
refresh lt_applobjects.
ls_applobjects-appsys = 'TMXCLNT700'. .
ls_applobjects-appobjtype = 'ODT30_TO'.
ls_applobjects-appobjid = '56EAB2E0CCBC5D91E1000000AC101684'. "Freight Order!!!
ls_applobjects-busproctype = 'TMS_TOR'.
ls_applobjects-update_indicator = 'I'.
APPEND ls_applobjects TO lt_applobjects.
*Controldata
refresh lt_controldata.
ls_controldata-appsys = 'TMXCLNT700'.
ls_controldata-appobjtype = 'ODT30_TO'.
ls_controldata-appobjid = '56EAB2E0CCBC5D91E1000000AC101684'. " Freight Order!!!
ls_controldata-paramname = 'FREIGHT_ORDER'.
ls_controldata-value = '4100000351'. "Freight Order ls_appob.
*ls_controldata-value = ls_prio.
APPEND ls_controldata TO lt_controldata.
*trackingid
ls_trackiddata-appsys = 'TMXCLNT700'.
ls_trackiddata-appobjtype = 'ODT30_TO' .
ls_trackiddata-appobjid = '56EAB2E0CCBC5D91E1000000AC101684'.
ls_trackiddata-trxcod = 'DEPARTURE'. "Event !!!!!
ls_trackiddata-trxid = '56EAB2E0CCBC5D91E1000000AC101684'. "Freight Order
ls_trackiddata-START_DATE = sy-datum - 1.
ls_trackiddata-msrid = 'X'.
*ls_trackiddata-msrid = 'X'.
APPEND ls_trackiddata TO lt_trackiddata.
*
CALL FUNCTION '/SAPTRX/BAPI_EH_POST'
EXPORTING
simulate = ls_sim
TABLES
applobjects = lt_applobjects
controldata = lt_controldata
infodata = lt_infodata
milestonedata = lt_milestones
trackiddata = lt_trackiddata
* INFOOBJDATA =
* EXTENSIONIN =
* EXTENSIONOUT =
RETURN = lt_return
.
if ls_sim is initial.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
endif.
loop at lt_return into ls_return.
write: / ls_return-TYPE ,
ls_return-ID ,
ls_return-NUMBER ,
ls_return-MESSAGE.
endloop.
the BAPi return message looks like
S /SAPTRX/TS_APP 704 EM TMXCLNT700: Using mapping profile ODT30_TOR for application object type ODT30_TO
I /SAPTRX/APP_LOG 020 Posting data from appl. sys TMXCLNT700, appl. object ODT30_TO/56EAB2E0CCBC5D91E1000000AC101684, status = 1
I /SAPTRX/APP_LOG 022 Updating event handler
.... but freight order has not changed
Is there a missing functionality to that the event handler has to start?????
Thanks in advance
Georg