SAP Event Management -...
-
Upload
nguyenduong -
Category
Documents
-
view
239 -
download
6
Transcript of SAP Event Management -...
(C) SAP AG Page 1 of 30
SAP Event Management
Resource Tracking Scenario for SAP Transportation Management
Release: SAP EM 9.0 SP04 and higher, SAP TM 9.1 and higher
Version: 1.1
PUBLIC
Document Version: November 2013
(C) SAP AG Page 2 of 30
Copyright © Copyright 2013 SAP AG. All rights reserved. SAP Library document classification: PUBLIC No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. 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. IOS is a registered trademark of Cisco Systems 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. INTERMEC is a registered trademark of Intermec Technologies Corporation. Wi-Fi is a registered trademark of Wi-Fi Alliance. Bluetooth is a registered trademark of Bluetooth SIG Inc. Motorola is a registered trademark of Motorola Trademark Holdings LLC. Computop is a registered trademark of Computop Wirtschaftsinformatik GmbH.
(C) SAP AG Page 3 of 30
SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP BusinessObjects Explorer, StreamWork, SAP HANA, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries. 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.
(C) SAP AG Page 4 of 30
Table of Contents Related Documents ................................................................................................................................. 5
Related NOTEs ....................................................................................................................................... 5
Document History .................................................................................................................................... 5
Introduction .............................................................................................................................................. 6
Overview .................................................................................................................................................. 6
Tracking process within TM ............................................................................................................. 8
Tracking of Transportation Units ......................................................................................................... 8
Pre-requisite ............................................................................................................................................ 9
Change Notification Agent (CNA) Settings ............................................................................................ 10
Propagation of Events between TM documents.................................................................................... 12
Mutual Updates between freight units, transportation units and freight orders or bookings ............. 12
Sample Scenario “Railcar and Locomotive Tracking” ........................................................................... 15
Resource - RES30_RESOURCE ................................................................................................. 15
Freight Unit – ODT30_FU .............................................................................................................. 17
Transportation Unit – ODT30_TU.................................................................................................. 17
Freight Order – ODT30_TO ........................................................................................................... 18
EH dependencies in EM ................................................................................................................ 18
Additional Information ............................................................................................................................ 19
Status Attributes ................................................................................................................................ 19
Availability Status .......................................................................................................................... 19
Loading Status ............................................................................................................................... 20
Maintenance Status ....................................................................................................................... 20
Planning Status ............................................................................................................................. 20
Expected Events via EVM_EE_UPDATE for Resource Event Handler ........................................... 21
Multiple Tracking IDs ......................................................................................................................... 23
Delete vs. Cancel in SAP TM ............................................................................................................ 25
Event Date Filter ................................................................................................................................ 26
Display Planned Route of a Resource on the EM Geo Map ............................................................. 26
Update TM Documents from the Resource Event Handler ............................................................... 27
BAdI /SCMTMS/SEND_TOR_DATA ................................................................................................. 29
(C) SAP AG Page 5 of 30
Related Documents
Document Type Document Name (Link) Version
Solution Manager Document
SAP TM – EM Integration Guide TM 9.1
SCN Document Event Date Filter Selection http://scn.sap.com/docs/DOC-48806
SCN Document Multiple Tracking IDs
http://scn.sap.com/docs/DOC-48805
SCN Document SAP EM 9.0 SP4 Features
http://scn.sap.com/message/14502647#14502647
Related NOTEs
SAP NOTE NOTE Description
1930447 Table Index for /SAPTRX/EVM_REF for Resource Tracking
1934476 Update Execution Information in TM - Replace Tracking ID with Metadata Tag
EM 9.0 SP5 SP5 Recommended - Contains all adjustments for the Resource Tracking Visibility
Scenario
Document History
Document Version
Changes Date
1.0 Document Created 23.10.2013
1.1
Added chapters:
- Status Attributes - BAdI /SCMTMS/SEND_TOR_DATA - Propagation of Events between TM documents
13.12.2013
(C) SAP AG Page 6 of 30
Introduction With SAP Event Management 9.0 SP4 a new visibility process “Resource Tracking” is shipped to
monitor Vehicle Resources and Transportation Units used within SAP Transportation Management
(SAP TM) 9.1.
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 7 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
The following resource types are supported:
Active vehicle resources such as a trucks or locomotives
Passive vehicle resources such as trailers or railcars
Transportation units such as containers
You can track the following expected events for resources in SAP Event Management:
Coupling (only relevant for vehicle resources)
Departure
Arrival at Destination
Decoupling (only relevant for vehicle resources)
There are three ways of reporting the expected event:
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:
Sighting (to update the actual position of the resource)
Damage
(C) SAP AG Page 8 of 30
Tracking process within TM
Within SAP TM there are two stages of tracking of the resources:
a) Resource Master Data Changes
When the resource master data are created, changed or deleted, this triggers the execution of
the Change Notification Agent (CNA). The CNA then calls the EM application interface to
create, update or delete the corresponding event handlers in SAP Event Management. To
activate the CNA, refer to Change Notification Agent (CNA) Settings.
b) Operational Data from TM Freight Documents
As soon the resource is created within TM it can be used within the execution process. The
resource can be assigned to freight documents like freight orders or transportation units.
These are then the source for the expected events that will be generated for each
corresponding resource event handler in SAP Event Management. Events reported for these
freight documents are also propagated to the EM resource event handler. For a sample
scenario with railcar and locomotive, refer to Sample Scenario “Railcar and Locomotive Tracking”.
Tracking of Transportation Units
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
(C) SAP AG Page 9 of 30
There are two ways of reporting the expected event:
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:
Transportation Unit and Resource Tracking customizing settings specified in the TM – EM
Integration Guide
The Change Notification Agent for the Resources must be activated
Activate BAdI /SAPTRX/BADI_EH_S Implementation /SAPTRX/GEN_EH_S_IMPL (Method
CHECK_FOR_CHANGES implemented for Resource Tracking)
TM Resources that are flagged as “Relevant for Event Management” within the Resource
Master Data can be tracked. But tracking only begins when the resource is assigned to a TM
Document as this information is copied into the item information within TM.
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.
(C) SAP AG Page 10 of 30
Change Notification Agent (CNA) Settings
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.
To setup the CNA run TA “/n/scmb/cnacust” or in Customizing use SAP Transportation
Management SCM Basis Master Data Change Notification Agent Maintain Change
Notification Agent
The entry registered for Resource Tracking: App. ID “TM_EM_RES”
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.
For details see the method /SCMB/IF_CNA_APP_OBSERVER~SET_CHANGED_DATA in class
/SCMTMS/CL_CNA_RES_H. This is also the method that triggers the interface to SAP Event
Management.
The following subobjects are available for the Resource Tracking CNA:
(C) SAP AG Page 11 of 30
Subobject Description
RES_D Resource Downtimes
RES_DT Resource Downtimes Text
RES_HT Resource Header Text
(C) SAP AG Page 12 of 30
Propagation of Events between TM documents
Mutual Updates between freight units, transportation units and freight
orders or bookings To avoid redundant messaging or additional manual updates SAP TM supports mutual updates of
events that are implicitly relevant for both types of documents.
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):
(C) SAP AG Page 13 of 30
TM Freight Unit TM Transportation Unit TM Freight Order
EM Freight Unit Event HandlerEM Transportation Unit Event
HandlerEM Freight Order Event Handler EM Resource Event Handler
Event propagation from EM to TM
using rule set activity
TM_MAINTAIN_EXEC_INF
Event propagation between TM documents
by BOPF determinations
Sending event message from TM to EM
using event type
Event message is sent to freight unit event handler in SAP EM
TM Freight Unit TM Transportation Unit TM Freight Order
EM Freight Unit Event HandlerEM Transportation Unit Event
HandlerEM Freight Order Event Handler EM Resource Event Handler
Event is reported directly for freight order in SAP TM
(C) SAP AG Page 14 of 30
1. Event message is reported in SAP EM for the freight 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
2. Execution event is reported in SAP TM for the freight order:
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)
(C) SAP AG Page 15 of 30
Sample Scenario “Railcar and Locomotive Tracking”
Resource tracking for Railcar and Locomotive is one of the sample scenarios provided for SAP TM.
1 2 3 4 5 6 7 8 9 10 11
ScheduledLoading
BeginLoading
EndDeparture Arrival Unloading
BeginUnloading
EndDamage Arrival Unloading
BeginUnloading
End……. …….
1 2 3 4 5 6 7 8 9
Loading Begin
Loading End
Proof of Pickup
DepartureClear
Customs Arrival DelayUnloading
EndProof of Delivery……. …….
Railway Station: Rotterdam
Railway Station: Walldorf
Railway Station: Maschen
Railway Station: Mannheim
Pre-Carriage Main-Carriage On-Carriage
Expected Event Unexpected Event
1 2 4 5 7 8
Departure Arrival Delay Decoupling……. …….
Freight Order
Transportation Unit
Freight Unit
Loading Begin
Loading End
3
Coupling
9 10
Unloading Begin
Unloading End
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
(C) SAP AG Page 16 of 30
The Resource EHs RC1, RC2 and LOC are created via the Resource Master Data within TM and
should already exist in SAP Event Management. At this time the EEs are not yet created for any of the
TM documents. The EEs are updated step by step.
(C) SAP AG Page 17 of 30
Freight Unit – ODT30_FU
Expected Event Sequence Generated from EE Date Event Message Date
SCHEDULED 90 SCHEDULED from Application System EE Date + 24h
LOAD_BEGIN 100 LOAD_BEGIN from Application System EE Date + 24h
LOAD_END 200 LOAD_END from Application System EE Date + 24h
DEPARTURE 300 DEPARTURE from Application System EE Date + 24h
ARRIV_DEST 400 ARRIV_DEST from Application System EE Date + 24h
UNLOAD_BEGIN 500 UNLOAD_BEGIN from Application System EE Date + 24h
UNLOAD_END 600 UNLOAD_END from Application System EE Date + 24h
Two Freight Units FU1 and FU2 are created. FU1 and FU2 are also represented by two EHs in SAP
Event Management.
Transportation Unit – ODT30_TU
Expected Event Sequence Generated from EE Date Event Message Date
SCHEDULED 90 SCHEDULED from Application System EE Date + 24h
LOAD_BEGIN 100 LOAD_BEGIN from Application System EE Date + 24h
LOAD_END 200 LOAD_END from Application System EE Date + 24h
COUPLING 300 COUPLING from Application System EE Date + 24h
DEPARTURE 400 DEPARTURE from Application System EE Date + 24h
ARRIV_DEST 600 ARRIV_DEST from Application System EE Date + 24h
DECOUPLING 650 DECOUPLING from Application System EE Date + 24h
UNLOAD_BEGIN 500 UNLOAD_BEGIN from Application System EE Date + 24h
UNLOAD_END 600 UNLOAD_END from Application System EE Date + 24h
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.
(C) SAP AG Page 18 of 30
Freight Order – ODT30_TO
Expected Event Sequence Generated from EE Date Event Message Date
LOAD_BEGIN 100 LOAD_BEGIN from Application System EE Date + 24h
LOAD_END 200 LOAD_END from Application System EE Date + 24h
POPU 300 LOAD_END relative to Event with same Location (LOAD_END) + 2h
EE Date + 24h
COUPLING 350 COUPLING from Application System EE Date + 24h
DEPARTURE 400 DEPARTURE from Application System EE Date + 24h relative to previous Event (POPU)
CLEAR_CUSTOMS 500 CLEAR_CUSTOMS
from Application System EE Date + 24h
ARRIV_DEST 600 ARRIV_DEST from Application System EE Date + 24h
DECOUPLING 650 DECOUPLING from Application System EE Date + 24h
UNLOAD_BEGIN 700 UNLOAD_BEGIN from Application System EE Date + 24h
UNLOAD_END 800 UNLOAD_END from Application System EE Date + 24h
POD 900 UNLOAD_END relative to Event with same Location (UNLOAD_END) + 2h
EE Date + 24h
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:
Freight Order – ODT30_TO
Tracking IDs:
TOR_TEC – TOR ID Freight OrderTO – Tour TRQ – TRQ ID
Freight Unit – ODT30_FU
Tracking IDs:
FU – Freight Unit TRQ – TRQ IDBO – BookingTO – Tour
User Profile: ODT30_SHIPPER_FOParameter: ODT30_FO_ID_IN_FU
User Profile: ODT30_SHIPPER_FUParameter: CNTR_ODT30_ASSIGNED_FU
Transportation Unit – ODT30_TU
Tracking IDs:
TU – Transportation UnitFU – Freight Unit TRQ – TRQ IDTO – Tour
User Profile: ODT30_SHIPPER_FOParameter: ODT30_FO_ID_IN_TU
User Profile: ODT30_TUParameter: CNTR_ODT30_ASSIGNED_TU
User Profile: ODT30_SHIPPER_FUParameter: CNTR_ODT30_ASSIGNED_FU
Resource – RES30_RESOURCEPassive Vehicle (Rail Car)
Tracking IDs:
RES_ID - Resource ID
Resource – RES30_RESOURCEActive Vehicle (Locomotive)Passive Vehicle (Rail Car)
Tracking IDs:
RES_ID - Resource IDUser Profile: RES30_RESOURCE
Parameter: CNTR_ODT30_VEHICLERES_ID
User Profile: ODT30_TUParameter: CNTR_ODT30_ASSIGNED_TU
(C) SAP AG Page 19 of 30
Additional Information
Status Attributes All the values for the status attributes described can be set independent from each other. There is no
logic implemented to automatically update a second status, if a change is received for the first status,
although they might be semantically dependent. For example, an event received to set the
maintenance status to “Not Usable” does not automatically set the “Availability Status” to
“Unserviceable”. This can result in semantically inconsistent status settings across the status
attributes.
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.
Status update: Event Message with internal Event Code “SET_AVAILABILITY”
(C) SAP AG Page 20 of 30
Loading Status
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.
Status update: Event Message with internal Event Code “SET_LOADING”
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.
Status update: Event Message with internal Event Code “SET_MAINTENANCE”
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.
Status update: Resource Master Data update of the Planning block.
(C) SAP AG Page 21 of 30
Expected Events via EVM_EE_UPDATE for Resource Event Handler
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).
The following EEs from the TM Documents are relevant as of now:
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.
Expected Event
LOAD_BEGIN (FU)
LOAD_END (FU)
COUPLING (TU)
DEPARTURE (FO)
ARRIV_DEST (FO)
DECOUPLING (TU)
UNLOAD_BEGIN (FU)
UNLOAD_END (FU)
(C) SAP AG Page 22 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.
(C) SAP AG Page 23 of 30
Multiple Tracking IDs SAP EM 9.0 SP4 introduced a new feature “Multiple Tracking IDs”. Using this functionality within SAP
Event Management it is possible to send a single event message and apply it to multiple event
handlers.
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.
(C) SAP AG Page 24 of 30
Customizing SAP Event Management
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:
Internal event code: "ARRIV_DEST"
Tracking ID code set: "RES_ID"
Event message sender (code set and code ID): "TM"
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.
(C) SAP AG Page 25 of 30
Delete vs. Cancel in SAP TM In SAP TM there is the possibility to define if a TM document can only be cancelled or also if it can be
deleted from the database.
Based on the Document Type Stetting we have the following situation:
TM Document Type Setting TOR_ROOT TOR_ROOT_BEFORE
Can be deleted Not available Available
Cancel Available Available
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.
Therefore it is checked within /SCMTMS/CL_EVENT_MANAGEMENT->CALL_EM_TOR_DATA if only
a ROOT_BEFORE table exists. In this case the method /SCMTMS/CL_EVENT_MANAGEMENT-
>SEND_RES_DATA is also called to trigger possible deletion of the expected events on the resource
event handler via BPT TMS_RES. If needed, the event message RES30_EE_MODIFY is sent then
from the Application Object Type RES30_RESOURCE which is then used to delete the existing EEs
on the Resource EH for the deleted TM document.
(C) SAP AG Page 26 of 30
Event Date Filter
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.
Display Planned Route of a Resource on the EM Geo Map
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.
(C) SAP AG Page 27 of 30
Update TM Documents from the Resource Event Handler
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.
Sample Preprocessing Function:
DATA: lt_requestids TYPE /saptrx/bapi_eh_request_id_tab, ls_requestids TYPE /saptrx/bapi_eh_request_id, lt_bapireturn TYPE STANDARD TABLE OF bapiret2, lt_eh_hdr TYPE /saptrx/bapi_eh_hdr_tab, lt_expectedevents TYPE TABLE OF /saptrx/bapi_eh_expected_event, ls_expectedevents TYPE /saptrx/bapi_eh_expected_event. FIELD-SYMBOLS: <fs_evm_hdr> TYPE /saptrx/evm_hdr_tabtyp, <fs_evm_hdr_line> TYPE /saptrx/evm_hdr_str. ASSIGN es_evm_tables-header TO <fs_evm_hdr>. IF <fs_evm_hdr> IS ASSIGNED. READ TABLE <fs_evm_hdr> ASSIGNING <fs_evm_hdr_line> INDEX 1. ELSE. EXIT. ENDIF. ls_requestids-trxcod = <fs_evm_hdr_line>-trxcod.
(C) SAP AG Page 28 of 30
ls_requestids-trxid = <fs_evm_hdr_line>-trxid. APPEND ls_requestids TO lt_requestids. CALL FUNCTION '/SAPTRX/BAPI_EH_GET_DATA' TABLES requestids = lt_requestids expectedevents = lt_expectedevents bapireturn = lt_bapireturn. IF lt_expectedevents IS NOT INITIAL.
**************************************************************************** * 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)
Add the TM_MAINTAIN_EXEC_INF Activity to your rule set.
Set the parameter “REPLACE_TRXID” to the Metadata Tag e.g. <EVENT_MSG-HDR-DATAID>,
which should be used to get the TM document number (TOR ID).
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.
(C) SAP AG Page 29 of 30
BAdI /SCMTMS/SEND_TOR_DATA
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:
For example implementations see the following implementations:
/SCMTMS/SPLIT_TOR_DATA_BY_TYPE: Send TOR Data Split in Packages per TOR Type
o Method /SCMTMS/IF_COMMON_BADI~SET_BADI_WORK_MODE: Set Work Mode
of BAdI
o Method /SCMTMS/IF_SEND_TOR_DATA~CALL_EVENT_MGR: Fill Application
Table and Event Manager Communication
/SCMTMS/GET_ADDITIONAL_DATA: Get Additional Data
o Method /SCMTMS/IF_COMMON_BADI~SET_BADI_WORK_MODE: Set Work Mode
of BAdI
o Method /SCMTMS/IF_TOR_SEND_DATA~GET_ADDITIONAL_DATA: Retrieve
Additional Data for Event Manager Communication
/SCMTMS/PREVENT_EVMSG_SENDING: Prevent Event Message Sending
o Method /SCMTMS/IF_COMMON_BADI~SET_BADI_WORK_MODE: Set Work Mode
of BAdI
o Method /SCMTMS/IF_SEND_TOR_DATA~PREVENT_EVENT_MSG_SENDING: Set
Indicator to Prevent Event Message Sending
(C) SAP AG Page 30 of 30
AVOID_RETRIEVAL_OF_APPL_TABLES: Avoid unnecessary data retrieval for standard
integration
o Method /SCMTMS/IF_COMMON_BADI~SET_BADI_WORK_MODE: Set Work Mode
of BAdI
o Method /SCMTMS/IF_SEND_TOR_DATA~AVOID_RETRIEVAL_OF_APPL_TABLES:
Set indicators to avoid retrieval of unnecessary data