Changes to SAP TM Extraction Function Modules for SAP

Changes to SAP TM Extraction Function Modules
for SAP EM Expected Events and Control Data
Applies to:
>= SAP TM 9.3
Summary:
With SAP TM 9.3 the TOR business object was enhanced concerning the date and time information based
on the TOR stop because there are situations when the same time-related fields of the TOR stop are used
for the different purposes. For instance, the requested and acceptable times are used as appointment or
PUDL window depending on the used TOR category. However, within the specific TOR category these fields
can be interpreted differently. In case a document acts as capacity and demand, it is not possible to handle
the appointment and PUDL window dates separately.
Due to these changes the extraction function modules in SAP TM for the Event Management integration
have been adjusted accordingly.
This document will provide an overview to customers what has been changed and what customers need to
adjust in their own extraction function modules when upgrading to SAP TM 9.3 to ensure that the extraction
modules will continue to work properly.
Author: Marco Freischlag
Company: SAP SE
Created on: 20 May 2015
1
Table of Contents
Overview of major changes in SAP TM 9.3 ........................................................................................................ 3
TOR Date Times extensions by new fields ..................................................................................................... 3
General Information ..................................................................................................................................................... 3
Enhancement TOR Times............................................................................................................................................ 4
Changes to SAP TM Extraction Function Modules ......................................................................................... 5
Changes to Standard Expected Event Extractors ........................................................................................................ 5
Changes to Standard Control Data Extractors ............................................................................................................. 6
Affected Standard Extractors in SAP TM ..................................................................................................................... 6
Sample Coding: Modification within an expected event extractor ................................................................................ 7
Application Object Type: ODT30_TO ................................................................................................................. 7
Expected event extractor: ODT20_TO ............................................................................................................... 7
Function Module: /SCMTMS/EXTR_EE_TO ...................................................................................................... 7
Appendix ............................................................................................................................................................. 9
Details TOR stop time description .................................................................................................................. 9
Copyright........................................................................................................................................................... 11
2
Overview of major changes in SAP TM 9.3
TOR Date Times extensions by new fields
General Information
1. SAP Help: Details for Dates/Times in Freight Order Management can be found in SAP Help:
http://help.sap.com/tm93  Application Help  SAP Transportation Management (SAP TM)  Freight Order
Management  Additional Business Document Attributes in FOM  Dates/Times in Freight Order
Management
2. SAP Note: 2171821 - Information about refactoring in SAP TM 9.3
3. SAP Note: 2167537 - How to adapt custom extraction function modules when upgrading to TM 9.3
3
Enhancement TOR Times
New fields on TOR Stop Node: Aggregated load, couple dates and appointment dates
The new fields on TOR stop are introduced for aggregated load date

AGGR_ASSGN_START_L - Aggregated Load/Unload Start Date/Time

AGGR_ASSGN_END_L
- Aggregated Load/Unload End Date/Time
The new fields on TOR stop are introduced for aggregated couple date

AGGR_ASSGN_START_C - Aggregated Couple/Uncouple Start Date/Time

AGGR_ASSGN_END_C
- Aggregated Couple/Uncouple End Date/Time
Aggregated load dates:
These fields should be filled as follows:

On the outbound stop, the earliest loading date and the latest loading date will be stored in these
fields.

On the inbound stop, the earliest unloading date and the latest unloading date will be stored in these
fields.
It will be checked if the aggregated loading timeframe lies within the appointment.
Aggregated couple dates:
These fields should be filled as follows:

On the outbound stop, the earliest coupling date and the latest coupling date will be stored in these
fields.

On the inbound stop, the earliest uncoupling date and the latest uncoupling date will be stored in
these fields.
Appointment dates
The new fields on TOR stop are introduced for planned appointment

APPOINTMENT_START - Appointment Start Date/Time

