Professional Documents
Culture Documents
Applies to:
SAP Transportation Management, SAP Event Management
Summary
This document provides an overview of what can be done if the integration between SAP EM and SAP TM is
not working as expected.
It describes in detail:
• what can be checked when analyzing issues including checks on
- transactional data
- customizing settings
• which monitors and logs are available and how these can be checked and enabled
• how the process can be debugged.
Additionally there is a list of some common root causes of issues which occurred in various projects. The
focus is on the order tracking scenarios, but many of the points are valid for the instruction tracking and
resource tracking scenarios as well.
If issues occur which are related to the integration of SAP TM and SAP EM, the most common symptom is
typically that the data between the two involved systems is no longer consistent. Either:
• an update did not reach SAP EM (calls of /SAPTRX/BAPI_EH_POST or
/SAPTRX/BAPI_EH_ADDEVENTMSG_02 from SAP TM) or
• an update did not reach SAP TM (call of /SCMTMS/EXECINFO_PROCESS triggered by rule set
activity TM_MAINTAIN_EXEC_INF).
This can have multiple root causes. Therefore you typically have to consider several of the checks in this
document to find out what has gone wrong.
Company: SAP SE
1
Table of Contents
Check Queues .................................................................................................................................................... 3
Check Short Dumps ............................................................................................................................................ 3
Check TORs and EHs ........................................................................................................................................ 4
Check for locking issues ..................................................................................................................................... 4
Check Customizing in SAP TM........................................................................................................................... 5
TOR Types Settings ........................................................................................................................................ 5
Define Transportation Activities for Tracking and Tracing .............................................................................. 5
Check Direct Output Agent (order tracking and instruction tracking scenarios) ............................................. 5
Check Change Notification Agent (resource tracking scenario) ..................................................................... 6
SAP EM Application Interface ......................................................................................................................... 6
Check SAP Event Manger Definition “Define SAP EM” ............................................................................................... 7
Define Used Bus. Proc. Types, Appl. Obj. Types, and Evt Types ................................................................................ 7
Check Customizing in SAP EM .......................................................................................................................... 9
Define Application System .............................................................................................................................. 9
Define Parameter Mapping ........................................................................................................................... 10
Define Criteria for Event Message Processing ............................................................................................. 11
Preprocessing Functions............................................................................................................................................ 11
Enable Multiple Tracking IDs ..................................................................................................................................... 11
Check BAdI Implementations ........................................................................................................................... 11
SAP TM BAdIs .............................................................................................................................................. 12
SAP EM BAdIs .............................................................................................................................................. 12
Debugging TM -> EM........................................................................................................................................ 13
Debugging EM -> TM........................................................................................................................................ 13
Enable Logging ................................................................................................................................................. 14
Logging in SAP TM ....................................................................................................................................... 14
Logging in SAP EM ....................................................................................................................................... 15
Common Errors ................................................................................................................................................ 17
SAP TM ......................................................................................................................................................... 17
SAP EM ......................................................................................................................................................... 18
Important SAP Notes ........................................................................................................................................ 19
SAP TM ......................................................................................................................................................... 19
SAP EM ......................................................................................................................................................... 19
Related Content ................................................................................................................................................ 21
Copyright........................................................................................................................................................... 22
2
Check Queues
• SAP TM:
o Outbound queues (TA SMQ1):
The standard outbound queue names are based on the pattern EM_<BPT>, for example.
“EM_TMS_TOR”. If updates from TM do not reach EM, for example event handler are not
being updated or event messages are not processed, check that the queue is active and
running. If status is “SYSFAIL”, check if a short dump has occurred in EM.
If entries for queues with name starting with ‘EM_’ are in status ‘SYSFAIL’, you can
check the error message in the details. If this does not give you enough information,
you can debug the processing of this new event information that has been
propagated from SAP EM.
It may also be the case these queues are not registered or activated and therefore
the entries are not processed. You should then register and/or activate all queues
starting with ‘EM*’ (see also chapter 1.3 in the integration guide for SAP TM and
SAP EM).
3
Check TORs and EHs
You should check the status of the objects (TOR object in SAP TM and event handler in SAP EM) in both
systems in detail.
• SAP TM:
Additionally to what you can see in the NWBC (e.g. execution tab on the freight order UI), you
should also check the EXECUTIONINFORMATION node on the test UI (TA /BOBF/TEST_UI). Only
here you can check which events have been persisted in SAP TM.
The field EXECINFO_SOURCE holds the information where the events come from:
o A: Reported Directly for this Document
o E: Propagated from SAP EM
o P: Propagated from Predecessor Document
o S: Propagated from Successor Document
o H: Derived from Handling Execution Status
o R: Read from SAP EM
• SAP EM:
In addition to what you can see on the web UI (which depends on the user profile you are using),
also check the event handler in the backend in the event handler list (TA /SAPTRX/EH_LIST). Here
you can check all the available parameters and all other available information in detail.
• SAP TM:
Check database table /SCMTMS/D_TRIGHD. This is the table which stores triggers that are written
if a locking issue occurs. If entries are available in this table, data of the corresponding objects might
not be up to date.
Entries with the following trigger IDs are likely if updates for the execution information from SAP EM
could not be processed due to locking issues:
o “PROPAGATE_EXECUTION_INFO”
o “TOR_PROCESS_EXEC_INFO”
o “TOR_SET_EXECUTION_STATUS”
The TRIGGER_KEY refers to the key of the node, for which the trigger has been set. You should
then check if report /SCMTMS/PROCESS_TRIGGER_BGD is scheduled for periodic execution. This
report normally takes care of processing the triggers.
• SAP EM:
o Check database table /SAPTRX/LOCKEDEH. This is the table which stores event
messages that could not be processed due to locked EHs. Reprocessing of the event
messages is done with reports /SAPTRX/PROCESS_LOCKED_EHS_PPF or
/SAPTRX/PROCESS_LOCKED_EH. Check that one of the two is scheduled to run
periodically.
o Check database table /SAPTRX/RP_AOID. This is the table which stores application object
IDs that could not be posted due to locking issues (such as the update of an EH that has
4
been locked). Check that report /SAPTRX/R_REPOST_AI_LOGS which takes care of the
reposting, is scheduled for periodic execution.
Check that all the events that are to be used are maintained. Unexpected Events that should be propagated
between freight documents in SAP TM have to have one of the following two stop categories assigned:
• Stop with Change of Main Resource – Inbound
• Stop with Change of Main Resource – Outbound
This is because propagation is done via the association between the TOR stops that are assigned to each
other. For unexpected events the corresponding stop has to be determined based on the location ID. The
stop category determines the correct stop (outbound or inbound) in this case.
Check Direct Output Agent (order tracking and instruction tracking scenarios)
The direct output agents are used to trigger execution of the EM application interface processing when data
is changed in the related business object.
5
For more information on the different direct output agents and the ways they can be used, check document:
http://scn.sap.com/docs/DOC-52226 .
For the order tracking scenarios, check that only one of the two available DOAs is enabled
(SEND_EM_DATA_FROM_TOR or SEND_EM_DATA_FROM_TOR_ASYNC related to business object
/SCMTMS/TOR). In the IMG the path is SPRO -> 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 -> Direct Output Agents (w/o PPF &
w/o History).
For the instruction tracking scenario, check that the DOA SEND_EM_DATA_FROM_INS (related to BO
/SCMTMS/INSTRUCTION) is enabled.
6
Check SAP Event Manger Definition “Define SAP EM”
SAP EM system needs to have a valid RFC destination. The SAP EM Version must be set to “SCM 4.0” and
local flag must not be set. The Sync flag should only be set in a testing environment and not in a productive
environment. This is also true if SAP TM and SAP EM are installed on the same system.
Note: The ‘Local’ flag must not be set – not matter if SAP EM and SAP TM are hosted on the same system
and client or not.
Define Used Bus. Proc. Types, Appl. Obj. Types, and Evt Types
Check that:
• all application object types and event types are enabled (EM Relevance of Application Object/Event
Type)
• the correct Event Manager is assigned for each and
• all other settings are as intended (for example relevance and extraction functions).
7
Event Message was not sent: Check “Define Event Types”
8
Check Customizing in SAP EM
Define Application System
You have to have an entry for your application system with a valid RFC destination and logical system. In a
productive environment synchronous communication should never be enabled. In addition, the
Acknowledgment flag
has to be enabled if the prerequisites described in SAP note 2235954 are not available
should not be enabled if the prerequisites are available (recommended).
Note: The ‘Local’ flag must not be set – not matter if SAP EM and SAP TM are hosted on the same system
and client or not.
If there is no entry for the application system, the following error message occurs during execution of
/SAPTRX/BAPI_EH_POST:
9
Define Parameter Mapping
Check that there is a valid entry for your combination of application system and application object type in
‘Assign Profile to Mapping Area’:
If this entry is not available, no event handler is created and the following error message can occur:
10
Define Criteria for Event Message Processing
Preprocessing Functions
For the correct processing of event message that report a delay (event codes DELAYED or DELAYED_FU)
the following entries have to be available here:
If these entries are missing, delays that are reported from the EM web UI cannot be processed correctly.
BC Set /SAPTRX/BC_RES30_V_EVMNT can be used to add the customizing entries. For more information
about “Multiple Tracking IDs” see: http://scn.sap.com/docs/DOC-48805
If these entries are missing, event messages that are sent from SAP TM to the resource event handler using
the standard event types cannot be processed in SAP EM.
11
SAP TM BAdIs
There are two available BAdIs that are directly involved in the integration of SAP TM and SAP EM:
• /SCMTMS/TOR_EVENT_PROC
used to influence the processing of incoming event message data (EM -> TM). Method
PROCESS_EVENT is called in method EXECINFO_PROCESS of class
/SCMTMS/CL_TOR_EXEC_PROCESS.
Check this if issues occur during the processing of propagated event messages in SAP TM
• /SCMTMS/SEND_TOR_DATA
used to influence and optimize data retrieval and extraction (TM -> EM). Methods are called at
several places in method SEND_TOR_DATA of class /SCMTMS/CL_EVENT_MANAGEMENT
(CALL_EVENT_MGR , GET_ADDITIONAL_DATA, PREVENT_EVENT_MSG_SENDING) and in the
direct output agents (AVOID_RETRIEVAL_OF_APPL_TABLES).
Check this if issues occur during
o data retrieval for the extraction (such as data is missing)
GET_ADDITIONAL_DATA
AVOID_RETRIEVAL_OF_APPL_TABLES
o event message sending (such as no sending takes place)
PREVENT_EVENT_MSG_SENDING
o issues when using multiple queues for posting updates to SAP EM
CALL_EVENT_MGR
For more information see: http://scn.sap.com/docs/DOC-49085
SAP EM BAdIs
There are many BAdIs available in EM that can influence integration in many different ways. It is worthwhile
to check which of them are used and whether they may be having any negative side effects.
In the standard scenarios, the following BAdI implementation should be active:
- RES30_RESOURCE: /SAPTRX/GEN_EH_S_IMPL
12
- ODT30_INS: /SAPTRX/GEN_EH_S_IMPL
- ODT40_TO: /SAPTRX/ODATA_FIORI_APPS
Debugging TM -> EM
In general, you have to know in which mode (synchronous or asynchronous) the direct object agent is
running, because this can have an impact on how to debug the process:
• Has Critical o/p: Process during Save - before Commit: Nothing special has to be done.
Breakpoints should work as expected.
• Has Uncritical o/p: Process after Commit (background): Since the direct output agent is running
asynchronously in an update task, you have to enable “Update Debugging” in your debugger
settings. To ensure that the breakpoints work, you can set an additional break point in some coding
which is executed synchronously, for example in /SCMTMS/CL_TOR_D_ROOT_BS->
/BOBF/IF_FRW_DETERMINATION~EXECUTE. (This method is executed as soon as any change is
made to a TOR object). If the debugger window then pops up, you can enable “Update Debugging”
under Settings -> Change Debugger Profile/ Settings and save your changes.
For the resource tracking scenario you have to ensure that “Update Debugging” is enabled as well. When
changing or creating resources you can put an additional breakpoint in include
/SAPAPO/LDM_RESOURCEF01 either in
• form RES_HEAD_CHANGE if changes in resource header have been done
• form RESOURCE_TEXT_CHANGE if only description text has been changed .
Debugging EM -> TM
• EM:
o If the standard activity is used to propagate event messages to SAP TM, this is, of course, a
good candidate for debugging: function module /SAPTRX/TMS_CHANGE_EXEC_INF. You
can change the local variable “lv_in_background“ in the debugger from ‘X’ to ‘ ‘ to have a
direct synchronous call to the TM system, which might be more suitable for debugging.
13
• TM
o processing starts with FM /SCMTMS/EXECINFO_PROCESS
o action that processes new or changed entries on node EXECUTIONINFORMATION:
/SCMTMS/CL_TOR_A_PROC_EXEC->/BOBF/IF_FRW_ACTION~EXECUTE
o action that processes the propagation to related TORs:
/SCMTMS/CL_TOR_A_PROP_EXEC_INF->/BOBF/IF_FRW_ACTION~EXECUTE
Enable Logging
If you have deactivated logging to optimize performance, you may activate it again temporarily to support the
error analysis.
Logging in SAP TM
In SAP TM the application log (TA SLG1) can be activated/deactivated
- per application object type (TA /SAPTRX/ASC0AO -> Select BPT -> Define Application Object Type)
- per event type (TA /SAPTRX/ASC0AO -> Select BPT -> Define Event Type ).
14
Logging in SAP EM
In SAP EM there are several settings to control how extensive the application log is.
15
• Settings for rule set task
For each rule set task you can define whether it should be logged or not. You can check this log in
the event handler list on tab “Tasks” (TA /SAPTRX/EH_LIST).
16
Common Errors
SAP TM
- Wrong reference to stop in expected event
Inbound queue (for FM /SCMTMS/EXECINFO_PROCESS) is in status SYSFAIL with error
message such as “TOR with ID XXX has no stop with key XXX” (at least if SAP Note 1940507 is
implemented, otherwise a short dump occurs)
This can happen, if an event message is sent for an expected event in SAP EM and propagated
to SAP TM. If a custom extraction function is used for the expected events and reference to a
wrong stop is set there, the correct stop cannot be determined for the related TOR.
- RFC user has not enough authorizations (role /SAPTRX/SAP_EM_ADMIN is needed or equivalent
role)
Event Handlers are not created, event messages are not processed due to missing
authorizations. This can be easily checked in the BAPI return messages respectively in the log.
17
- Acknowledgment is not sent -> no retrieval of EM data for execution tab
Either the sending of the acknowledgment is not enabled (IMG activity “Define Application
System” in SAP EM) without having the prerequisite notes/SPs available or somehow the
acknowledgement was not sent correctly. This leads to incomplete data in table
/SAPTRX/AOTREF in SAP TM. Then no EM data can be displayed on the execution tab of the
freight document.
Strong recommendation is to disable the acknowledgement in SAP EM. Please check SAP note
2235954 for further details. Please check especially if all necessary SAP notes have been
implemented / support packages have been installed in your SAP EM and SAP TM systems.
Otherwise you have to enable the acknowledgement, which is not recommended, especially in
high volume scenarios.
- No scheduling for freight order -> missing expected events for loading/unloading
If freight order has not been scheduled, the date/times for loading/unloading
(REQ_START/REQ_END) might not be available on the related stops. If this is the case, the
standard extractors do not create expected events for loading and unloading.
SAP EM
- Missing task to check reprocessing in rule set
Before sending an update to TM via rule set activity TM_MAINTAIN_EXEC_INF (or any custom
activity), check that this is not done if event messages are reprocessed (via rule set activity
CHECK_REPROCESS_FLAG). You can check how this should be done in any of the standard
multitask activities such as ODT30_FU_ARRIVAL.
If this check is omitted, this can lead to multiple unnecessary updates sent to TM and in the
worst case to endless roundtrips.
18
Important SAP Notes
SAP TM
2100110 Update of execution information gets lost due to locking issue (2)
2099044 No stop is determined for unexpected event that has been propagated from SAP EM to SAP
TM(2)
2072659 Parameters are not deleted for an event handler if related item is deleted in the freight
document
1950974 Short dump after reporting multiple events in SAP EM in one transaction
1968414 Propagated execution information from SAP EM is not saved due to error message
1940507 Short dump when event message is propagated to TM with wrong TORSTOPUUID
2128183 Extraction of loading, unloading, coupling and decoupling expected events is not correct
SAP EM
1951993 Display of consolidated events not correct if one event message matches multiple expected
events
2039801 Event handler gets recreated although no relevant change has been posted
19
1935720 Authorization check is not working correctly
20
Related Content
SAP Event Management – Scenarios for SAP Transportation Management
Resource Tracking Scenario for SAP Transportation Management
Integration of SAP TM and SAP EM – Optimizing the Performance
Integration of SAP TM with SAP EM – Details on the Direct Output Agents
21
Copyright
© 2015 SAP SE SE or an SAP SE affiliate company. All rights reserved.
No part of this publication may be reproduced or transmitted in any
form or for any purpose without the express permission of SAP SE.
The information contained herein may be changed without prior notice.
Some software products marketed by SAP SE and its distributors contain proprietary software components
of other software vendors. National product specifications may vary.
These materials are provided by SAP SE and its affiliated companies (“SAP SE Group”) for informational
purposes only, without representation or warranty of any kind, and SAP SE Group shall not be liable for
errors or omissions with respect to the materials. The only warranties for SAP SE Group products and
services are those that are set forth in the express warranty statements accompanying such products and
services, if any. Nothing herein should be construed as constituting an additional warranty.
SAP SE and other SAP SE products and services mentioned herein as well as their respective logos are
trademarks or registered trademarks of SAP SE in Germany and other countries.
Please see
http://www.sap.com/corporate-en/legal/copyright/index.epx#trademark
for additional trademark information and notices.
22