Resource Tracking Scenario For SAP Transportation Management PDF
Resource Tracking Scenario For SAP Transportation Management PDF
Release: SAP EM 9.0 SP04 and higher, SAP TM 9.1 and higher
Version: 1.1
PUBLIC
Some software products marketed by SAP AG and its distributors contain proprietary software
components of other software vendors.
Microsoft, Windows, Excel, Outlook, PowerPoint, Silverlight, and Visual Studio are registered
trademarks of Microsoft Corporation.
IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x, System z,
System z10, z10, z/VM, z/OS, OS/390, zEnterprise, PowerVM, Power Architecture, Power Systems,
POWER7, POWER6+, POWER6, POWER, PowerHA, pureScale, PowerPC, BladeCenter, System
Storage, Storwize, XIV, GPFS, HACMP, RETAIN, DB2 Connect, RACF, Redbooks, OS/2, AIX,
Intelligent Miner, WebSphere, Tivoli, Informix, and Smarter Planet are trademarks or registered
trademarks of IBM Corporation.
Linux is the registered trademark of Linus Torvalds in the United States and other countries.
Adobe, the Adobe logo, Acrobat, PostScript, and Reader are trademarks or registered trademarks of
Adobe Systems Incorporated in the United States and other countries.
Oracle and Java are registered trademarks of Oracle and its affiliates.
UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.
Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are
trademarks or registered trademarks of Citrix Systems Inc.
HTML, XML, XHTML, and W3C are trademarks or registered trademarks of W3C®, World Wide Web
Consortium, Massachusetts Institute of Technology.
Apple, App Store, iBooks, iPad, iPhone, iPhoto, iPod, iTunes, Multi-Touch, Objective-C, Retina, Safari,
Siri, and Xcode are trademarks or registered trademarks of Apple Inc.
RIM, BlackBerry, BBM, BlackBerry Curve, BlackBerry Bold, BlackBerry Pearl, BlackBerry Torch,
BlackBerry Storm, BlackBerry Storm2, BlackBerry PlayBook, and BlackBerry App World are
trademarks or registered trademarks of Research in Motion Limited.
Google App Engine, Google Apps, Google Checkout, Google Data API, Google Maps, Google Mobile
Ads, Google Mobile Updater, Google Mobile, Google Store, Google Sync, Google Updater, Google
Voice, Google Mail, Gmail, YouTube, Dalvik and Android are trademarks or registered trademarks of
Google Inc.
Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal
Decisions, Web Intelligence, Xcelsius, and other Business Objects products and services mentioned
herein as well as their respective logos are trademarks or registered trademarks of Business Objects
Software Ltd. Business Objects is an SAP company.
Sybase and Adaptive Server, iAnywhere, Sybase 365, SQL Anywhere, and other Sybase products
and services mentioned herein as well as their respective logos are trademarks or registered
trademarks of Sybase Inc. Sybase is an SAP company.
Crossgate, m@gic EDDY, B2B 360°, and B2B 360° Services are registered trademarks of Crossgate
AG in Germany and other countries. Crossgate is an SAP company.
All other product and service names mentioned are the trademarks of their respective companies.
Data contained in this document serves informational purposes only. National product specifications
may vary.
These materials are subject to change without notice. These materials are provided by SAP AG and
its affiliated companies ("SAP Group") for informational purposes only, without representation or
warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the
materials. The only warranties for SAP 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.
Solution Manager
SAP TM – EM Integration Guide TM 9.1
Document
Related NOTEs
SAP NOTE NOTE Description
1930447 Table Index for /SAPTRX/EVM_REF for Resource Tracking
SP5 Recommended - Contains all adjustments for the Resource Tracking Visibility
EM 9.0 SP5
Scenario
Document History
Document Changes Date
Version
Added chapters:
- Status Attributes
1.1 - BAdI /SCMTMS/SEND_TOR_DATA 13.12.2013
- Propagation of Events between TM documents
This document is a detailed description of this visibility processes and the integration of SAP Event
Management 9.0 with SAP Transportation Management 9.1. It is aimed at readers with expertise in
SAP Event Management, who want to understand the principles and the details of the implementation
of the SAP Event Management content for SAP TM. Its focus is on a concise and complete description
of the SAP Event Management features. As such, it is supplementary to the TM scenario guides,
which (where applicable) show, how SAP Event Management is used to monitor a given process.
The overview is also relevant for a wider audience who wants to understand the scope and the main
features of this content.
Overview
The content of SAP Event Management for SAP TM focuses on monitoring the execution of the
transportation processes. Consequently it refers to those business documents in SAP TM that are
execution relevant.
With Resource Tracking, the existing TM visibility scenarios are enhanced so that the utilized
resources are also tracked within SAP Event Management across multiple TM documents. This
means that now it is possible to track resources like railcars, containers etc. during their entire
lifecycle.
The Resource Tracking visibility scenario follows a generic approach. That means in SAP Event
Management there is only one generic Resource EH Type RES30_RESOURCE which is used to
model all existing resources from TM. If separate EH Types for e.g. container, railcars, locomotives,
truck and trailer are required they must be realized in a custom scenario. Currently the railcar,
locomotive as well as truck and trailer resources are supported and they are also described in the
sample scenario in this document.
The resource Event Handler (EH) is created from the Resource Master Data in SAP TM using the
Change Notification Agent. This will create, update and delete the resource in SAP Event
Management if flagged as “Relevant for Event Management”.
As soon a resource is planned within TM or assigned to a TM document, the Expected Events (EEs)
for the Resource EH are created or updated. That means, for example, if a resource is assigned to a
TM Freight Order the EEs Arrival and Departure from the Freight Order are also created for the
Resource EH in SAP Event Management.
With TM 9.1 a new Application Object Type was introduced for the Transportation Unit. This is used to
model e.g. multiple Railcar Resources in one composite TM Document (Railcar Unit) which is
executed with a Freight Order. A railcar unit makes up the logistic processing of transports with
railcars. It describes the assignment of cargo to a railcar.
A railcar unit can comprise one or more railcars. If you have not already created the railcar items in the
forwarding order, you can use the railcar unit as a consolidation document. This means that the freight
unit is created based on a product item, for example. You then assign this product freight unit to the
railcar unit. Alternatively, you can assign the freight unit directly to a railcar that you have created in
the rail freight order.
New EEs introduced with the Railcar Unit are Coupling and Decoupling Events. They are also created
in the Resource EH in SAP Event Management. Tracking of Resources
(C) SAP AG Page 6 of 30
You can use this function to track resources that are defined as master data in SAP Transportation
Management (SAP TM). This tracking process is part of the functions to monitor the transportation
execution of processes managed by SAP TM. The visibility process integrates SAP TM and SAP
Event Management.
You can use this resource tracking visibility scenario to track resources over their entire lifecycle:
Tracking starts when the resource is entered into the SAP TM master data with the SAP Event
Management system connected. Further, you must set the resource attribute Relevant for
Event Management and assign a Means of Transport which is not flagged as Multiresource.
Tracking ends when the attribute Relevant for Event Management is removed.
If you have connected SAP Event Management, you can monitor the execution events that are related
to a certain resources by tracking the corresponding event handlers in SAP Event Management. SAP
Event Management enables the following features:
Your transportation dispatcher can check the availability of a certain resource or can get an
overview over all available resources.
Your carrier can report events directly for a resource, for example to update the actual
position.
Your transportation dispatcher can receive an alert when an unexpected event is reported, for
example, the damage of a resource
You can track the following expected events for resources in SAP Event Management:
When your carrier sends an event message for the related freight document via SAP Event
Management to SAP TM, SAP TM propagates this event message back to the related
resource event handler(s) in SAP Event Management. SAP Event Management updates the
data for the resource event handler(s) accordingly.
When you update the execution information of a freight document directly in SAP TM, SAP TM
sends an event message to the related resource event handler(s) in SAP Event Management.
SAP Event Management updates the data for the resource event handler(s) accordingly.
When your carrier sends an event message directly for the resource via SAP Event
Management. SAP Event Management updates the data for the resource event handler
accordingly. However there is no automatic propagation of the event to the related freight
document(s) in SAP TM.
SAP Event Management can also track the following unexpected events:
You can use this function to track transportation units. This tracking process is part of the functions to
monitor the transportation execution of processes managed by SAP Transportation Management
(SAP TM). The visibility process integrates SAP TM and SAP Event Management.
In transportation planning, the shipper or ordering party asks you to transport goods from one location
to another. On receiving the order, your transportation dispatcher creates a transportation requirement
in SAP TM. SAP TM creates freight units to fulfill the transportation requirement. If you have
connected SAP Event Management, you can monitor the execution phase of the transportation units
by tracking the corresponding event handlers in SAP Event Management. SAP Event Management
enables the following features:
Your shipper or ordering party can monitor the status changes of transportation units.
Your transportation dispatcher, shipper or ordering party, consignee, and carrier can monitor
the expected and actual events for transportation units, from loading the goods to the proof of
delivery at the consignee.
Your transportation dispatcher, shipper or ordering party, consignee, and carrier can monitor
the expected and actual events for transportation units.
Your carrier can report events, including unexpected events, for example, a delay.
Your transportation dispatcher can receive an alert when an unexpected event is reported, for
example, delay of the transportation unit.
You can track the following expected events for transportation units in SAP Event Management:
Loading Begin
Loading End
Coupling
Departure
Arrival at Destination
Decoupling
Unloading Begin
Unloading End
When your carrier sends an event message from the SAP Event Management Web user
interface or any other external interface to SAP EM, SAP EM updates the data of the
corresponding event handler and sends an update to SAP TM. SAP TM then updates the
transportation unit with the information in the event message and can propagate the event to
related freight documents like assigned freight units if applicable.
When you update the transportation unit directly in SAP TM, SAP TM sends an event
message to SAP Event Management. SAP Event Management updates the data for the
transportation unit.
SAP Event Management can also track the following unexpected events:
Delay
When these events occur, SAP Event Management can send an alert.
Pre-requisite
The pre-requisite for activating the resource tracking visibility scenario are described in the SAP TM –
EM Integration Guide version 4.0 which is available on the SAP Help Portal.
NOTE:
If the flag is set afterwards, the Resource EH is created in SAP Event Management but does
not receive any changes from the TM documents it has been assigned to before the flag was
set.
If the resource has a Means of Transport which is flagged as Multiresource, it is not tracked.
This is because multiresources are used for planning not tracking.
The CNA registers master data changes and triggers the corresponding functions in the applications.
The master data and applications must be connected actively to the CNA. The CNA checks if a master
data change is relevant to the corresponding application. This usually involves a field check. However,
individual check algorithms can also be implemented in the applications.
For the Resource Tracking visibility scenario the CNA is used to register new, changed and deleted
resource master data and trigger the interface to SAP Event Management.
On the next level the CNA for Resource Tracking must be activated set the Active/Inactive Flag and
make sure the New, Deleted and BIMG Relevant Flags are checked.
On the third level the relevant CNA subobjects must be added. The subobjects are defined in the
maintenance table – sm30 /SCMB/CNA_OBJSOB. In this table there is also an Active flag which can
be used to activate and deactivate the subobjects.
The main object for the resources to be tracked is RES_H, the header information.
The main object and the subobject are extracted as a separate table for the resource. However, some
information is merged e.g. the resource header and resource header text as well as the resource
downtimes and resource downtime text.
The following subobjects are available for the Resource Tracking CNA:
An “arrival” event received for the freight order, for instance, implicitly means that all transportation
units and freight units assigned to this booking at the point in time of the event are also arrived at the
named location. This feature has to be enabled explicitly in the customizing of the freight order/freight
booking type (setting “Propagate Execution Information” has to be checked).
Events that are reported for a freight unit will only be propagated to the related transportation unit,
freight order or freight booking when it has already been reported to all freight units that are assigned
to the transportation unit, freight order or freight booking, e.g. if the departure is reported on freight unit
level, it will be automatically propagated to the freight document when it has been reported for all
freight units.
Special cases are here the events “Loading Begin” and “Unloading Begin”. These are already
propagated as soon as the first freight unit receives one of these events. “Loading End” and
“Unloading End” are again propagated only when it is reported for the “last” freight unit.
The following diagram shows, how the events are propagated between the different documents
(freight unit, transportation unit and freight order) and the different systems (in case propagation of
execution information is enabled for the freight order and transportation unit):
Freight Unit:
Automatic propagation to related transportation unit in SAP TM is done
SAP EM Rule set of freight unit event handler is set up to update TM
Event is propagated to the freight unit in SAP TM
Transportation Unit:
Automatic propagation to related freight order in SAP TM is done
The Event extractor of the transportation unit in SAP TM propagates the event to the
transportation unit in SAP EM
If the event is relevant for resource tracking, an additional event message is sent to the
resource Event Handler in SAP EM
Freight Order:
The Event extractor of the freight order in SAP TM propagates the event to the freight
order in SAP EM
If the event is relevant for resource tracking, an additional event message is sent to the
resource Event Handler in SAP EM
Freight Order:
Automatic propagation to related transportation unit in SAP TM is done (if customizing in
freight order type is set to “Propagate Execution Info”)
The Event extractor of the freight order in SAP TM propagates the event to the freight
order in SAP EM
If the event is relevant for resource tracking, an additional event message is sent to the
resource Event Handler in SAP EM
Transportation Unit:
Automatic propagation to related freight unit in SAP TM is done (if customizing in
transportation unit type is set to “Propagate Execution Info”)
The Event extractor of the transportation unit in SAP TM propagates the event to the
transportation unit in SAP EM
If the event is relevant for resource tracking, an additional event message is sent to the
resource Event Handler in SAP EM
Freight Unit:
The Event extractor of the freight unit in SAP TM propagates the event to the freight unit
in SAP EM
This propagation leads to a situation that the events are always propagated to all relevant documents
if the system is set up correctly:
Event extractors in SAP TM have to be active for the event types that shall be propagated to
SAP EM
Transportation Units and Freight orders/freight bookings in SAP TM have to be enabled in the
type customizing to propagate the execution info.
Propagation to predecessor documents is triggered only in case if “Propagation Execution
Info” flag has been set. Propagation to successor documents is triggered automatically.
Rule sets in SAP EM have to be configured that events are propagated to SAP TM (activity
function TM_MAINTAIN_EXEC_INF)
1 2 3 4 5 6 7 8 9 10 11
1 2 3 4 5 6 7 8 9
Loading Loading
Transportation Unit
End
Coupling Departure Arrival ……. Delay ……. Decoupling Unloading Unloading
Begin Begin End
1 2 3 4 5 7 8 9 10
In that scenario the responsible logistics unit of the shipping organization plans a rail transport of two
Freight Units of sand which should be transported on two railcars (RC) from Rotterdam via Maschen
and Mannheim to Walldorf.
In SAP TM two different Freight Units are created which are then transported each with a separate
Railcar Unit (Transportation Unit). The Railcar Units represent the passive vehicles of the transport
and need to be coupled with an active vehicle. The active vehicle is the locomotive (LOC) which is
then assigned to the Freight Order which then pulls the railcars represented by the two Railcar Units.
In this sample scenario the transport is executed with a single Freight Order from Rotterdam to
Walldorf.
Depending on the how the transport is organized within TM the following TM documents are created:
Resource - RES30_RESOURCE
Expected Event Sequence EE Date
COUPLING (TU) 30 from Application System – Based on the TU data
DEPARTURE (FO) 40 from Application System – Based on the TU data
ARRIV_DEST (FO) 50 from Application System – Based on the FO data
DECOUPLING (TU) 60 from Application System – Based on the FO data
Two Freight Units FU1 and FU2 are created. FU1 and FU2 are also represented by two EHs in SAP
Event Management.
Two Railcar Units RCU1 and RCU2 are created on which the freight units FU1 and FU2 are loaded.
RCU1 and RCU2 are also represented by two EHs in SAP Event Management. The existing Railcar
Resources are then assigned to a Railcar Unit items.
The two Railcar Units RCU1 and RCU2 are then pulled by a locomotive which is assigned to the
created freight order, FO1. FO1 is represented by another resource EH in SAP Event Management.
NOTE: If the complete transport is planned, the Resource EHs which are utilized are updated with the
EEs from the TM documents as soon the EEs are created on the other documents.
EH dependencies in EM
Based on the sample scenario the following EH dependencies exist within SAP Event Management:
Automated updates across several status attributes cannot be provided as standard because of the
potential complexity of interdependencies in the generic scenario. However, if the interdependencies
are unambiguous in your specific use case, you can easily add your own logic to the event processing
rules to add interdependent updates.
Thus you should ensure that you send sets of status changing events that are consistent in your
scenario. For example, in your scenario a status change to “Unserviceable” for the availability status,
might be consistent with a status change to “Not Usable” for the maintenance status.
Availability Status
RES30_AVAILABILITY
EMPTY_ON_STOCK Empty on Stock
IN_USE In Use
RESERVED Reserved
UNSERVICEABLE Unserviceable
The Availability Status describes the actual availability of a resource for use in a transport. This status
mainly reflects the state to be considered when “physically” starting an operation on-site.
“Empty on Stock” means that the resource is stored empty in a storage location. It is available
immediately for a transport from that location.
“In Use” means that the resource is being used either for a transport (full or empty) or for any
other purpose, for example, as a storage container. It is not available and cannot be assigned
to a different transport at present.
“Reserved” means that the resource is stored at a location but is not available for a transport
other than the one it is already booked for.
“Unserviceable” means that the resource is at a location, but is not available for a transport
because of its physical state. For example, a container is damaged and in need of repair or a
truck has a defective engine.
RES30_LOADING
EMPTY Empty
FULLY_LOADED Fully Loaded
PARTIALLY_LOADED Partially Loaded
The Loading Status is only used for resources that can take a load. It describes how loaded the
resource is at the time when it is observed.
Maintenance Status
RES30_MAINTENANCE
IN_MAINTENANCE In Maintenance
NOT_USABLE Not Usable
USABLE_WO_REST Usable Without Restrictions
USABLE_W_REST Usable With Restrictions
The Maintenance Status describes the actual state of a resource with regards to maintenance.
“In Maintenance” means that the resource is currently subject to a maintenance service.
“Not Usable” means that the resource cannot be used because of its maintenance state. For
example a railcar would be “not usable” if its general inspection is overdue. This can imply that
its corresponding availability status should be changed to “Unserviceable”. However, as
already explained, no automatic logic is implemented to do this.
“Useable without Restrictions” means that the resource can be used for any purpose it is
designed for without any maintenance restrictions.
“Useable with Restrictions” means that the resource can be used, but not for all of the
purposes it is designed for. For example, if a container is rusty it can be used for transporting
goods such as coal, but not for transporting food or pharmaceutical drugs where cleanliness is
critical.
Planning Status
RES30_PLANNING
AVAILABLE Available for Planning
BLOCKED Blocked for Planning
The Planning Status is for display only. It describes the availability of the resource for planning in SAP
Transportation Management. This status is a copy of the corresponding Planning block status in the
resource master data record in TM and must not be changed in SAP Event Management.
In the Resource Tracking visibility scenario for TM, the Expected Events are not created, updated and
deleted using the Expected Event Extractor from TM. This is due to the fact that the EEs are based on
the TM documents the Resources are assigned to.
When creating or updating a TM freight document which references a certain TM Resource, the EH for
this Resource is not updated or created via /SAPTRX/BAPI_EH_POST. As described previously, the
Resource EH is created via the Change Notification Agent based on the TM Resource Master Data
without any EEs as this is not possible at the time the Resource is created.
The EEs for the Resource are created, updated and deleted via Event Message with updated
CT_TRACKEEMODIFY Structure. Using the Event Message RES30_EE_MODIFY which is assigned to
the Business Process Type TMS_TOR, the EEs are generated depending on certain Relevance
Conditions for each of the TM TOR Types (FU, TU and FO).
Expected Event
LOAD_BEGIN (FU)
LOAD_END (FU)
COUPLING (TU)
DEPARTURE (FO)
ARRIV_DEST (FO)
DECOUPLING (TU)
UNLOAD_BEGIN (FU)
UNLOAD_END (FU)
The EEs for the resource EH are then created/updated/deleted by the rule set activity
EVM_EE_UPDATE. To enable the activity to take over certain attributes from an expected event
profile when creating an expected event, the two new optional parameters “Use EH EE Prof.” and “EE
Profile” are used to determine the expected event profile.
By using the EVM_EE_UPDATE activity in the rule set for the Event Message RES30_EE_MODIFY, it
is possible to specify either an EE Profile or set a flag that the EE Profile should be used from the
Event Handler Profile.
(C) SAP AG Page 21 of 30
The reason why this was a requirement for the EE Modify event was that the various EEs which are
created during the lifetime of a resource cannot be clearly identified when receiving an event
message.
To make this possible, each EE uses the fields DATACS (Data Code Set) and DATAID ( Data Code ID
) to reference the TM document the EE is referring to.
When receiving an event message the function for “Check Data” from the EE Profile must be activated
so that each event message can be clearly assigned to an EE on the Resource EH. See the previous
screenshot which shows the TM document in the last two columns.
This is now possible using the EVM_EE_UPDATE activity and reference the EE Profile for this EH
where the Check Data function is set.
This document describes a sample scenario and a possible use case for which the multiple tracking id
functionality might be useful.
You use this functionality for example when you want to send a single Event Message and apply it to
multiple Event Handlers to track for example at the level of a single railcar resource. One or multiple
railcars can be assigned to a rail freight order directly or via railcar unit. When a shipper reports the
ARRIVAL event for the entire freight order, a single event message is sent to SAP Event Management
for the assigned railcar resources. This event message then needs to be propagated to all railcars for
which this event applies.
On the Rail Freight Order level, an ARRIVAL event message is sent which is configured for the
Multiple Tracking ID use case. In SAP Event Management the customizing for the visibility scenario
and event message is checked and if relevant the event message is used for multiple event handlers
within SAP Event Management.
In this scenario the single ARRIVAL event message would be applied to all relevant railcar event
handlers which are referenced within the event message.
In Customizing under Event Management Event Messages, Status Queries, and Web Interface
Define Criteria for Event Message Processing Structure Item “Enable Multiple Tracking IDs”
To enable this functionality for the resource event handler and arrival event message, create the
following entry:
The Event Message header parameters from the source system must match the above customizing
values. For each railcar event handler, an entry in the further reference table must be created with
REFUSAGE value 'M'.
For more detailed information, refer to the SCN document Multiple Tracking IDs.
PERFORMANCE NOTE: If the Resource Tracking visibility scenario is extensively used consider the
following SAP Note: 1930447 - Table Index for /SAPTRX/EVM_REF for Resource Tracking
to avoid performance issues.
This has an impact on how the corresponding EEs are deleted on the related resource event handlers.
If the TOR_ROOT is available, the event message RES30_EE_MODIFY is sent from the Application
Objects Types assigned to Business Process Type TMS_TOR. If only TOR_ROOT_BEFORE is
available, the event message RES30_EE_MODIFY cannot be sent from TMS_TOR. This is sent from
the Application Objects Type RES30_RESOURCE assigned to Business Process Type TMS_RES.
In the case of deletion no event message can be sent for the Application Object Types from TM which
are assigned to Business Process Type TMS_TOR as the TOR_ROOT image is not available. In this
case the EEs which have been created on the Resource EH wouldn’t be deleted if a TM document is
deleted.
In most Resource Tracking scenarios it is expected that during the lifetime of a resource a very large
number of event messages will be received for the Resource EH.
For this reason the Event Data Filter feature has been introduced to restrict the number of event
messages in the search query to a period of time which is of interest. Using this feature only the
resource event messages which are within the specified period are displayed.
The Event Date Filter is activated in the Selection Profile by the “Evt. Date Filter” check box.
For more detailed information, refer to the SCN document Event Date Filter Selection.
If the planned (future) route is also of interest, check the following SCN document which contains a
sample implementation http://scn.sap.com/docs/DOC-44725.
With the standard content for the Resource Tracking Visibility Scenario there is no option that events
reported for a Resource EH like for a Railcar are propagated to the corresponding TM Document such
as the Freight Order.
When an event message is received from an external party for a freight document e.g. freight order,
then the corresponding TM document is known from the document number (TOR ID). With this
information you can update SAP TM.
When an event message is received from an external party for a resource then there is no direct link to
the corresponding TM document. In this case you must build your own logic to determine the TM
document e.g. freight order number.
If the external party already sent the information for the TM document in the event message header,
the event can be propagated to TM.
Assuming the external partner sending the event message does not have any reference to any TM
documents, determination logic must be implemented to find the corresponding TOR ID for the Freight
Order or Transportation Unit.
Note: When sending the event message from the EM Web UI there is no need to implement
this workaround as the TM document link is already extracted with the EEs. When reporting
the event message via “Report All Expected Events” the information TM Doc. ID and TM Doc.
Type is already available.
The following workaround ispossible for customers who want to implement such a scenario:
1. Use a Preprocessing Function for the events that should be propagated from the resource EH to TM
documents which do not have any information about the TM document. If the TOR ID is already part of
the event message this step can be skipped.
In the Preprocessing Function the event message header field e.g. for DATAID must be updated with
the required TOR ID. The logic of how this is determined is dependent on the customer scenario.
FIELD-SYMBOLS:
<fs_evm_hdr> TYPE /saptrx/evm_hdr_tabtyp,
<fs_evm_hdr_line> TYPE /saptrx/evm_hdr_str.
ls_requestids-trxcod = <fs_evm_hdr_line>-trxcod.
****************************************************************************
* Put your own logic here - how to determine the correct TM Document
****************************************************************************
* for testing read first entry in expected event table and get datacs / dataid
* to update the corresponding TM document
READ TABLE lt_expectedevents INTO ls_expectedevents INDEX 1.
<fs_evm_hdr_line>-datacs = ls_expectedevents-datacs.
<fs_evm_hdr_line>-dataid = ls_expectedevents-dataid.
ENDIF.
2. In the Rule set add the TM_MAINTAIN_EXEC_INF activity (pre-requisite SAP Note 1934476)
The Tracking ID which is originally set to the Resource ID when receiving the event message is then
overwritten with the determined TOR ID when updating the Execution Information in TM.
This Business Add-In (BAdI) can be used in the Integration with Event Management (TM-INT-EM)
component.
If the BAdI is implemented and the BAdI Work Mode is set (see BAdI method documentation), the
BAdI is called in the Method /SCMTMS/CL_EVENT_MANAGEMENT->SEND_TOR_DATA.
BAdI methods:
SET_BADI_WORK_MODE
Use this method to control the work mode of a BAdI. Set the work mode for the corresponding
BAdI method using the parameter CT_WORK_MODE.
CALL_EVENT_MGR
Add custom logic to fill Application Table and trigger the Event Manager Communication.
Using this method you can re-sort and enrich the data for Event Management and execute
separate calls to initiate different queues from TM to Event Management.
GET_ADDITIONAL_DATA
Retrieve Additional Data for Event Manager Communication. If the available number of
application tables for the used business process type are not sufficient, this method can be
used to add more tables to the table_container.
PREVENT_EVENT_MSG_SENDING
Set Indicator to Prevent Event Message Sending. If in certain cases the sending of Event
Messages can be prevented the performance can be improved.
AVOID_RETRIEVAL_OF_APPL_TABLES
Set indicators to avoid retrieval of unnecessary data. If not all data of the defined application
tables that are defined in the standard are necessary, indicators can be set to avoid the
retrieval of this data.
For detailed documentation please see the documentation in the system. Documentation is also
attached to note 1935617. There you can also check in which support package of which release it is
available.
Example: