The SAP EM Application Interface is a Basis Plug-in that SAP has provided to enable the integration between an SAP application system and SAP Event Management.
Check out the diagram below - It details what the Application Interface looks like... Clear as daylight... If not, I'll maybe explain it in another post some time ;)
SAP TM does not make use of the BAdI interface to call SAP EM - This is the typical approach for other application systems like SAP ERP or SAP GTS. Instead SAP TM makes use of the Post Processing Framework (PPF) to call the BAPI /SAPTRX/EVENT_MGR_COMMUNICATE (the main function housing the SAP EM Application Interface).
Check to make sure “Enable” is enabled to launch SAP EM Application Interface functionality (As shown in the above Figure).
Note: Class /SCMTMS/CL_OUTMGMT_EXEC_TOR has Method DISPATCH_INT redefined, which in turn calls Method call_em_tor_data for Class /SCMTMS/cl_event_management, which calls the SAP Event Management Application Interface in the following screenshots.
For debugging issues with updating SAP EM via SAP TM, place a break-point at the method displayed in the Figure above. The data that is being passed to SAP Event Management can be reviewed at this point.
SAP TM Data Extraction
In this section we will discuss the configuration elements that are necessary on the SAP TM side in order to integrate a SAP TM process with SAP EM.
If a SAP TM object is found to be SAP EM-relevant, the applicable extraction functions are executed.
For an Application Object Type (generating an EH) these functions would extract tracking IDs, parameters, expected events and business object IDs
For an Event Type this would be the event type extraction function (generating event message/s)
Business Process Types (BPT)
To configure the triggering of event handler creation and event message sending for each of the SAP TM objects, flag these under business process types in the IMG as shown in the Figure below. The IMG path is: Integration with Other SAP Components -> Event Management Interface -> Define Application Interface -> Define Business Process Types.
Select TMS_TOR, slide the bar to the right, and ensure that the “EH Create” and “EMsg Send” checkboxes are selected (See Figure below).
Note: Selecting “EH Create” will execute the “Define Used Bus. Proc. Types, Appl. Obj. Types, and Evt Types” -> “Define Application Object Types” code, which includes all the relevance logic and extraction logic (for parameters, tracking IDs, etc.) -> Ultimately calls /SAPTRX/BAPI_EH_POST
Selecting “EMsg Send” will execute the “Define Used Bus. Proc. Types, Appl. Obj. Types, and Evt Types” -> “Define Event Types” code, which includes all the relevance logic and extraction logic (for event message detail) -> Ultimately calls /SAPTRX/BAPI_EH_ADDEVENTMSG_02
Ensure that the checkboxes for TMS_INS (Instructions) and TMS_RES (Resources) are also checked.
Note: In the Figure above, for entry TMS_TOR, a queue name extractor is filled in. A queue name extractor is used to create custom logic to define your own queue names for the applicable business process type. This allows you to align your business process, with process volumes, with process priorities and with basis settings to drive maximum performance out of your SAP EM interface.
Application Object Types (AOT)
The AOT is the Application System business object that will drive the creation of the relevant Event Handler in SAP EM. The relevant SAP TM AOTs need to be activated as follows:
Freight Unit and Freight Order
In IMG activity: Integration with Other SAP Components -> Event Management Interface -> Define Application Interface -> Define Used Bus. Proc. Types, Appl. Obj. Types, and Evt Types
Select “Define Used Business Process Types” of “TMS_TOR” -> Select 'Define Application Object Types'
Ensure that each AOT, listed below, has a relevant SAP Event Management system defined in the 'Event Manager' Field and that the 'EM Relevance of Appl. Obj' checkbox is checked.
ODT30_FU – Freight Unit
ODT30_TO – Freight Order / Booking Order
Resource
In IMG activity: Integration with Other SAP Components -> Event Management Interface -> Define Application Interface -> Define Used Bus. Proc. Types, Appl. Obj. Types, and Evt Types
Select “Define Used Business Process Types” of “TMS_RES” -> Select “Define Application Object Types”
Ensure that each AOT, listed below, has a relevant SAP Event Management system defined in the “Event Manager” field and that the “EM Relevance of Appl. Obj” checkbox is checked.
RES30_RESOURCE
Instructions
In IMG activity: Integration with Other SAP Components -> Event Management Interface -> Define Application Interface -> Define Used Bus. Proc. Types, Appl. Obj. Types, and Evt Types
Select “Define Used Business Process Types” of “ TMS_INS” -> Select “Define Application Object Types”
Ensure that each AOT, listed below, has a relevant SAP Event Management system defined in the “Event Manager” field and that the “EM Relevance of Appl. Obj” checkbox is checked.
ODT30_INS
Event Types (ET)
An event type is used to determine whether a situation has occurred in SAP TM that needs to generate an event message to SAP EM. If it is determined that an event should indeed be created, then the relevant data is extracted to include in the event message, as part of the ET extraction function.
The relevant SAP TM ETs need to be activated as follows:
Freight Unit and Freight Order
In IMG activity: Integration with Other SAP Components -> Event Management Interface -> Define Application Interface -> Define Used Bus. Proc. Types, Appl. Obj. Types, and Evt Types
Select “Define Used Business Process Types” of 'TMS_TOR' -> Select “Define Event Types”
Ensure that each event type, listed below, has a relevant SAP Event Management system defined in the “Event Manager” Field and that the “EM Relevance of Appl. Obj” checkbox is checked.
ODT30_BLOCK
ODT20_CANCEL
ODT20_SCHEDULED
ODT20_TO_ARRIVAL
ODT20_TO_DEPART
ODT20_TO_LOAD_BEGIN
ODT20_TO_LOAD_END
ODT20_TO_POD
ODT20_TO_POPU
ODT20_TO_UNL_BEGIN
ODT20_TO_UNL_END
ODT30_UNBLOCK
Resource
In IMG activity: Integration with Other SAP Components -> Event Management Interface -> Define Application Interface -> Define Used Bus. Proc. Types, Appl. Obj. Types, and Evt Types
Select “Define Used Business Process Types” of 'TMS_RES' -> Select “Define Event Types”
Ensure that each event type, listed below, has a relevant SAP Event Management system defined in the “Event Manager” Field and that the “EM Relevance of Appl. Obj” checkbox is checked.
RES30_ARRIVAL
RES30_COUPLING
RES30_DECOUPLING
RES30_DEPARTURE
RES30_EE_MODIFY
Instruction
In IMG activity: Integration with Other SAP Components -> Event Management Interface -> Define Application Interface -> Define Used Bus. Proc. Types, Appl. Obj. Types, and Evt Types
Select “Define Used Business Process Types” of 'TMS_INS' -> Select “Define Event Types”
Ensure that each event type, listed below, has a relevant SAP Event Management system defined in the “Event Manager” Field and that the “EM Relevance of Appl. Obj” checkbox is checked.
ODT30_INS_EXEC
Direct Output Agent (DOA)
In SAP TM, the data extraction for SAP EM is triggered by a direct output agent (DOA).
Note: OSS notes 1841552 and 1845024 have to be implemented in SAP TM for Direct Output Agent SEND_EM_DATA_FROM_TOR_ASYNC to function. As an alternative, SP09 for SAP TM 8.0 or SP07 for SAP TM 8.1 or SP05 for SAP TM 9.0 can be installed.
Available Direct Output Agents in SAP Transportation Management
In the IMG: Cross-Application Components -> Processes and Tools for Enterprise Applications -> Reusable Objects and Functions for BOPF Environment -> PPF Adapter for Output Management -> Maintain Output Management Adapter Settings.
The SAP EM related DOAs are shown in the Figure below (a new version of SEND_EM_DATA_FROM_TOR_ASYNCH is also available.)
SEND_EM_DATA_FROM_INS
Tracking Instructions with Business Process Type “TMS_INS” and Application Object Type “ODT30_INS” (available with TM 9.0)
SEND_EM_DATA_FROM_TOR (Class /SCMTMS/CL_OUTMGMT_EXEC_TOR) and SEND_EM_DATA_FROM_TOR_ASYNC (Class /SCMTMS/CL_DOA_EXEC_TOR_ASYNC)
Tracking Freight Units with BPT “TMS_TOR” and AOTs “ODT20_FU” (available with TM 8.0) and ODT30_FU (available with TM 9.0)
Tracking Freight Orders/Freight Bookings with BPT “TMS_TOR” and AOTs “ODT20_TO” (available with TM 8.0) and “ODT40_TO” (available with TM 9.2)
Tracking Transportation Units with BPT “TMS_TOR” and AOT “ODT30_TU” (available with TM 9.1)
Tracking Resources with BPT “TMS_RES” and AOT “RES30_RESOURCE” (available with TM 9.1)
SEND_EM_DATA_FROM_TRQ
Tracking Forwarding Orders with BPT “TMS_TRQ.” No standard visibility process is available.
Note: Only one of these should be enabled at any one point in time. See OSS note 1842397.
In the next block we'll run through the config needed for the SAP TM object types.
Comments