APPOINTMENT_END
- Appointment End Date/Time
4
Changes to SAP TM Extraction Function Modules
Following changes have been applied to the existing standard extraction programs. Customers must change
their custom extraction and adjust the coding accordingly.
Customers have to check their extraction modules where TOR Stop date/time fields are used to ensure that
the semantic of the field will still apply to the intended extraction logic.
Changes to Standard Expected Event Extractors
Expected Event
Stop Source Field SAP TM < 9.3
New Stop Source Field with SAP TM >=
9.3
Arrival
(ARRIV)
FO, BO, TU, FU:
Exp. Evt Date/Time = plan_trans_time
FO, BO, TU, FU:
Exp. Evt Date/Time = plan_trans_time
Coupling
(COUPL)
FO, BO, TU:
Exp. Evt Date/Time = assgn_end
TO, BO:
Exp. Evt Date/Time = aggr_assgn_end_c
Earliest Exp. Evt Date/Time = aggr_assgn_start_c
TU:
Exp. Evt Date/Time = assgn_end
Decoupling (DECOUPL)
FO, BO, TU:
Exp. Evt Date/Time = assgn_end
FO, BO:
Exp. Evt Date/Time = aggr_assgn_end_c
Earliest Exp. Evt Date/Time = acc_start
TU:
Exp. Evt Date/Time = assgn_end
Departure
(DEP)
FO, BO, TU, FU:
Exp. Evt Date/Time = plan_trans_time
FO, BO, TU, FU:
Exp. Evt Date/Time = plan_trans_time
Loading Begin
(LB)
FU:
Exp. Evt Date/Time = assgn_start
FU:
Exp. Evt Date/Time = assgn_start
FO, BO, TU:
Exp. Evt Date/Time = req_start
FO, BO, TU:
Exp. Evt Date/Time = aggr_assgn_start_l
Earliest Exp. Evt Date/Time = appointment_start
Latest Event Expected Date/Time = appointment_end
FU:
Exp. Evt Date/Time = assgn_end
FU:
Exp. Evt Date/Time = assgn_end
FO, BO, TU:
Exp. Evt Date/Time = req_end
FO, BO, TU:
Exp. Evt Date/Time = aggr_assgn_end_l
Earliest Exp. Evt Date/Time = appointment_start
Latest Event Expected Date/Time = appointment_end
Scheduled
(SCHED)
FU:
Exp. Evt Date/Time = req_start
FU:
Exp. Evt Date/Time = req_start
Unloading Begin
(ULB)
FU:
Exp. Evt Date/Time = assgn_start
FU:
Exp. Evt Date/Time = assgn_start
FO, BO, TU:
Exp. Evt Date/Time = req_start
FO, BO, TU:
Exp. Evt Date/Time = aggr_assgn_start_l
Earliest Exp. Evt Date/Time = appointment_start
Latest Event Expected Date/Time = appointment_end
FU:
Exp. Evt Date/Time = assgn_end
FU:
Exp. Evt Date/Time = assgn_end
FO, BO, TU:
Exp. Evt Date/Time = req_end
FO, BO, TU:
Exp. Evt Date/Time = aggr_assgn_end_l
Earliest Exp. Evt Date/Time = appointment_start
Latest Event Expected Date/Time = appointment_end
Loading End
(LE)
Unloading End
(ULE)
Table 3: New TOR date time fields for Expected Event Extractor.
5
Changes to Standard Control Data Extractors
Parameter Name
Source Field
New Source Field
FU_PLANNED_ARRIVAL plan_trans_time / sel_time
plan_trans_time
REQ_PICKUP_DATE
sel_time
appointment_start
REQ_DELIV_DATE
sel_time
appointment_end
Table 4: New TOR date time fields for Control Data Extractor.
Affected Standard Extractors in SAP TM
AO Type
Control Data
Extractor
Function Module
Expected Event
Extractor
Function Module
ODT20_TO
ODT20_TOR
/SCMTMS/EXTR_CPARAMS_TOR
ODT20_TO
/SCMTMS/EXTR_EE_TO
ODT30_TO
ODT20_TOR
/SCMTMS/EXTR_CPARAMS_TOR
ODT20_TO
/SCMTMS/EXTR_EE_TO
ODT20_FU
ODT20_TOR
/SCMTMS/EXTR_CPARAMS_TOR
ODT20_FU
/SCMTMS/EXTR_EE_FU
ODT30_FU
ODT20_TOR
/SCMTMS/EXTR_CPARAMS_TOR
ODT20_FU
/SCMTMS/EXTR_EE_FU
ODT30_TU
ODT20_TOR
/SCMTMS/EXTR_CPARAMS_TOR
ODT30_TU
/SCMTMS/EXTR_EE_TU
ODT40_TO
ODT40_TOR
/SCMTMS/EXTR_CPARAMS_TOR40
ODT40_TO
/SCMTMS/EXTR_EE_TO40
Table 5: Affected Expected Event Data Extractors.
Event Type
Evt Data Extractor
Function Module
RES30_EE_MODIFY
RES30_EE_MODIFY
/SCMTMS/EXTR_EVT_RES_EE_MODIFY
Table 6: Affected Event Extractor.
Note: The RES30_EE_MODIFY event type is used within the resource tracking scenario to generate the
expected events.
6
Sample Coding: Modification within an expected event extractor
Application Object Type: ODT30_TO
Expected event extractor: ODT20_TO
Function Module: /SCMTMS/EXTR_EE_TO
In this sample you can see when using e.g. the new fields AGGR_ASSGN_START_L and
AGGR_ASSGN_END_L how you can reduce the complexity in the coding.
The time window defines when the earliest and the latest loading
AGGR_ASSGN_START_L
AGGR_ASSGN_END_L
activity at the stop is to take place. These dates are calculated by
the system using the loading dates/times of the assigned
requirements ( e.g. freight units)
SAP TM >= 9.3
Milestone 'LOAD_BEGIN'
*
Check for loading activity at this stop
IF ls_load_unload_stop-aggr_assgn_start_l IS NOT INITIAL AND
ls_load_unload_stop-aggr_assgn_end_l IS NOT INITIAL.
…
ls_expeventdata-evt_exp_datetime = ls_load_unload_stop-aggr_assgn_start_l.
7
SAP TM < 9.3
Milestone 'LOAD_BEGIN'
*
*
n
*
Check for loading activity at this stop
first check for transitive loading activities for freight units assigned on assigned transportatio
units
and determine earliest ASSGN_START (Loading Begin) and latest ASSGN_END (Loading End)
LOOP AT lt_req_tu_stop REFERENCE INTO lr_req_tu_stop USING KEY assgn_stop_key WHERE assgn_stop_key =
lv_node_id.
lv_node_id2 = lr_req_tu_stop->node_id.
LOOP AT lt_req_stop REFERENCE INTO lr_req_stop USING KEY assgn_stop_key WHERE assgn_stop_key =
lv_node_id2.
lv_pred_stop = lr_req_stop->seq_num - 1.
READ TABLE lt_req_stop REFERENCE INTO lr_neighbor_stop WITH KEY parent_autoplan COMPONENTS
parent_node_id = lr_req_stop->parent_node_id
seq_num = lv_pred_stop.
IF sy-subrc IS NOT INITIAL OR
lr_neighbor_stop->assgn_item_key <> lr_req_stop->assgn_item_key.
IF lr_req_stop->assgn_start < lv_begin OR lv_begin IS INITIAL.
lv_begin = lr_req_stop->assgn_start.
ENDIF.
IF lr_req_stop->assgn_end > lv_end OR lv_end IS INITIAL.
lv_end = lr_req_stop->assgn_end.
ENDIF.
ENDIF.
ENDLOOP.
ENDLOOP.
* then check for direct loading activities for assigned freight units
* and determine earliest ASSGN_START (Loading Begin) and latest ASSGN_END (Loading End)
LOOP AT lt_req_stop REFERENCE INTO lr_req_stop USING KEY assgn_stop_key WHERE assgn_stop_key = lv_no
de_id.
lv_pred_stop = lr_req_stop->seq_num - 1.
READ TABLE lt_req_stop REFERENCE INTO lr_neighbor_stop WITH KEY parent_autoplan COMPONENTS parent
_node_id = lr_req_stop->parent_node_id
seq_num = lv_pred_stop.
IF sy-subrc IS NOT INITIAL OR
lr_neighbor_stop->assgn_item_key <> lr_req_stop->assgn_item_key.
IF lr_req_stop->assgn_start < lv_begin OR lv_begin IS INITIAL.
lv_begin = lr_req_stop->assgn_start.
ENDIF.
IF lr_req_stop->assgn_end > lv_end OR lv_end IS INITIAL.
lv_end = lr_req_stop->assgn_end.
ENDIF.
ENDIF.
ENDLOOP.
…
ls_expeventdata-evt_exp_datetime = lv_begin.
8
Appendix
Details TOR stop time description
For more and the latest information please refer to SAP Note 2171821 - Information about refactoring in SAP
TM 9.3.
Time
Fieldname
Acceptable Time Window for the activity at the stop.
Acceptable
From-To
ACC_START
ACC_END
The time window defines the dates/times for pickup or
delivery at the stop. (aka PUDL Window)
Requested Time Window for the activity at the stop.
Request
From-To
Description
REQ_START
REQ_END
The time window defines the dates/times for pickup or
delivery at the stop. (aka PUDL Window)
Appointment
APPOINTMENT_START
Appointment is the time window that you use to define
From-To
APPOINTMENT_END
when the delivery or pick-up at the customer is to take
place. You can define your own appointment in the
freight order, for example.
Planned
Transportation
PLAN_TRANS_TIME
Planned transportation time you use to define the
planned departure date (outbound stop) or planned
arrival date (inbound stop). Example, in freight order
these are Departure Date for Source Location and
Arrival Date for Destination Location.
Assigned
ASSGN_START
The time window defines when the loading activity or
From-To
ASSGN_END
coupling activity is to take place. For example, in
freight unit the dates define the Loading/Unloading
dates/times and in trailer unit Coupling/ Uncoupling
dates/times.
Aggregated
AGGR_ASSGN_START_L
AGGR_ASSGN_END_L
The time window defines when the earliest and the
Load
latest loading activity at the stop is to take place.
From-To
These dates are calculated by the system using the
loading dates/times of the assigned requirements (
e.g. freight units)
Aggregated
Couple
From-To
AGGR_ASSGN_START_C
AGGR_ASSGN_END_C
The time window defines when the earliest and the
latest coupling activity at capacity stop is to take
place.
These dates are calculated by the system
using the coupling dates/times of the assigned
requirements (e.g. trailer unit).
9
Cut Off Date
CUTOFF_CARGO
CUTOFF_DOC
The Cut-off dates/times (such as cargo cut-off
date/time) and the availability dates/times.
CUTOFF_CUST_DOC
CUTOFF_DG_DOC
TRQ Times
TRQ_ACC_START
PUDL Window Information that is copied from TRQ.
TRQ_REQ_START
The dates are used by the system to determine PUDL
TRQ_REQ_END
Window for freight unit, for example.
TRQ_ACC_END
Confirmed by
Carrier
CARR_CONF_START
The appointment that is defined by carrier. In road
CARR_CONF_END
freight order UI, these are Dates Confirmed by
From-To
Selection Time
Carrier.
SEL_TIME
The date/time is used for selection.
10
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.
11