SAP Track and Trace - Interface Guide

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 73

SAP Business Network Global Track and Trace

Interface Reference Guide

PUBLIC

DEVELOPMENT

Document Version: LBN 2.0 – 22 November 2022


TABLE OF CONTENTS
INTRODUCTION .................................................................................................................................4
About the Core Engine ......................................................................................................................4
APIs and Interfaces ........................................................................................................................... 5
Core Model ......................................................................................................................................... 5
About this Document ........................................................................................................................ 6
1. GTT_V2_EM_IDOC_INGESTION (TRACKED PROCESS/EVENT) ..............................................7
Description ......................................................................................................................................... 7
a) Receive a Tracked Process EM IDOC ........................................................................................ 8
Request ................................................................................................................................................8
Response ........................................................................................................................................... 10
b) Receive an Event EM IDOC ........................................................................................................12
Request ..............................................................................................................................................12
Response ........................................................................................................................................... 21
c) Receive a Combined EM IDOC .................................................................................................. 22
Request ..............................................................................................................................................22
Response ........................................................................................................................................... 25
2. GTT_V2_HTTP_EVENT_INGESTION (TRACKED PROCESS/EVENT) ..................................... 26
Description ....................................................................................................................................... 26
a) Create and Update Tracked Process ........................................................................................27
Request ..............................................................................................................................................27
Response ........................................................................................................................................... 39
b) Post events ...................................................................................................................................40
Request ..............................................................................................................................................40
Response ........................................................................................................................................... 44
3. GTT_V2_ODATA_QUERY (TRACKED PROCESS/EVENT) ....................................................... 45
Description ....................................................................................................................................... 45
a) General ..........................................................................................................................................45
b) Sample Model .............................................................................................................................. 46
c) Read Metadata .............................................................................................................................46
d) Read Tracked Process List ........................................................................................................ 46
e) Read Single Tracked Process Instance ....................................................................................47
f) Read Single Tracked Process Instance with Planned Events ................................................ 47
g) Read Planned Events of Single Tracked Process Instance ................................................... 47

2
h) Read Tracked Process Instances by Other Operators (count, top, skip, orderby, filter,
inlinecount, format) ......................................................................................................................... 48
i) Instance-based Authorization .....................................................................................................49
j) Current Supported OData Syntax and API Samples ................................................................ 51
k) Notes .............................................................................................................................................52
4. GTT_V2_ODATA_LOCATION (LOCATION) ................................................................................ 53
Description ....................................................................................................................................... 53
a) Create Locations ......................................................................................................................... 53
Request ..............................................................................................................................................53
Response ........................................................................................................................................... 54
b) Read Locations ............................................................................................................................54
Request ..............................................................................................................................................54
Response ........................................................................................................................................... 54
5. GTT_V2_HTTP_METADATA ........................................................................................................ 55
Description ....................................................................................................................................... 55
a) Get Annotation File Content .......................................................................................................55
Request ..............................................................................................................................................55
Response ........................................................................................................................................... 55
b) Get i18n File Content .................................................................................................................. 56
Request ..............................................................................................................................................56
Response ........................................................................................................................................... 56
c) Get Admissible Event Types ...................................................................................................... 57
Request ..............................................................................................................................................57
Response ........................................................................................................................................... 57
d) Get Elements of an Event with Core Model Fields ..................................................................59
Request ..............................................................................................................................................59
Response ........................................................................................................................................... 59
e) Get All Process Types .................................................................................................................65
Request ..............................................................................................................................................65
Response ........................................................................................................................................... 65
f) Notes ..............................................................................................................................................65
APPENDIX: IDOC PREDEFINED PARAMETERS FOR VERSION 2 ............................................. 66

3
INTRODUCTION

About the Core Engine


The core engine is a central part of SAP Business Network Global Track and Trace. It provides
functionality for process tracking and event handling that is common to all tracking applications
independent of their original business domain.

In particular, the core engine provides the following:


 A common definition of tracked processes and events that are enhanced with business
domain specifics by each application
 A common ingestion pipeline for initial creation and updates of tracked process instances
 A common ingestion pipeline for processing actual events and identifying affected tracked
process instances
 A common service to query tracked processes and related events

The ingestion pipelines for tracked process instances and actual events are realized as RESTful
services that can be called for example from SAP Cloud Integration. The service to query tracked
process instances and events related to these instances is realized with the OData protocol for
RESTful services. Figure 1 shows the integration of the core engine with application specific
services and UIs and existing ERP systems leveraging SAP Cloud Integration.

Figure 1: Core Engine Integration with Application Specific Services, UIs and SAP ERP.

4
APIs and Interfaces
There are two basic types of API:

a) Public cross-tenant APIs


These are published by SAP in the SAP API Business Hub with documentation.

b) Generated tenant-local interfaces


These are also APIs but to easily distinguish them for SAP Business Network Global Track
and Trace, we call them interfaces. They are documented in this guide.

Core Model
You can define models based on the core model. After model deployment, read and write
interfaces can be generated. Core entities are shared by every model. Their relationships are
shown as below:

5
About this Document
This document describes the interfaces provided with the Version 2 of SAP Business Network
Global Track and Trace that are useable by applications. They are designated by GTT_V2 in their
technical name.

Recommendation
Before you start working through this document, ensure that you have the most recent version
of this document available from the SAP Help Portal at:
help.sap.com/gtt

Target Audience
Table 1: Target Audience
Role Activity

SAP ERP Consultant Configure GTT interfaces to send business documents and events as
IDOC to SAP Cloud Integration

System Administrator Establish a secure network connection between SAP ERP, SAP
Cloud Integration and SAP Business Network Global Track and Trace

SAP Cloud Integration Consultant Perform configuration activities in the SAP Cloud Integration to map
IDOC data from ERP to ingestion pipeline interfaces

Application Developer Develop domain specific user interfaces consuming the common
OData service from the core engine to retrieve tracked processes
and related events

6
1. GTT_V2_EM_IDOC_INGESTION (TRACKED PROCESS/EVENT)

Description
 technical name: GTT_V2_EM_IDOC_Ingestion
 purpose: for ingesting EM IDOC
 protocol: HTTP
 users: technical
 same service used separately to:
a) Receive a Tracked Process EM IDOC
b) Receive an Event EM IDOC
c) Receive a Combined EM IDOC

For the IDOC predefined parameters for Version 2, see the APPENDIX.

7
a) Receive a Tracked Process EM IDOC

Request

Request URI:
https://<server address>[:port]/api/idoc/em/v1/TrackedProcess
Request Method: POST

Request Body: EM IDOC in XML format

Request Body Example:

<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header>
<msgID:messageId
xmlns:msgID="http://www.sap.com/webas/640/soap/features/messageId/">uuid:0894ef45-9101-
1eda-a1a9-18cdc670a12c</msgID:messageId>
</soap-env:Header>
<soap-env:Body>
<EHPOST01 xmlns="urn:sap-com:document:sap:idoc:soap:messages">
<IDOC BEGIN="1">
<EDI_DC40 SEGMENT="1">
<TABNAM>EDI_DC40</TABNAM>
<MANDT>910</MANDT>
<DOCNUM>0000000002363293</DOCNUM>
<DOCREL>755</DOCREL>
<STATUS>30</STATUS>
<DIRECT>1</DIRECT>
<OUTMOD>2</OUTMOD>
<IDOCTYP>EHPOST01</IDOCTYP>
<MESTYP>AOPOST</MESTYP>
<SNDPOR>SAPQM7</SNDPOR>
<SNDPRT>LS</SNDPRT>
<SNDPRN>QM7CLNT910</SNDPRN>
<RCVPOR>GTTV2ACCTP</RCVPOR>
<RCVPRT>LS</RCVPRT>
<RCVPRN>GTTV2ACC</RCVPRN>
<CREDAT>20200423</CREDAT>
<CRETIM>115700</CRETIM>
<ARCKEY>urn:sap.com:msgid=0894EF4591011EDAA1A918CDC670A12C</ARCKEY>
<SERIAL>20200423115700</SERIAL>
</EDI_DC40>
<E1EHPAO SEGMENT="1">
<APPSYS>QM7CLNT910</APPSYS>
<APPOBJTYPE>YSHIPMENT_ACC</APPOBJTYPE>
<APPOBJID>0000008888</APPOBJID>
<E1EHPCP SEGMENT="1">
<PARAMNAME>FORWARDING_AGENT_NAME</PARAMNAME>
<PARAMINDEX>0000000000</PARAMINDEX>
<VALUE>VENDOR</VALUE>
</E1EHPCP>
<E1EHPCP SEGMENT="1">
<PARAMNAME>PARTITION_KEY_HINT</PARAMNAME>

8
<PARAMINDEX>0000000000</PARAMINDEX>
<VALUE>00001</VALUE>
</E1EHPCP>
<E1EHPCP SEGMENT="1">
<PARAMNAME>YN_SHP_HDR_DLV_NO</PARAMNAME>
<PARAMINDEX>0000000001</PARAMINDEX>
<VALUE>0080045176</VALUE>
</E1EHPCP>
<E1EHPCP SEGMENT="1">
<PARAMNAME>YN_SHP_HDR_DLV_NO_LOGSYS</PARAMNAME>
<PARAMINDEX>0000000001</PARAMINDEX>
<VALUE>QM7CLNT911</VALUE>
</E1EHPCP>
<E1EHPCP SEGMENT="1">
<PARAMNAME>PLANNED_TECHNICAL_TIMESTAMP</PARAMNAME>
<PARAMINDEX>0000000000</PARAMINDEX>
<VALUE>020201022000000</VALUE>
</E1EHPCP>
<E1EHPCP SEGMENT="1">
<PARAMNAME>PLANNED_TECHNICAL_TIMEZONE</PARAMNAME>
<PARAMINDEX>0000000000</PARAMINDEX>
<VALUE>CET</VALUE>
</E1EHPCP>
<E1EHPCP SEGMENT="1">
<PARAMNAME>REPORTED_BY</PARAMNAME>
<PARAMINDEX>0000000000</PARAMINDEX>
<VALUE>USER_NAME</VALUE>
</E1EHPCP>
<E1EHPCP SEGMENT="1">
<PARAMNAME>E1EHPTID_TRXCOD</PARAMNAME>
<PARAMINDEX>0000000010</PARAMINDEX>
<VALUE>SHP_NO</VALUE>
<PARAMNAME>E1EHPTID_TRXID</PARAMNAME>
<PARAMINDEX>0000000010</PARAMINDEX>
<VALUE>0000008888</VALUE>
<PARAMNAME>E1EHPTID_APPSYS</PARAMNAME>
<PARAMINDEX>0000000010</PARAMINDEX>
<VALUE>QM7CLNT912</VALUE>
<PARAMNAME>E1EHPTID_START_DATE</PARAMNAME>
<PARAMINDEX>0000000010</PARAMINDEX>
<VALUE>020200423115700</VALUE>
<PARAMNAME>E1EHPTID_END_DATE</PARAMNAME>
<PARAMINDEX>0000000010</PARAMINDEX>
<VALUE>020200423115700</VALUE>
<PARAMNAME>E1EHPTID_ACTION</PARAMNAME>
<PARAMINDEX>0000000010</PARAMINDEX>
<VALUE>A</VALUE>
<PARAMNAME>E1EHPTID_TIMZON</PARAMNAME>
<PARAMINDEX>0000000010</PARAMINDEX>
<VALUE>CET</VALUE>
</E1EHPCP>
<E1EHPEE SEGMENT="1">
<MILESTONENUM>0000000001</MILESTONENUM>

9
<MILESTONE>ARRIV_CARR</MILESTONE>
<CARRID>B01_FWAGNT</CARRID>
<LOCTYPE>SP</LOCTYPE>
<LOCID1>TM84</LOCID1>
<SNDID>B01_FWAGNT</SNDID>
<MSG_EXP_DATETIME>000000000000000</MSG_EXP_DATETIME>
<MSG_ER_EXP_DTIME>000000000000000</MSG_ER_EXP_DTIME>
<MSG_LT_EXP_DTIME>000000000000000</MSG_LT_EXP_DTIME>
<EVT_EXP_DATETIME>000000000000000</EVT_EXP_DATETIME>
<EVT_ER_EXP_DTIME>000000000000000</EVT_ER_EXP_DTIME>
<EVT_LT_EXP_DTIME>000000000000000</EVT_LT_EXP_DTIME>
<EVT_EXP_TZONE>CET</EVT_EXP_TZONE>
<ITEMIDENT>29JlHP417jgXgHZDnd01B0</ITEMIDENT>
</E1EHPEE>
<E1EHPTID SEGMENT="1">
<TRXCOD>SHP_NO</TRXCOD>
<TRXID>0000008888</TRXID>
<APPSYS>QM7CLNT912</APPSYS>
<START_DATE>020200423115700</START_DATE>
<END_DATE>020200423115700</END_DATE>
<ACTION>A</ACTION>
<TIMZON>CET</TIMZON>
</E1EHPTID>
</E1EHPAO>
</IDOC>
</EHPOST01>
</soap-env:Body>
</soap-env:Envelope>

Notes
You can use association field name plus _LOGSYS to send a custom source system value for
association field, i.e YN_SHP_HDR_DLV_NO_LOGSYS.
You can use APPSYS to send a custom source system value for reference.

Response
Response Codes
The following HTTP response codes may occur:
Code HTTP Description Track and Trace Semantic
200 OK EM IDoc is received successfully
400 Bad Request Something is not correct in the payload
401 Unauthorized There is no authentication passed with the request
403 Forbidden The user does not have the right privileges
404 Not found Request URI is not correct
500 Internal Server Error An unspecified error occurred during request processing

Response Body
Message in XML format.

Response Body Example:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>

10
<SOAP-ENV:Body>
<EHPOST01Response xmlns="urn:sap-com:document:sap:idoc:soap:messages">
<IdocAssign>
<TransferId xmlns="urn:sap-
com:document:sap:idoc:soap:messages">0000000002705455</TransferId>
<DbId xmlns="urn:sap-
com:document:sap:idoc:soap:messages">0000000002705455</DbId>
</IdocAssign>
</EHPOST01Response>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

11
b) Receive an Event EM IDOC

Request

Request URI:
https://<server address>[:port]/api/idoc/em/v1/Event

Request Method: POST

Request Body: EM IDOC in XML format

Request Body Example:

<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header>
<msgID:messageId
xmlns:msgID="http://www.sap.com/webas/640/soap/features/messageId/">uuid:0894ef45-9101-
1eda-a2a5-8aa1af6843f4</msgID:messageId>
</soap-env:Header>
<soap-env:Body>
<EVMSTA02 xmlns="urn:sap-com:document:sap:idoc:soap:messages">
<IDOC BEGIN="1">
<EDI_DC40 SEGMENT="1">
<TABNAM>EDI_DC40</TABNAM>
<MANDT>910</MANDT>
<DOCNUM>0000000002368243</DOCNUM>
<DOCREL>755</DOCREL>
<STATUS>30</STATUS>
<DIRECT>1</DIRECT>
<OUTMOD>2</OUTMOD>
<IDOCTYP>EVMSTA02</IDOCTYP>
<MESTYP>EVMSTA</MESTYP>
<SNDPOR>SAPQM7</SNDPOR>
<SNDPRT>LS</SNDPRT>
<SNDPRN>QM7CLNT910</SNDPRN>
<RCVPOR>GTTV2ACCEV</RCVPOR>
<RCVPRT>LS</RCVPRT>
<RCVPRN>GTTV2ACC</RCVPRN>
<CREDAT>20200428</CREDAT>
<CRETIM>104329</CRETIM>
<ARCKEY>urn:sap.com:msgid=0894EF4591011EDAA2A58AA1AF6843F4</ARCKEY>
<SERIAL>20200428104329</SERIAL>
</EDI_DC40>
<E1EVMHDR02 SEGMENT="1">
<EVTID>ARRIV_CARR</EVTID>
<EVTDAT>20200428</EVTDAT>
<EVTTIM>104300</EVTTIM>
<EVTZON>CET</EVTZON>
<E1EVMTID SEGMENT="1">
<TRXCOD>SHP_NO</TRXCOD>
<TRXID>0000001452</TRXID>
</E1EVMTID>
<E1EVMLID SEGMENT="1">

12
<LOCCOD>SP</LOCCOD>
<LOCID1>TM84</LOCID1>
</E1EVMLID>
<E1EVMLID SEGMENT="1">
<LOCCOD>SP</LOCCOD>
<LOCID1>TM84</LOCID1>
</E1EVMLID>
<E1EVMREF02>
<APPSYS>QM7CLNT910</APPSYS>
<APPOBJTYPE>YSHIPMENT_ACC</APPOBJTYPE>
<APPOBJID>0000008888</APPOBJID>
<STARTDATE>20200723</STARTDATE>
<STARTTIME>180000</STARTTIME>
<ENDDATE>20200724</ENDDATE>
<ENDTIME>180000</ENDTIME>
</E1EVMREF02>
<E1EVMPAR SEGMENT="1">
<PARAM_NAME>ACTUAL_TECHNICAL_DATETIME</PARAM_NAME>
<PARAM_VALUE>020201026000000</PARAM_VALUE>
</E1EVMPAR>
<E1EVMPAR SEGMENT="1">
<PARAM_NAME>PARTITION_KEY_HINT</PARAM_NAME>
<PARAM_VALUE>0080001326</PARAM_VALUE>
</E1EVMPAR>
<E1EVMPAR SEGMENT="1">
<PARAM_NAME>ACTUAL_TECHNICAL_TIMEZONE</PARAM_NAME>
<PARAM_VALUE>CET</PARAM_VALUE>
</E1EVMPAR>
<E1EVMPAR SEGMENT="1">
<PARAM_NAME>REPORTED_BY</PARAM_NAME>
<PARAM_INDEX>0000000000</PARAM_INDEX>
<PARAM_VALUE>USER_NAME</PARAM_VALUE>
</E1EVMPAR>
</E1EVMHDR02>
</IDOC>
</EVMSTA02>
</soap-env:Body>
</soap-env:Envelope>

13
Notes
You can use the following GTT standard events: GTTUpdatePlanEvent, GTTDelayedEvent,
GTTOnTimeEvent, and GTTDeletionEvent.

1. To reset, add, or delete a planned event, you can use GTTUpdatePlanEvent.

Request Body Example:


<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header>
<msgID:messageId
xmlns:msgID="http://www.sap.com/webas/640/soap/features/messageId/">uuid:0894ef45-9101-
1eda-a2a5-8aa1af6843f4</msgID:messageId>
</soap-env:Header>
<soap-env:Body>
<EVMSTA02 xmlns="urn:sap-com:document:sap:idoc:soap:messages">
<IDOC BEGIN="1">
<EDI_DC40 SEGMENT="1">
<TABNAM>EDI_DC40</TABNAM>
<MANDT>910</MANDT>
<DOCNUM>0000000002368243</DOCNUM>
<DOCREL>755</DOCREL>
<STATUS>30</STATUS>
<DIRECT>1</DIRECT>
<OUTMOD>2</OUTMOD>
<IDOCTYP>EVMSTA02</IDOCTYP>
<MESTYP>EVMSTA</MESTYP>
<SNDPOR>SAPQM7</SNDPOR>
<SNDPRT>LS</SNDPRT>
<SNDPRN>QM7CLNT910</SNDPRN>
<RCVPOR>GTTV2ACCEV</RCVPOR>
<RCVPRT>LS</RCVPRT>
<RCVPRN>GTTV2ACC</RCVPRN>
<CREDAT>20200428</CREDAT>
<CRETIM>104329</CRETIM>
<ARCKEY>urn:sap.com:msgid=0894EF4591011EDAA2A58AA1AF6843F4</ARCKEY>
<SERIAL>20200428104329</SERIAL>
</EDI_DC40>
<E1EVMHDR02 SEGMENT="1">
<EVTID>GTTUPDATEPLANEVENT</EVTID>
<EVTDAT>20201026</EVTDAT>
<EVTTIM>041126</EVTTIM>
<EVTZON>CET</EVTZON>
<E1EVMTID SEGMENT="1">
<TRXCOD>SHP_NO</TRXCOD>
<TRXID>0000001452</TRXID>
</E1EVMTID>
<E1EVMPAR SEGMENT="1">
<PARAM_NAME>PLANNED_EVENT_CODE</PARAM_NAME>
<PARAM_VALUE>ARRIV_CARR</PARAM_VALUE>

14
</E1EVMPAR>
<E1EVMPAR SEGMENT="1">
<PARAM_NAME>PLANNED_TECHNICAL_TIMESTAMP</PARAM_NAME>

<PARAM_VALUE>020201022130127</PARAM_VALUE>
</E1EVMPAR>
<E1EVMPAR SEGMENT="1">
<PARAM_NAME>PLANNED_BUSINESS_TIMESTAMP</PARAM_NAME>

<PARAM_VALUE>020201022000000</PARAM_VALUE>
</E1EVMPAR>
<E1EVMPAR SEGMENT="1">
<PARAM_NAME>PLANNED_BUSINESS_TIMEZONE</PARAM_NAME>
<PARAM_VALUE>CET</PARAM_VALUE>
</E1EVMPAR>
<E1EVMPAR SEGMENT="1">
<PARAM_NAME>ACTION_CODE</PARAM_NAME>
<PARAM_VALUE>RESET</PARAM_VALUE>
</E1EVMPAR>
</E1EVMHDR02>
</IDOC>
</EVMSTA02>
</soap-env:Body>
</soap-env:Envelope>

15
2. To post a delayed event, you can use GTTDelayedEvent or a user-defined event that inherits
GTTDelayedEvent.

Request Body Example:


<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body>
<EVMSTA02 xmlns="urn:sap-com:document:sap:idoc:soap:messages">
<IDOC BEGIN="1">
<EDI_DC40 SEGMENT="1">
<TABNAM>EDI_DC40</TABNAM>
<MANDT>100</MANDT>
<DOCNUM>9900000005399116</DOCNUM>
<DOCREL>756</DOCREL>
<STATUS>30</STATUS>
<DIRECT>1</DIRECT>
<OUTMOD>2</OUTMOD>
<IDOCTYP>EVMSTA02</IDOCTYP>
<MESTYP>EVMSTA</MESTYP>
<SNDPOR>SAPERP</SNDPOR>
<SNDPRT>LS</SNDPRT>
<SNDPRN>ERPCLNT100</SNDPRN>
<RCVPOR>ZGTTSINTTP</RCVPOR>
<RCVPRT>LS</RCVPRT>
<RCVPRN>ZLSGTTINT</RCVPRN>
<CREDAT>20210315</CREDAT>
<CRETIM>110000</CRETIM>

<ARCKEY>urn:sap.com:msgid=60159A6B3A4749799BCF6333BC296307</ARCKEY>
<SERIAL>20211125034043</SERIAL>
</EDI_DC40>
<E1EVMHDR02 SEGMENT="1">
<EVTID>GTT_DELAYED_EVENT</EVTID>
<EVTDAT>20210315</EVTDAT>
<EVTTIM>110000</EVTTIM>
<EVTZON>CET</EVTZON>
<E1EVMTID SEGMENT="1">
<TRXCOD>SHIPMENT</TRXCOD>
<TRXID>0000003997</TRXID>
</E1EVMTID>
<SRCTX>Event Reason</SRCTX>
<E1EVMPAR SEGMENT="1">
<PARAM_NAME>ACTUAL_TECHNICAL_DATETIME</PARAM_NAME>
<PARAMINDEX>0000000000</PARAMINDEX>
<PARAM_VALUE>020210315110000</PARAM_VALUE>
</E1EVMPAR>
<E1EVMPAR SEGMENT="1">
<PARAM_NAME>ACTUAL_TECHNICAL_TIMEZONE</PARAM_NAME>
<PARAMINDEX>0000000000</PARAMINDEX>
<PARAM_VALUE>CET</PARAM_VALUE>
</E1EVMPAR>
<E1EVMPAR SEGMENT="1">
<PARAM_NAME>REF_PLANNED_EVENT_MILESTONE</PARAM_NAME>
<PARAMINDEX>0000000000</PARAMINDEX>
<PARAM_VALUE>SHP_ARRIVAL</PARAM_VALUE>

16
</E1EVMPAR>
<E1EVMPAR SEGMENT="1">
<PARAM_NAME>REF_PLANNED_LOCID1</PARAM_NAME>
<PARAMINDEX>0000000000</PARAMINDEX>
<PARAM_VALUE>DE_HARBOR</PARAM_VALUE>
</E1EVMPAR>
<E1EVMPAR SEGMENT="1">
<PARAM_NAME>REF_PLANNED_EVENT_LOCTYPE</PARAM_NAME>
<PARAMINDEX>0000000000</PARAMINDEX>
<PARAM_VALUE>LogisticLocation</PARAM_VALUE>
</E1EVMPAR>
<E1EVMPAR SEGMENT="1">
<PARAM_NAME>REF_PLANNED_EVENT_LOCID2</PARAM_NAME>
<PARAMINDEX>0000000000</PARAMINDEX>
<PARAM_VALUE>EventMatchKey</PARAM_VALUE>
</E1EVMPAR>
</E1EVMHDR02>
</IDOC>
</EVMSTA02>
</soap-env:Body>
</soap-env:Envelope>

17
3. To post an on-time event, you can use GTTOnTimeEvent or a user-defined event that
inherits GTTOnTimeEvent.

Request Body Example:


<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body>
<EVMSTA02 xmlns="urn:sap-com:document:sap:idoc:soap:messages">
<IDOC BEGIN="1">
<EDI_DC40 SEGMENT="1">
<TABNAM>EDI_DC40</TABNAM>
<MANDT>100</MANDT>
<DOCNUM>9900000005399116</DOCNUM>
<DOCREL>756</DOCREL>
<STATUS>30</STATUS>
<DIRECT>1</DIRECT>
<OUTMOD>2</OUTMOD>
<IDOCTYP>EVMSTA02</IDOCTYP>
<MESTYP>EVMSTA</MESTYP>
<SNDPOR>SAPERP</SNDPOR>
<SNDPRT>LS</SNDPRT>
<SNDPRN>ERPCLNT100</SNDPRN>
<RCVPOR>ZGTTSINTTP</RCVPOR>
<RCVPRT>LS</RCVPRT>
<RCVPRN>ZLSGTTINT</RCVPRN>
<CREDAT>20210315</CREDAT>
<CRETIM>110000</CRETIM>

<ARCKEY>urn:sap.com:msgid=60159A6B3A4749799BCF6333BC296307</ARCKEY>
<SERIAL>20211125034043</SERIAL>
</EDI_DC40>
<E1EVMHDR02 SEGMENT="1">
<EVTID>GTT_ONTIME_EVENT</EVTID>
<EVTDAT>20210315</EVTDAT>
<EVTTIM>110000</EVTTIM>
<EVTZON>CET</EVTZON>
<E1EVMTID SEGMENT="1">
<TRXCOD>SHIPMENT</TRXCOD>
<TRXID>0000003997</TRXID>
</E1EVMTID>
<SRCTX>Event Reason</SRCTX>
<E1EVMPAR SEGMENT="1">
<PARAM_NAME>ACTUAL_TECHNICAL_DATETIME</PARAM_NAME>
<PARAMINDEX>0000000000</PARAMINDEX>
<PARAM_VALUE>020210315110000</PARAM_VALUE>
</E1EVMPAR>
<E1EVMPAR SEGMENT="1">
<PARAM_NAME>ACTUAL_TECHNICAL_TIMEZONE</PARAM_NAME>
<PARAMINDEX>0000000000</PARAMINDEX>
<PARAM_VALUE>CET</PARAM_VALUE>
</E1EVMPAR>
<E1EVMPAR SEGMENT="1">
<PARAM_NAME>REF_PLANNED_EVENT_MILESTONE</PARAM_NAME>
<PARAMINDEX>0000000000</PARAMINDEX>
<PARAM_VALUE>SHP_ARRIVAL</PARAM_VALUE>

18
</E1EVMPAR>
<E1EVMPAR SEGMENT="1">
<PARAM_NAME>REF_PLANNED_LOCID1</PARAM_NAME>
<PARAMINDEX>0000000000</PARAMINDEX>
<PARAM_VALUE>DE_HARBOR</PARAM_VALUE>
</E1EVMPAR>
<E1EVMPAR SEGMENT="1">
<PARAM_NAME>REF_PLANNED_EVENT_LOCTYPE</PARAM_NAME>
<PARAMINDEX>0000000000</PARAMINDEX>
<PARAM_VALUE>LogisticLocation</PARAM_VALUE>
</E1EVMPAR>
<E1EVMPAR SEGMENT="1">
<PARAM_NAME>REF_PLANNED_EVENT_LOCID2</PARAM_NAME>
<PARAMINDEX>0000000000</PARAMINDEX>
<PARAM_VALUE>EventMatchKey</PARAM_VALUE>
</E1EVMPAR>
</E1EVMHDR02>
</IDOC>
</EVMSTA02>
</soap-env:Body>
</soap-env:Envelope>

19
4. To delete a tracked process, you can use GTTDeletionEvent.

Request Body Example:


<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Body>
<GTTMSG01 xmlns="urn:sap-com:document:sap:idoc:soap:messages">
<IDOC BEGIN="1">
<EDI_DC40 SEGMENT="1">
<TABNAM>EDI_DC40</TABNAM>
<MANDT>910</MANDT>
<DOCNUM>9900000005399116</DOCNUM>
<DOCREL>756</DOCREL>
<STATUS>30</STATUS>
<DIRECT>1</DIRECT>
<OUTMOD>2</OUTMOD>
<IDOCTYP>EHPOST01</IDOCTYP>
<MESTYP>AOPOST</MESTYP>
<SNDPOR>SAPQM7</SNDPOR>
<SNDPRT>LS</SNDPRT>
<SNDPRN>QM7CLNT910</SNDPRN>
<RCVPOR>ZGTTSINTTP</RCVPOR>
<RCVPRT>LS</RCVPRT>
<RCVPRN>ZLSGTTINT</RCVPRN>
<CREDAT>20200805</CREDAT>
<CRETIM>075019</CRETIM>
<ARCKEY>urn:sap.com:msgid=60159A6B3A4749799BCF6333BC296307</ARCKEY>
<SERIAL>20201125034043</SERIAL>
</EDI_DC40>
<E1EVMHDR02 SEGMENT="1">
<EVTID>GTT_DELETION_EVENT</EVTID>
<EVTDAT>20210225</EVTDAT>
<EVTTIM>111006</EVTTIM>
<EVTZON>CET</EVTZON>
<SRCTX>0000000000</SRCTX>
<E1EVMTID SEGMENT="1">
<TRXCOD>SHIPMENT_IVAN</TRXCOD>
<TRXID>0000004001</TRXID>
</E1EVMTID>
</E1EVMHDR02>
</IDOC>
</GTTMSG01>
</soap-env:Body>
</soap-env:Envelope>

20
Response

Response Codes

The following HTTP response codes may occur:


Code HTTP Description Track and Trace Semantic
200 OK EM IDOC is received successfully
400 Bad Request Something is not correct in the payload
401 Unauthorized There is no authentication passed with the request
403 Forbidden The user does not have the right privileges
404 Not found Request URI is not correct
500 Internal Server Error An unspecified error occurred during request processing

Response Body

Message in XML format.

Response Body Example:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
< EVMSTA02Response xmlns="urn:sap-com:document:sap:idoc:soap:messages">
<IdocAssign>
<TransferId xmlns="urn:sap-
com:document:sap:idoc:soap:messages">0000000002705455</TransferId>
<DbId xmlns="urn:sap-
com:document:sap:idoc:soap:messages">0000000002705455</DbId>
</IdocAssign>
</ EVMSTA02Response>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

21
c) Receive a Combined EM IDOC

Request

Request URI:
https://<server address>[:port]/api/idoc/em/v1/TrackedProcessAndEvent

Request Method: POST

Request Body: EM IDOC in XML format

Request Body Example:

<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header>
<msgID:messageId
xmlns:msgID="http://www.sap.com/webas/640/soap/features/messageId/">uuid:0894ef45-9101-
1eda-a2a5-8aa1af6843f4</msgID:messageId>
</soap-env:Header>
<soap-env:Body>
<GTTMSG01 xmlns="urn:sap-com:document:sap:idoc:soap:messages">
<IDOC BEGIN="1">
<EDI_DC40 SEGMENT="1">
<TABNAM>EDI_DC40</TABNAM>
<MANDT>910</MANDT>
<DOCNUM>0000000002368243</DOCNUM>
<DOCREL>755</DOCREL>
<STATUS>30</STATUS>
<DIRECT>1</DIRECT>
<OUTMOD>2</OUTMOD>
<IDOCTYP>EVMSTA02</IDOCTYP>
<MESTYP>EVMSTA</MESTYP>
<SNDPOR>SAPQM7</SNDPOR>
<SNDPRT>LS</SNDPRT>
<SNDPRN>QM7CLNT910</SNDPRN>
<RCVPOR>GTTV2ACCEV</RCVPOR>
<RCVPRT>LS</RCVPRT>
<RCVPRN>GTTV2ACC</RCVPRN>
<CREDAT>20200428</CREDAT>
<CRETIM>104329</CRETIM>
<ARCKEY>urn:sap.com:msgid=0894EF4591011EDAA2A58AA1AF6843F4</ARCKEY>
<SERIAL>20200428104329</SERIAL>
</EDI_DC40>
<E1EHPAO SEGMENT="1">
<APPSYS>QM7CLNT910</APPSYS>
<APPOBJTYPE>YSHIPMENT_ACC</APPOBJTYPE>
<APPOBJID>0000008888</APPOBJID>
<E1EHPCP SEGMENT="1">
<PARAMNAME>FORWARDING_AGENT_NAME</PARAMNAME>
<PARAMINDEX>0000000000</PARAMINDEX>
<VALUE>VENDOR</VALUE>
</E1EHPCP>
<E1EHPCP SEGMENT="1">

22
<PARAMNAME>PARTITION_KEY_HINT</PARAMNAME>
<PARAMINDEX>0000000000</PARAMINDEX>
<VALUE>00001</VALUE>
</E1EHPCP>
<E1EHPCP SEGMENT="1">
<PARAMNAME>ACTUAL_TECHNICAL_DATETIME</PARAMNAME>
<PARAMINDEX>0000000000</PARAMINDEX>
<VALUE>020201125034043</VALUE>
</E1EHPCP>
<E1EHPCP SEGMENT="1">
<PARAMNAME>ACTUAL_TECHNICAL_TIMEZONE</PARAMNAME>
<PARAMINDEX>0000000000</PARAMINDEX>
<VALUE>CET</VALUE>
</E1EHPCP>
<E1EHPEE SEGMENT="1">
<MILESTONENUM>0000000001</MILESTONENUM>
<MILESTONE>ARRIV_CARR</MILESTONE>
<CARRID>B01_FWAGNT</CARRID>
<LOCTYPE>SP</LOCTYPE>
<LOCID1>TM84</LOCID1>
<SNDID>B01_FWAGNT</SNDID>
<MSG_EXP_DATETIME>000000000000000</MSG_EXP_DATETIME>
<MSG_ER_EXP_DTIME>000000000000000</MSG_ER_EXP_DTIME>
<MSG_LT_EXP_DTIME>000000000000000</MSG_LT_EXP_DTIME>
<EVT_EXP_DATETIME>000000000000000</EVT_EXP_DATETIME>
<EVT_ER_EXP_DTIME>000000000000000</EVT_ER_EXP_DTIME>
<EVT_LT_EXP_DTIME>000000000000000</EVT_LT_EXP_DTIME>
<EVT_EXP_TZONE>CET</EVT_EXP_TZONE>
<ITEMIDENT>29JlHP417jgXgHZDnd01B0</ITEMIDENT>
</E1EHPEE>
<E1EHPTID SEGMENT="1">
<TRXCOD>SHP_NO</TRXCOD>
<TRXID>0000008888</TRXID>
<START_DATE>020200423115700</START_DATE>
<END_DATE>020200423115700</END_DATE>
<ACTION>A</ACTION>
<TIMZON>CET</TIMZON>
</E1EHPTID>
</E1EHPAO>
<E1EVMHDR02 SEGMENT="1">
<EVTID>ARRIV_CARR</EVTID>
<EVTDAT>20200428</EVTDAT>
<EVTTIM>104300</EVTTIM>
<EVTZON>CET</EVTZON>
<E1EVMTID SEGMENT="1">
<TRXCOD>SHP_NO</TRXCOD>
<TRXID>0000001452</TRXID>
</E1EVMTID>
<E1EVMLID SEGMENT="1">
<LOCCOD>SP</LOCCOD>
<LOCID1>TM84</LOCID1>
</E1EVMLID>
<E1EVMLID SEGMENT="1">

23
<LOCCOD>SP</LOCCOD>
<LOCID1>TM84</LOCID1>
</E1EVMLID>
<E1EVMREF02>
<APPSYS>QM7CLNT910</APPSYS>
<APPOBJTYPE>YSHIPMENT_ACC</APPOBJTYPE>
<APPOBJID>0000008888</APPOBJID>
<STARTDATE>20200723</STARTDATE>
<STARTTIME>180000</STARTTIME>
<ENDDATE>20200724</ENDDATE>
<ENDTIME>180000</ENDTIME>
</E1EVMREF02>
<E1EVMPAR SEGMENT="1">
<PARAM_NAME> ACTUAL_TECHNICAL_DATETIME </PARAM_NAME>
<PARAM_VALUE>020201125034043</PARAM_VALUE>
</E1EVMPAR>
<E1EVMPAR SEGMENT="1">
<PARAM_NAME> ACTUAL_TECHNICAL_TIMEZONE </PARAM_NAME>
<PARAM_VALUE> CET</PARAM_VALUE>
</E1EVMPAR>
<E1EVMPAR SEGMENT="1">
<PARAM_NAME>PARTITION_KEY_HINT</PARAM_NAME>
<PARAM_VALUE>0080001326</PARAM_VALUE>
</E1EVMPAR>
</E1EVMHDR02>
</IDOC>
</GTTMSG01>
</soap-env:Body>
</soap-env:Envelope>

24
Response

Response Codes

The following HTTP response codes may occur:


Code HTTP Description Track and Trace Semantic
200 OK EM IDOC is received successfully
400 Bad Request Something is not correct in the payload
401 Unauthorized There is no authentication passed with the request
403 Forbidden The user does not have the right privileges
404 Not found Request URI is not correct
500 Internal Server Error An unspecified error occurred during request processing

Response Body

Message in XML format.

Response Body Example:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<GTTMSG01Response xmlns="urn:sap-com:document:sap:idoc:soap:messages">
<IdocAssign>
<TransferId xmlns="urn:sap-
com:document:sap:idoc:soap:messages">0000000002705455</TransferId>
<DbId xmlns="urn:sap-
com:document:sap:idoc:soap:messages">0000000002705455</DbId>
</IdocAssign>
</GTTMSG01Response>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

25
2. GTT_V2_HTTP_EVENT_INGESTION (TRACKED PROCESS/EVENT)

Description
 technical name: GTT_V2_HTTP_EVENT_INGESTION
 purpose: for ingesting tracked processes and actual events
 protocol: HTTP
 users: technical
 same service used separately to:
a) to create and update tracked process
b) to post events

26
a) Create and Update Tracked Process
Use tracked process event to create and update tracked process.

Request

Request URI
https://<server address>[:port]/api/inbound/rest/v1/<Model Namespace>.<Write
Service Name>/<Tracked Process Event Name>

Model Namespace = com.<Tenant Name>.gtt.app.<Model Name>


Write Service Name= <Model Name>WriteService

Example:
Tenant Name: gttsampleso01
Model Name: sof
Model Namespace: com.gttsampleso01.gtt.app.sof
Write Service Name= sofWriteService
Tracked Process Event Name = DeliveryItemEvent
<Model Namespace>.<Write Service Name> = com.gttsampleso01.gtt.app.sof.sofWriteService

Request URI Example


https://<server address>[:port]/api/inbound/rest/v1
/com.gttsampleso01.gtt.app.sof.sofWriteService/DeliveryItemEvent

HTTP Method Post

Request Header pass additional information with the request

Request Header Properties


Property Type Mandator Description
y
LBN-GTT-Source-Id String no An id to represent which source
system the message comes from
LBN-GTT-Message- String no The message’s id in the source
Number system
LBN-GTT-Partition-Key- String no A hint to determine which
Hint message queue the message will
be sent to. Messages with the
same hint will be sent to the same
message queue and they will be
processed in chronological order.

Request Header Example


LBN-GTT-Message-Number: 9900000007778950
LBN-GTT-Source-Id: QS8CLNT910
LBN-GTT-Partition-Key-Hint: 20210122

Request Body the tracked process event to be used to create or update tracked process

27
1. Create or update a tracked process without attachments
In this case, request body is in json format.

Request Body Example


{
"door": "",
"initialPlannedDate": "2020-08-06",
"destinationAddress": "Testname test$test street 123456$68766
HOCKENHEIM$GERMANY",
"references": [{
"referenceType_code": "TRACKING",
"action_code": "ADD",
"altKey":
"xri://sap.com/id:LBN#10010001016:QM7CLNT910:OUTBOUND_DELIVERY:0080045552",
"validFrom": "2020-08-03T05:50:10Z",
"validTo": "9999-12-30T23:00:00Z"
}
],
"itemNo": "000020",
"billofLading": "",
"orderQuantity": 1.000,
"executionStatus_code": "NOT_STARTED",
"shippingPoint": "0001",
"deliveryAltKey":
"xri://sap.com/id:LBN#10010001016:QM7CLNT910:OUTBOUND_DELIVERY:0080045552",
"podStatus_code": "X",
"weightUoM": "KG",
"goodsIssueStatus_code": "A",
"warehouseDescription": "",
"quantityUoM": "EA",
"pickingStatus_code": "C",
"actualBusinessTimeZone": "CET",
"upc": "5007509",
"priority": 0,
"volume": 1.000,
"netWeight": 4.000,
"incotermsVersion": "0001",
"salesOrderItem_id": "42fdd0f4-a566-5b66-8e0c-d3d27dbb0272",
"destinationTelephone": "13912341234",
"materialNo": "HST_F1",
"departureAddress": "Company$Dietmar-Hopp-Allee 16$69190
WALLDORF$GERMANY",
"delivery_id": "56dcfddc-555c-5209-b7e8-fc863aaa5cf2",
"destination": "0000010105",
"destinationEmail": "test@163.com",
"altKey":
"xri://sap.com/id:LBN#10010001016:QM7CLNT910:OUTBOUND_DELIVERY_IT:0080045552
000020",
"modelNamespace": "com.lbngttsamples.gtt.app.sof",
"volumeUoM": "FT3",
"actualTechnicalTimestamp": "2020-08-03T05:50:16.538Z",
"dangerousGoods": "false",
"deliveryNo": "0080045552",
"plannedEventGroups":[
{"group": "001", "plannedEventUpdateStrategy_code":
"KEEP_REPORTED_WITH_DELETION"},

28
{"group": "002", "plannedEventUpdateStrategy_code":
"KEEP_REPORTED_WITHOUT_DELETION"}
],

"plannedEvents": [
{
"plannedBusinessTimestamp": "2020-08-04T22:00:00Z",
"plannedBusinessTimeZone": "CET",
"plannedTechnicalTimestamp": "2020-08-04T22:00:00Z",
"eventType":
"com.lbngttsamples.gtt.app.sof.Delivery.GoodsIssued",
"locationAltKey":
"xri://sap.com/id:LBN#10010001016:QM7CLNT910:Location:ShippingPoint:0001",
"group": "001"
},
{
"plannedBusinessTimestamp": "2020-08-05T22:00:00Z",
"plannedBusinessTimeZone": "CET",
"plannedTechnicalTimestamp": "2020-08-04T22:00:00Z",
"eventType":
"com.lbngttsamples.gtt.app.sof.Delivery.GoodsReceipt",
"locationAltKey":
"xri://sap.com/id:LBN#10010001016:QM7CLNT910:Location:Customer:0002",
"group": "002"
} ],
"incoterms_code": "CIF",
"materialDescription": "Laptop",
"warehouseNo": "",
"actualBusinessTimestamp": "2020-08-03T05:50:10Z",
"grossWeight": 5.000,
"salesOrderItemAltKey":
"xri://sap.com/id:LBN#10010001016:QM7CLNT910:SALES_ORDER_ITEM:00000784030000
20",
"incotermsLocation1": "",
"packingStatus_code": "X",
"revisedPlannedDate": "2020-08-06",
"messageSourceType": "TM"
}

29
2. Create a tracked process with attachments
In this case, request body is in form-data format.

Request Header Content-Type: multipart/form-data


Request Body Example
event:{
"door": "",
"initialPlannedDate": "2020-08-06",
"destinationAddress": "Testname test$test street 123456$68766
HOCKENHEIM$GERMANY",
"references": [
{
"referenceType_code": "TRACKING",
"action_code": "ADD",
"altKey":
"xri://sap.com/id:LBN#10010001016:QM7CLNT910:OUTBOUND_DELIVERY:0080045552",
"validFrom": "2020-08-03T05:50:10Z",
"validTo": "9999-12-30T23:00:00Z"
}
],
"itemNo": "000020",
"billofLading": "",
"orderQuantity": 1.000,
"executionStatus_code": "NOT_STARTED",
"shippingPoint": "0001",
"deliveryAltKey":
"xri://sap.com/id:LBN#10010001016:QM7CLNT910:OUTBOUND_DELIVERY:0080045552",
"podStatus_code": "X",
"weightUoM": "KG",
"goodsIssueStatus_code": "A",
"warehouseDescription": "",
"quantityUoM": "EA",
"pickingStatus_code": "C",
"actualBusinessTimeZone": "CET",
"upc": "5007509",
"priority": 0,
"volume": 1.000,
"netWeight": 4.000,
"incotermsVersion": "0001",
"salesOrderItem_id": "42fdd0f4-a566-5b66-8e0c-d3d27dbb0272",
"destinationTelephone": "13912341234",
"materialNo": "HST_F1",
"departureAddress": "Company$Dietmar-Hopp-Allee 16$69190 WALLDORF$GERMANY",
"delivery_id": "56dcfddc-555c-5209-b7e8-fc863aaa5cf2",
"destination": "0000010105",
"destinationEmail": "test@163.com",
"altKey":
"xri://sap.com/id:LBN#10010001016:QM7CLNT910:OUTBOUND_DELIVERY_IT:0080045552
000020",
"modelNamespace": "com.lbngttsamples.gtt.app.sof",
"volumeUoM": "FT3",
"actualTechnicalTimestamp": "2020-08-03T05:50:16.538Z",
"dangerousGoods": "false",
"deliveryNo": "0080045552",
"plannedEvents": [
{

30
"plannedBusinessTimestamp": "2020-08-04T22:00:00Z",
"plannedBusinessTimeZone": "CET",
"plannedTechnicalTimestamp": "2020-08-04T22:00:00Z",
"eventType": "com.lbngttsamples.gtt.app.sof.Delivery.GoodsIssued",
"locationAltKey":
"xri://sap.com/id:LBN#10010001016:QM7CLNT910:Location:ShippingPoint:0001"
}
],
"incoterms_code": "CIF",
"materialDescription": "Laptop",
"warehouseNo": "",
"actualBusinessTimestamp": "2020-08-03T05:50:10Z",
"grossWeight": 5.000,
"salesOrderItemAltKey":
"xri://sap.com/id:LBN#10010001016:QM7CLNT910:SALES_ORDER_ITEM:00000784030000
20",
"incotermsLocation1": "",
"packingStatus_code": "X",
"revisedPlannedDate": "2020-08-06",
"messageSourceType": "TM",
"myattachments": [
{
"fileName": "clouds.png"
},
{
"fileName": "events.pdf"
}
]
}

attachments[]: file list

Notes:
 When using Postman to send “POST” requests, set the body as “form-data” and set the two
Key Type Value
event Text Copy the payload of “event”
attachments[] File Select the files with the same
file name you defined in
“myattachments”
keys:

 In this example, “myattachments” is a tracked process field with the type “Attachments”
you defined in your model. You can have user-defined name.

31
3. Update a tracked process to add attachments
In this case, request body is in form-data format. Keep the fileId of the attachment that
you want to have.

Request Header Content-Type: multipart/form-data


Request Body Example
event:{
"door": "",
"initialPlannedDate": "2020-08-06",
"destinationAddress": "Testname test$test street 123456$68766
HOCKENHEIM$GERMANY",
"references": [{
"referenceType_code": "TRACKING",
"action_code": "ADD",
"altKey":
"xri://sap.com/id:LBN#10010001016:QM7CLNT910:OUTBOUND_DELIVERY:0080045552",
"validFrom": "2020-08-03T05:50:10Z",
"validTo": "9999-12-30T23:00:00Z"
}
],
"itemNo": "000020",
"billofLading": "",
"orderQuantity": 1.000,
"executionStatus_code": "NOT_STARTED",
"shippingPoint": "0001",
"deliveryAltKey":
"xri://sap.com/id:LBN#10010001016:QM7CLNT910:OUTBOUND_DELIVERY:0080045552",
"podStatus_code": "X",
"weightUoM": "KG",
"goodsIssueStatus_code": "A",
"warehouseDescription": "",
"quantityUoM": "EA",
"pickingStatus_code": "C",
"actualBusinessTimeZone": "CET",
"upc": "5007509",
"priority": 0,
"volume": 1.000,
"netWeight": 4.000,
"incotermsVersion": "0001",
"salesOrderItem_id": "42fdd0f4-a566-5b66-8e0c-d3d27dbb0272",
"destinationTelephone": "13912341234",
"materialNo": "HST_F1",
"departureAddress": "Company$Dietmar-Hopp-Allee 16$69190
WALLDORF$GERMANY",
"delivery_id": "56dcfddc-555c-5209-b7e8-fc863aaa5cf2",
"destination": "0000010105",
"destinationEmail": "test@163.com",
"altKey":
"xri://sap.com/id:LBN#10010001016:QM7CLNT910:OUTBOUND_DELIVERY_IT:0080045552
000020",
"modelNamespace": "com.lbngttsamples.gtt.app.sof",
"volumeUoM": "FT3",
"actualTechnicalTimestamp": "2020-08-03T05:50:16.538Z",
"dangerousGoods": "false",
"deliveryNo": "0080045552",

32
"plannedEvents": [{
"plannedBusinessTimestamp": "2020-08-04T22:00:00Z",
"plannedBusinessTimeZone": "CET",
"plannedTechnicalTimestamp": "2020-08-04T22:00:00Z",
"eventType":
"com.lbngttsamples.gtt.app.sof.Delivery.GoodsIssued",
"locationAltKey":
"xri://sap.com/id:LBN#10010001016:QM7CLNT910:Location:ShippingPoint:0001"
}
],
"incoterms_code": "CIF",
"materialDescription": "Laptop",
"warehouseNo": "",
"actualBusinessTimestamp": "2020-08-03T05:50:10Z",
"grossWeight": 5.000,
"salesOrderItemAltKey":
"xri://sap.com/id:LBN#10010001016:QM7CLNT910:SALES_ORDER_ITEM:00000784030000
20",
"incotermsLocation1": "",
"packingStatus_code": "X",
"revisedPlannedDate": "2020-08-06",
"messageSourceType": "TM",
"attachments": [
{
"fileId": "AOblXaaJOIKKGrbqloy888Qgyr9YkOl6tHWpd3bhV11"
},
{
"fileName": "clouds.png"
}
]
}
attachments[]: file list

33
4. Update a tracked process to remove attachments
In this case, request body is in json format. Remove the fileId of the attachment that you want
to remove from attachment field and keep the fileId you want to have.

Request Body Example


{
"door": "",
"initialPlannedDate": "2020-08-06",
"destinationAddress": "Testname test$test street 123456$68766
HOCKENHEIM$GERMANY",
"references": [{
"referenceType_code": "TRACKING",
"action_code": "ADD",
"altKey":
"xri://sap.com/id:LBN#10010001016:QM7CLNT910:OUTBOUND_DELIVERY:0080045552",
"validFrom": "2020-08-03T05:50:10Z",
"validTo": "9999-12-30T23:00:00Z"
}
],
"itemNo": "000020",
"billofLading": "",
"orderQuantity": 1.000,
"executionStatus_code": "NOT_STARTED",
"shippingPoint": "0001",
"deliveryAltKey":
"xri://sap.com/id:LBN#10010001016:QM7CLNT910:OUTBOUND_DELIVERY:0080045552",
"podStatus_code": "X",
"weightUoM": "KG",
"goodsIssueStatus_code": "A",
"warehouseDescription": "",
"quantityUoM": "EA",
"pickingStatus_code": "C",
"actualBusinessTimeZone": "CET",
"upc": "5007509",
"priority": 0,
"volume": 1.000,
"netWeight": 4.000,
"incotermsVersion": "0001",
"salesOrderItem_id": "42fdd0f4-a566-5b66-8e0c-d3d27dbb0272",
"destinationTelephone": "13912341234",
"materialNo": "HST_F1",
"departureAddress": "Company$Dietmar-Hopp-Allee 16$69190
WALLDORF$GERMANY",
"delivery_id": "56dcfddc-555c-5209-b7e8-fc863aaa5cf2",
"destination": "0000010105",
"destinationEmail": "test@163.com",
"altKey":
"xri://sap.com/id:LBN#10010001016:QM7CLNT910:OUTBOUND_DELIVERY_IT:0080045552
000020",
"modelNamespace": "com.lbngttsamples.gtt.app.sof",
"volumeUoM": "FT3",
"actualTechnicalTimestamp": "2020-08-03T05:50:16.538Z",
"dangerousGoods": "false",
"deliveryNo": "0080045552",
"plannedEvents": [{

34
"plannedBusinessTimestamp": "2020-08-04T22:00:00Z",
"plannedBusinessTimeZone": "CET",
"plannedTechnicalTimestamp": "2020-08-04T22:00:00Z",
"eventType":
"com.lbngttsamples.gtt.app.sof.Delivery.GoodsIssued",
"locationAltKey":
"xri://sap.com/id:LBN#10010001016:QM7CLNT910:Location:ShippingPoint:0001"
}
],
"incoterms_code": "CIF",
"materialDescription": "Laptop",
"warehouseNo": "",
"actualBusinessTimestamp": "2020-08-03T05:50:10Z",
"grossWeight": 5.000,
"salesOrderItemAltKey":
"xri://sap.com/id:LBN#10010001016:QM7CLNT910:SALES_ORDER_ITEM:00000784030000
20",
"incotermsLocation1": "",
"packingStatus_code": "X",
"revisedPlannedDate": "2020-08-06",
"messageSourceType": "TM",
"attachments": [
{
"fileId": "AOblXaaJOIKKGrbqloy888Qgyr9YkOl6tHWpd3bhV11"
}
]
}

35
Request Body Properties
Property Type Mandator Description
y
references Array of tracking no The additional tracking Ids of
Ids the tracked process.
altKey String yes The alternative key.

Assuming URN style keys we


have as example first our EM-
Style keys:
xri://sap.com/id:LBN#100
10001016:QM7CLNT910:
OUTBOUND_DELIVERY:0
080045552
as string serialization with
structural components:
1. xri://sap.com/id: This
prefix is used to identify
documents/processes
from SAP system
2. LBN#10010001016: an
id for solution owner or
solution participant
3. QM7CLNT910: Business
system name
4. OUTBOUND_DELIVERY:
the document’s type.
This is TrackingIdType in
particular.
5. 0080045552: The ‘local’
number range key

validFrom Timestamp no The start date and time as local


timestamp from which a
tracking id is valid for that
particular tracked process.
Supported timestamp format:
yyyy-MM-ddTHH:mm:ssZ
validTo Timestamp no The end date and time as local
timestamp until when a tracking
id is valid for a particular tracked
process. Supported timestamp
format: yyyy-MM-
ddTHH:mm:ssZ
referenceType_code String yes Fixed: TRACKING

36
action String yes Can be only set to ADD/DELETE
ADD - creates/updates tracking
id
DELETE – deletes tracking id
plannedEvents Array of planned no Information about planned
event events
eventType String yes The type that identifies the type
of the event
locationAltKey String no The alternative key of the
location where the event is
expected to happen
eventMatchKey String no Identifier for planned event
longitude Decimal no The longitude where planned
event will happen
latitude Decimal no The latitude where planned
event will happen
messageSourceType String no Use the field to identify which
source system the event comes
from
payloadSequence Integer no The event sequence
isFinalPlannedEvent Boolean no This need to be set true for final
event
plannedTechnicalTimesta Timestamp no The timestamp with timezone
mp when the event is expected to
be reported to SAP Business
Network Global Track and
Trace. Supported timestamp
format: yyyy-MM-
ddTHH:mm:ssZ
plannedBusinessTimestam Timestamp no The timestamp with timezone
p when the event is expected to
actually happen. Supported
timestamp format: yyyy-MM-
ddTHH:mm:ssZ
plannedBusinessTimeZone String no The time zone which is mapping
to java time zone
altKey String yes Same to references.altKey
locationAltKey String no The alternative key of the
location
eventMatchKey String no Identifier for planned event
eventReasonCode String no Pre-defined event reason code

37
eventReasonText String no Event reason description
<Other custom no Based on model definition
parameter>

38
Response

Response Codes
The following HTTP response codes may occur:
Code HTTP Track and Trace Semantic
Description
202 Accepted Request has been received and will be processed later
400 Bad Request The content of the request payload does not match the definition. The request
payload should be qualified json string and contain altKey.
401 Unauthorized There is no authentication passed with the request
403 Forbidden The user does not access the right url to create the tracked process instance
404 Not found The access url is inaccessible
405 Method not The method received in the request-line is known by the origin server but not
allowed supported by the target resource.
500 Internal An unspecified error occurred during request processing
Server Error
503 Service The request cannot be executed due to unavailability of required components,
Unavailable e.g. tenant onboarding hasn’t been completed
504 Timeout The server, while acting as a gateway or proxy, did not receive a timely
response from an upstream server it needed to access in order to complete
the request.

Response Body
The response body is empty.

39
b) Post events
Report events to tracked process.

Request

Request URI
https://<server address>[:port]/api/inbound/rest/v1/<Model Namespace>.<Write
Service Name>/<Event Name>

Model Namespace = com.<Tenant Name>.gtt.app.<Model Name>


Write Service Name= <Model Name>WriteService

Example:
Tenant Name: gttsampleso01
Model Name: sof
Model Namespace: com.gttsampleso01.gtt.app.sof
Write Service Name= sofWriteService
Event Name = Picking
<Model Namespace>.<Write Service Name> = com.gttsampleso01.gtt.app.sof.sofWriteService

Request URI Example


https://<server address>[:port]/api/inbound/rest/v1
/com.gttsampleso01.gtt.app.sof.sofWriteService/Picking

HTTP Method Post

Request Header pass additional information with the request

Request Header Properties


Property Type Mandator Description
y
LBN-GTT-Source-Id String no An id to represent which source
system the message comes from
LBN-GTT-Message- String no The message’s id in the source
Number system
LBN-GTT-Partition-Key- String no A hint to determine which
Hint message queue the message will
be sent to. Messages with the
same hint will be sent to the same
message queue and they will be
processed in chronological order.

Request Header Example


LBN-GTT-Message-Number: 9900000007778950
LBN-GTT-Source-Id: QS8CLNT910
LBN-GTT-Partition-Key-Hint: 20210122
Request Body the event to be posted

40
1. Post an event without attachments
In this case, request body is in json format.

Request Body Example


{
"altKey":
"xri://sap.com/id:LBN#10010001016:QM7CLNT910:OUTBOUND_DELIVERY_IT:0080045552
000040",
"quantity": 0.000,
"messageSourceType": "TM",
"actualTechnicalTimestamp": "2020-08-03T05:50:30.183Z",
"actualBusinessTimeZone": "CET",
"actualBusinessTimestamp": "2020-08-03T05:50:11Z",
"locationAltKey":
"xri://sap.com/id:LBN#10010001016:QM7CLNT910:Location:ShippingPoint:0001"
}

2. Post an event with attachments


In this case, request body is in form-data format.

Request Body Example


event: {
"altKey":
"xri://sap.com/id:LBN#10010001016:QM7CLNT910:OUTBOUND_DELIVERY_IT:0080045552
000040",
"quantity": 0.000,
"messageSourceType": "TM",
"actualTechnicalTimestamp": "2020-08-03T05:50:30.183Z",
"actualBusinessTimeZone": "CET",
"actualBusinessTimestamp": "2020-08-03T05:50:11Z",
"locationAltKey":
"xri://sap.com/id:LBN#10010001016:QM7CLNT910:Location:ShippingPoint:0001",
"myattachments": [
{
"fileName": "clouds.png"
}
]
}
attachments[]: file list

Notes:
 When using Postman to send “POST” requests, set the body as “form-data” and set the two
Key Type Value
event Text Copy the payload of “event”
attachments[] File Select the files with the same
file name you defined in
“myattachments”
keys:
 In this example, “myattachments” is a tracked process field with the type “Attachments”
you defined in your model. You can have user-defined name.

41
3. Post an event with estimatedTimestamps
{
"altKey":
"xri://sap.com/id:LBN#10010001016:QM7CLNT910:OUTBOUND_DELIVERY_IT:0080045552
000040",
"quantity": 0.0,
"messageSourceType": "TM",
"actualTechnicalTimestamp": "2020-08-03T05:50:30.183Z",
"actualBusinessTimeZone": "CET",
"actualBusinessTimestamp": "2020-08-03T05:50:11Z",
"locationAltKey":
"xri://sap.com/id:LBN#10010001016:QM7CLNT910:Location:ShippingPoint:0001",
"estimatedTimestamps": [
{
"eventType":
"com.gttsampleso01.gtt.app.sof.Delivery.LoadingStarted",
"locationAltKey":
"xri://sap.com/id:LBN#10010001016:QM7CLNT910:Location:ShippingPoint:0001",
"estimatedTimestamp": "2020-08-03T06:50:11Z"
}
]
}

Request Body Properties


Property Type Mandator Description
y
references Array of tracking no The additional operation to
Ids tracking Ids of the tracked
process.
altKey String yes The alternative key.

Assuming URN style keys we


have as example first our EM-
Style keys:
xri://sap.com/id:LBN#100
10001016:QM7CLNT910:
OUTBOUND_DELIVERY:0
080045552
as string serialization with
structural components:
1. xri://sap.com/id: This
prefix is used to identify
documents/processes
from SAP system
2. LBN#10010001016: an
id for solution owner or
solution participant
3. QM7CLNT910: Business
system name
4. OUTBOUND_DELIVERY:

42
the document’s type.
This is TrackingIdType in
particular.
5. 0080045552: The ‘local’
number range key

validFrom Timestamp no The start date and time as local


timestamp from which a
tracking id is valid for that
particular tracked process.
Supported timestamp format:
yyyy-MM-ddTHH:mm:ssZ
validTo Timestamp no The end date and time as local
timestamp until when a tracking
id is valid for a particular tracked
process. Supported timestamp
format: yyyy-MM-
ddTHH:mm:ssZ
referenceType_code String yes Fixed: TRACKING
action String yes Can be only set to ADD/DELETE
ADD - creates/updates tracking
id
DELETE – deletes tracking id
altKey String yes Same to references.altKey
locationAltKey String no The alternative key of the
location
eventMatchKey String no Identifier for planned event
eventReasonCode String no Pre-defined event reason code
eventReasonText String no Event reason description
messageSourceType String no Use the field to identify which
source system the event comes
from
estimatedTimestamps Array of planned no Information of estimated
events with timestamp
estimatedTimest
amp
<Other custom no Based on model definition
parameter>

43
Response

Response Codes
The following HTTP response codes may occur:
Code HTTP Description Track and Trace Semantic
202 Accepted Request has been received and will be processed later
400 Bad Request The content of the request payload does not match the definition. The
request payload should be qualified json string and contain altKey.
401 Unauthorized There is no authentication passed with the request
403 Forbidden The user does not access the right url to create the tracked process
instance
404 Not found The access url is inaccessible
405 Method not allowed The method received in the request-line is known by the origin server
but not supported by the target resource.
500 Internal Server Error An unspecified error occurred during request processing
503 Service Unavailable The request cannot be executed due to unavailability of required
components, e.g. tenant onboarding hasn’t been completed
504 Timeout The server, while acting as a gateway or proxy, did not receive a timely
response from an upstream server it needed to access in order to
complete the request.

Response Body
The response body is empty.

44
3. GTT_V2_ODATA_QUERY (TRACKED PROCESS/EVENT)

Description
 technical name: GTT_V2_OData_Query
 purpose: for access GTT tracked processes and events
 protocol: OData
 users: technical

a) General

Request URI
https://<server address>[:port]/api/outbound/odata/v1/<Model
Namespace>.<Read Service Name>/

Model Namespace = com.<Tenant Name>.gtt.app.<Model Name>


Read Service Name = <Model Name>Service

Example:
Tenant Name: gttsampleso01
Model Name: sof
Model Namespace: com.gttsampleso01.gtt.app.sof
Read Service Name = sofService
<Model Namespace>.<Read Service Name> = com.gttsampleso01.gtt.app.sof.sofService

Response Code
The response code will be applied for all the following sample OData queries.

Code HTTP Description Track and Trace Semantic


200 OK Query instance(s) have been retrieved
202 Accepted If using OData batch mode, then this is the
response
400 Bad Request The URL is malformed
401 Unauthorized There is no authentication passed with the
request
403 Forbidden The user does not have the right privileges to
read the requested particular tracked
process instance
404 Not found The requested particular tracked process
instance was not found.
500 Internal Server Error An unspecified error occurred during request
processing

45
b) Sample Model

The “Track Sales Order Fulfillment” model that is abbreviated as “sof” is used as a sample here.
Some sample requests of how to query in the Track Sales Order Fulfillment business scenario are
displayed.

Example:
Tenant Name: gttsampleso01
Model Name: sof
Model Namespace: com.gttsampleso01.gtt.app.sof
Read Service Name = sofService
<Model Namespace>.<Read Service Name> = com.gttsampleso01.gtt.app.sof.sofService

c) Read Metadata

Query for the metadata structure in the “sof” model.

Request

Request URI
https://<server address>[:port]/api/outbound/odata/v1/<Model Namespace>.<
Read Service Name>/$metadata

HTTP Method Get

Request URI Example


https://<server
address>[:port]/api/outbound/odata/v1/com.gttsampleso01.gtt.app.sof.sofServi
ce/$metadata

d) Read Tracked Process List

Query for the Tracked Process List of the “sof” model.

Request

Request URI
https://<server address>[:port]/api/outbound/odata/v1/<Model Namespace>.<
Read Service Name>/TrackedProcess

HTTP Method Get

Request URI Example


https://<server
address>[:port]/api/outbound/odata/v1/com.gttsampleso01.gtt.app.sof.sofServi
ce/TrackedProcess

46
e) Read Single Tracked Process Instance
Query for a specified Tracked Process of the “sof” model.

Request

Request URI
https://<server address>[:port]/api/outbound/odata/v1/<Model Namespace>.<
Read Service Name>/<Tracked Process >

HTTP Method Get

Request URI Example


https://<server
address>[:port]/api/outbound/odata/v1/com.gttsampleso01.gtt.app.sof.sofServi
ce/Shipment

f) Read Single Tracked Process Instance with Planned Events

Query for the Tracked Process with its planned events in the “sof” model.

Request

Request URI
https://<server address>[:port]/api/outbound/odata/v1/<Model Namespace>.<
Read Service Name>/TrackedProcess(‘<uuid>’)?$expand=plannedEvents

HTTP Method Get

Request URI Example


https://<server address>[:port]/api/outbound/odata/v1/
com.gttsampleso01.gtt.app.sof.sofService/TrackedProcess(guid'6d49b8f3-5599-
5cbf-b9d0-b06bfb4e24a9')?$expand=plannedEvents

g) Read Planned Events of Single Tracked Process Instance

Query for the Tracked Process with its planned events in the “sof” model.

Request

Request URI
https://<server address>[:port]/api/outbound/odata/v1/<Model Namespace>.<
Read Service Name>/TrackedProcess(<’uuid’>)/plannedEvents

HTTP Method Get

Request URI Example


https://<server address>[:port]/api/outbound/odata/v1/
com.gttsampleso01.gtt.app.sof.sofService/TrackedProcess(guid'6d49b8f3-5599-
5cbf-b9d0-b06bfb4e24a9')/plannedEvents

47
h) Read Tracked Process Instances by Other Operators (count, top, skip, orderby, filter,
inlinecount, format)

Operator Description URI (Path, Service)


$count Read the total count /api/outbound/odata/v1/<Model
of Tracked Process Namespace>.<Read Service Name>/
instances TrackedProcess/$count

$skip Read all Tracked /api/outbound/odata/v1/<Model


Process instances Namespace>.<Read Service Name>/
except skip the first TrackedProcess?$skip=1
one
$top Read the first Tracked /api/outbound/odata/v1/<Model
Process instance Namespace>.<Read Service Name>/
TrackedProcess?$top=1

$orderby Read all Tracked /api/outbound/odata/v1/<Model


Process instances Namespace>.<Read Service Name>/
ordered by ascending TrackedProcess?$orderby=trackingId asc
order
$filter Read the Tracked /api/outbound/odata/v1/<Model
Process instances Namespace>.<Read Service Name>/
which trackingId TrackedProcess?$filter=trackingId eq '9900031705'
equals “9900031705”
$inlinecount Read the total count /api/outbound/odata/v1/<Model
of Tracked Process Namespace>.<Read Service Name>/
instances and all TrackedProcess?$inlinecount=allpages
Tracked Process
instances
$format Read all Tracked /api/outbound/odata/v1/<Model
Process instances Namespace>.<Read Service Name>/
with json format TrackedProcess?$format=json

48
i) Instance-based Authorization

Two types of authorization are supported:


 Read: data contributors can read the tracked process fields that are granted Read
authorization.
 Report: data contributors can report events that are granted Report authorization.

To enable the instance-based authorization, you need to:


 connect with your business partner (via the Invite Business Partners app or the Discover
Business Partners app)
 for the tracked process user model field where you enter LBN ID, add LBN# as the prefix of its
value to enable Read or Report authorization. For example, if the LBN ID is 10002424, you
need to enter LBN#10002424.

Instance-based Authorization Check for Write Service

To check if a data contributor has Report authorization for an event, the GTT system will check if the
event’s senderPartyId is equal to the tracked process’s partyId or to the LBN ID with the “LBN#”
prefix.

For predefined event types, data contributors can only report GTTDelayedEvent and GTTOnTimeEvent.

Authorization for instances can be inherited and checked through correlation. For example, suppose
tracked process A observes tracked process B and tracked process B observes tracked process C.

 If you have authorization for tracked process C, you will also have authorization for B and A.
Then events reported to C are also correlated to B and A.
 If you don’t have authorization for tracked process C, the system will check if you have
authorization for B. If so, events will be reported to B and correlated to A. Otherwise, the
system will check if you have authorization for A.
 If tracked process C doesn’t exist, the system will check if you have authorization for B. If so,
events will be reported to B and correlated to A. Otherwise, the system will check if you have
authorization for A.

49
Instance-based Authorization Check for OData Read

If the “enableInstanceBasedAuthorization” flag of the model is switched on, the instance-based


authorization check for OData Read will be enabled.
1. Solution owners have Read authorization for their instances.
2. Data contributors can only query user-defined process entities, user-defined event entities,
GTTDelayedEvent and GTTOnTimeEvent.
 When querying process entities, you cannot filter/expand “QualifiedTrackingId” and
user defined process entities.
 When querying event entities, you cannot filter/expand core entities and user-defined
process entities.
 When querying any process entities, data will be filtered by process “partyId” and
READ annotation specified LBN IDs. Note that at least one of process “partyId” and
READ annotation specified LBN IDs should be equal to the user’s LBN ID.
 When querying any event entities, data will be filtered by “senderPartyId”, “partyId” and
READ annotation specified LBN IDs. Note that at least one of “senderPartyId”, “partyId”
and READ annotation specified LBN IDs should be equal to the user’s LBN ID.

50
j) Current Supported OData Syntax and API Samples

Query Option/ Descriptio


Operator n Official Sample
https://services.odata.org/OData/OData.sv
$orderby c/Products?$orderby=Rating
https://services.odata.org/OData/OData.sv
$top c/Products?$top=5&$orderby=Name desc
https://services.odata.org/OData/OData.sv
c/Products?$skip=2&$top=2&$orderby=Ra
$skip ting
https://services.odata.org/OData/OData.sv
$count c/Products/$count
$filter
/Suppliers?$filter=Address/City eq
Eq Equal 'Redmond'
/Suppliers?$filter=Address/City ne
Ne Not equal 'London'
Greater
Gt than /Products?$filter=Price gt 20
Greater
than or
Logical Ge equal /Products?$filter=Price ge 10
Operators Lt Less than /Products?$filter=Price lt 20
Less than
Le or equal /Products?$filter=Price le 100
/Products?$filter=Price le 200 and Price gt
And Logical and 3.5
/Products?$filter=Price le 3.5 or Price gt
Or Logical or 200
Logical /Products?$filter=not
Not negation endswith(Description,'milk')
substringo https://services.odata.org/Northwind/North
f(string po, wind.svc/Customers?$filter=substringof('Alf
string p1) reds', CompanyName) eq true
endswith(s https://services.odata.org/Northwind/North
String
tring p0, wind.svc/Customers?$filter=endswith(Com
Functions
string p1) panyName, 'Futterkiste') eq true
startswith( https://services.odata.org/Northwind/North
string p0, wind.svc/Customers?$filter=startswith(Co
string p1) mpanyName, 'Alfr') eq true
https://services.odata.org/OData/OData.sv
c/Categories?$expand=Products
https://services.odata.org/OData/OData.sv
c/Products?$expand=Category,Suppliers
https://services.odata.org/OData/OData.sv
$expand c/Categories?$expand=Products/Suppliers
https://services.odata.org/OData/OData.sv
c/Products?$select=Price,Name
https://services.odata.org/OData/OData.sv
$select c/Categories?$select=Name,Products&$ex

51
pand=Products
https://services.odata.org/OData/OData.sv
c/Categories?$select=Name,Products&$ex
pand=Products/Suppliers
https://services.odata.org/OData/OData.sv
c/Products?$inlinecount=allpages
https://services.odata.org/OData/OData.sv
c/Products?$inlinecount=allpages&$top=1
$inlinecount 0&$filter=Price gt 200
https://services.odata.org/OData/OData.sv
$format c/Products?$format=json

k) Notes

1. It’s not supported that “/”,”//” “;”, “%”, “\” appear in the key of the query entity.

Unsupported example:
https://< Server
Address >/api/outbound/odata/v1/com.gttsampleso01.gtt.app.sof.sofService/
SalesOrderItem(id=guid’6d49b8f3-5599-5cbf-b9d0-b06bfb4e24a9', altkey='/;\%-
1234567890')

2. It’s recommended to keep the layer of the navigation or expand no more than 3 layers.

Not suggested example:


https://< Server
Address >/api/outbound/odata/v1/com.gttsampleso01.gtt.app.sof.sofService/
TrackedProcess(guid'6d49b8f3-5599-5cbf-b9d0-b06bfb4e24a9')?
$expand=plannedEvents/lastProcessEventDirectory/event/references

3. The max limit of number of records in the response is 256.

4. For $expand, the use of a same entity name is not supported.

Unsupported example:
https://< Server
Address >/api/outbound/odata/v1/com.gttsampleso01.gtt.app.sof.sofService
/InboundDeliveryItem(guid'323f6e3f-b3db-5969-b32f-
3364ce2db76d')?$expand=freightUnit/freightUnit

52
4. GTT_V2_ODATA_LOCATION (LOCATION)

Description
 technical name: GTT_V2_OData_Location
 purpose: to create or read locations
 protocol: OData
 users: technical
 used to:
a) Create locations
b) Read locations

a) Create Locations

Request

Request URI
https://<server address>[:port]/api/location/v1/Location

HTTP Method Post

Request Header pass additional information with the request

Request Header Properties


Property Type Mandator Description
y
isCorrectGeocode String no Value can be true or false.
GeoCoordinate will be generated
by location service based on the
address data in request body if
isCorrrectGeocode is set to true.

Request Body the location information

Request Body Example


{
"ObjectTypeCode": "LogisticLocation",
"SourceSystem": "ECC_001",
"LogicalSystem": "ECCCLNT001",
"ExternalId": "011",
"Longitude": "12.12345000",
"Latitude": "21.12345000",
"LocationDescription": "Created by CoreEngine: 011",
"AddressTimeZone": "AST",
"CountryCode": "US",
"RegionCode": "IA",
"CityName": "Des Moines",
"StreetName": "TIanze road",
"HouseNumber": "No.10",
"HouseNumberSupplementText": "1111",
"PostalCode": "100000",
"Number": "80016666",

53
"NumberExtension": "123",
"EmailAddress": "CORE_ENGINE_011@example.com",
"Gln": "0234567890123",
"Duns": "0234567890123",
"Unlocode": "ggabc",
"IataAirportCode": "abc"
}

Note
 The value of the field “SourceSystem” should be the value that you configured in the Data
Replication Framework in the SAP S/4HANA source system. For more, see the first
procedure of the Managing Locations section of Administration Guide of Version 2.
 The value of the field “LogicalSystem” should be the value that you configured in SAP ERP.
For more, see the Define Logical Systems section in the Appendix One of Administration
Guide of Version 2.

Response
Response Body
The created location.

b) Read Locations

Request

Request URI
https://<server address>[:port]/api/location/v1/Location

Request URI Example


https://<server
address>[:port]/api/location/v1/Location?$top=2&$filter=externalId eq '011'

HTTP Method Get

Request Body
The request body is empty.

Response

Response Body
The locations satisfying the conditions in the query parameter.

54
5. GTT_V2_HTTP_METADATA

Description
 technical name: GTT_V2_HTTP_METADATA
 purpose: to provide annotation and i18n download
 protocol: HTTP
 users: technical
 used to:
a) Get annotation file content
b) Get i18n file content
c) Get admissible event types
d) Get elements of an event with core model fields
e) Get all process types
f) Notes

a) Get Annotation File Content

Request

Request URI 1
https://<server address>[:port]/api/metadata/v1/model/<Model
Namespace>/annotation

Request URI 1 Example


https://<server
address>[:port]/api/metadata/v1/model/com.lbngttsamples.gtt.app.sof/annotati
on

Request URI 2
https://<server address>[:port]/api/metadata/v1/model/<Model
Namespace>/annotation?completeVersion=true

Request URI 2 Example


https://<server
address>[:port]/api/metadata/v1/model/com.lbngttsamples.gtt.app.sof/annotati
on?completeVersion=true

HTTP Method Get

Request Body The request body is empty

Response

Response Body 1
Get the specified annotation information of a model including properties and the corresponding label
information.

Response Body 2
Get the complete annotation information of a model including properties, labels, field groups, etc.

55
b) Get i18n File Content

Request

Request URI
https://<server address>[:port]/api/metadata/v1/model/<Model
Namespace>/i18n/<properties>

Request URI Example


https://<server
address>[:port]/api/metadata/v1/model/com.lbngttsamples.gtt.app.sof/i18n/i18
n.properties

HTTP Method Get

Request Body The request body is empty.

Response

Response Body

Get the specified i18N information of a model.

56
c) Get Admissible Event Types

Request

Request URI
https://<server address>[:port]/api/metadata/v1/model/<Model Namespace>/
combined-model/<Tracked Process Type>/admissibleEventTypes

Request URI Example


https://<server address>[:port]/api/metadata/v1/model/
com.gttsampleso01.gtt.app.sofvpauto/ combined-
model/SalesOrderItem.SalesOrderItem/admissibleEventTypes

HTTP Method Get

HTTP Header: Accept-Language: <Language Code>

Request Body The request body is empty

Response

Response Body

{
"admissiblePlannedEvents": [
{
"eventType": {
"target": "delivery.PickingCompletedEvent",
"name": "com.gttsampleso01.gtt.app.sofvpauto.delivery.PickingCompletedEvent",
" descr": "Picking Completed Event"
},
"matchLocation": true,
"businessToleranceValue": 10,
"businessToleranceUnit": "M",
"technicalToleranceValue": 10,
"technicalToleranceUnit": "M",
"periodicOverdueDetection": 10,
"periodicOverdueDetectionUnit": "M",
"maxOverdueDetection": 3
}

],
"admissibleUnplannedEvents": [
{
"eventType": {
"target": "delivery.GoodsDamageEvent",
"name": "com.gttsampleso01.gtt.app.sofvpauto.delivery.GoodsDamageEvent",
" descr": "goods damage",
"isFromCoreModel": false
}
},

57
{
"eventType": {
"target": "CoreModel.GTTDelayedEvent",
"name": "com.sap.gtt.core.CoreModel.GTTDelayedEvent",
" descr": "GTT Delayed Event",
"isFromCoreModel": true
}
}
]
}

58
d) Get Elements of an Event with Core Model Fields

Request

Request URI
https://<server address>[:port]/api/metadata/v1/model/<Model
Namespace>/combined-model/<event Type>/elements

Request URI Example


https://<server address>[:port]/api/metadata/v1/model/
com.gttsampleso01.gtt.app.sofvpauto/ combined-
model/Shipment.Arrival/elements

HTTP Method Get

Request Body The request body is empty

Response

Response Body
{
"elements": [
{
"name": "transportationMeans",
"label": "Transportation Means",
"type": "string",
"readable": true,
"writable": true,
"dpp": [],
"translation": {
"label": {
"textType": "LABEL",
"translation": {}
}
},
"length": 20,
"i18nKey": "EL_Arrival_transportationMeans_LABEL",
"isFromCoreModel": false,
"key": false,
"localized": false,
"required": false,
"context": "Shipment"
},
{
"name": "locationType",
"label": "Location Type",
"type": "string",
"readable": true,
"writable": true,
"translation": {
"label": {

59
"textType": "LABEL",
"translation": {}
}
},
"length": 255,
"i18nKey": "EL_Arrival_locationType_LABEL",
"isFromCoreModel": false,
"key": false,
"localized": false,
"required": false,
"context": "Shipment"
},
{
"name": "estimatedArrival",
"label": "Estimated Arrival",
"type": "composition",
"readable": true,
"writable": true,
"translation": {
"label": {
"textType": "LABEL",
"translation": {}
}
},
"target": "Shipment.EstimatedArrival",
"cardinality": {
"max": "*"
},
"i18nKey": "EL_Arrival_estimatedArrival_LABEL",
"isFromCoreModel": false,
"key": false,
"localized": false,
"required": false,
"context": "Shipment"
},
{
"name": "orderId",
"label": "Order ID",
"type": "string",
"readable": true,
"writable": true,
"translation": {
"label": {
"textType": "LABEL",
"translation": {}
}
},
"length": 20,
"i18nKey": "EL_Arrival_orderId_LABEL",
"isFromCoreModel": false,
"key": false,
"localized": false,
"required": false,

60
"context": "Shipment"
},
{
"name": "id",
"label": "ID",
"type": "uuid",
"context": "CoreModel",
"key": true,
"required": true,
"localized": false,
"readable": true,
"writable": false,
"i18nKey": "EL_Event_id_LABEL",
"isFromCoreModel": true
},
{
"name": "subaccountId",
"label": "Subaccount ID",
"type": "uuid",
"context": "CoreModel",
"key": false,
"required": false,
"localized": false,
"readable": true,
"writable": false,
"i18nKey": "EL_Event_subaccountId_LABEL",
"isFromCoreModel": true
},
{
"name": "cloneInstanceId",
"label": "Clone Instance ID",
"type": "uuid",
"context": "CoreModel",
"key": false,
"required": false,
"localized": false,
"readable": true,
"writable": false,
"i18nKey": "EL_Event_cloneInstanceId_LABEL",
"isFromCoreModel": true
},
{
"name": "modelNamespace",
"label": "Model Namespace",
"type": "string",
"context": "CoreModel",
"key": false,
"required": false,
"localized": false,
"readable": true,
"writable": false,
"length": 255,
"i18nKey": "EL_Event_modelNamespace_LABEL",

61
"isFromCoreModel": true
},
{
"name": "eventType",
"label": "Event Type",
"type": "string",
"context": "CoreModel",
"key": false,
"required": false,
"localized": false,
"readable": true,
"writable": false,
"length": 255,
"i18nKey": "EL_Event_eventType_LABEL",
"isFromCoreModel": true
},
{
"name": "eventReasonText",
"label": "Event Reason Text",
"type": "string",
"context": "CoreModel",
"key": false,
"required": false,
"localized": false,
"readable": true,
"writable": true,
"length": 255,
"i18nKey": "EL_Event_eventReasonText_LABEL",
"isFromCoreModel": true
},
{
"name": "eventReasonCode",
"label": "Event Reason Code",
"type": "string",
"context": "CoreModel",
"key": false,
"required": false,
"localized": false,
"readable": true,
"writable": true,
"length": 255,
"i18nKey": "EL_Event_eventReasonCode_LABEL",
"isFromCoreModel": true
}
],
"parent": {
"target": "CoreModel.Event"
},
"relatedEntities": {
"Shipment.EstimatedArrival": {
"elements": [
{
"name": "estimatedArrivalTime",

62
"label": "Estimated Arrival Time",
"type": "timestamp",
"readable": true,
"writable": true,
"i18nKey": "EL_EstimatedArrival_estimatedArrivalTime_LABEL",
"isFromCoreModel": false,
"key": false,
"localized": false,
"required": false,
"context": "Shipment"
},
{
"name": "estimatedArrivalTimeZone",
"label": "Estimated Arrival Timezone",
"type": "string",
"readable": true,
"writable": true,
"length": 50,
"i18nKey": "EL_EstimatedArrival_estimatedArrivalTimeZone_LABEL",
"isFromCoreModel": false,
"key": false,
"localized": false,
"required": false,
"context": "Shipment"
},
{
"name": "stopId",
"label": "Stop Id",
"type": "string",
"readable": true,
"writable": true,
"key": true,
"length": 255,
"i18nKey": "EL_EstimatedArrival_stopId_LABEL",
"isFromCoreModel": false,
"localized": false,
"required": true,
"context": "Shipment"
},
{
"name": "locationId",
"label": "Location Id",
"type": "string",
"readable": true,
"writable": true,
"length": 255,
"i18nKey": "EL_EstimatedArrival_locationId_LABEL",
"isFromCoreModel": false,
"key": false,
"localized": false,
"required": false,
"context": "Shipment"
}

63
]
}
}
}

64
e) Get All Process Types

Request

Request URI
https://<server address>[:port]/api/metadata/external/v1/process-types

Request URI Example


https://<server address>[:port]/api/metadata/external/v1/process-types

HTTP Method Get

Request Body The request body is empty.

Response

Response Body

Response Body Example

{
"value": [
{
"processTypeName": "com.gttsampleso01.gtt.app.bootcampdemo1.Resource.Resource",
"abbrProcessTypeName": "Resource",
"lastChangedAt": 1604472857682,
"modelNamespace": "com.gttsampleso01.gtt.app.bootcampdemo1",
"description": "Track Resource"
},
{
"processTypeName": "com.gttsampleso01.gtt.app.bootcampdemo1.Shipment.Shipment",
"abbrProcessTypeName": "Shipment",
"lastChangedAt": 1604472857682,
"modelNamespace": "com.gttsampleso01.gtt.app.bootcampdemo1",
"description": "Track Shipment"
}
]
}

f) Notes

When a model is deployed, metadata needs 15 minutes to clear the cache. New changes will take
effect thereafter.

65
APPENDIX: IDOC PREDEFINED PARAMETERS FOR VERSION 2

Object
Parameter Segment Write Service Mapping Field
[IDOC Basic Type]
Altkey:
xri://sap.com/id:party:system:
type:id
- “xri://sap.com/id” is
fixed
- party: get from the
token’s tenant
- system: APPSYS
- Type: get from the
trackingIdType of
E1EHPAO Altkey
tracked process,
which is maintained in
the Tracked Process
header
- id: APPOBJID

For example: xri://sap.com/id:


LBN#10000001: D2OCLNT100:
OBP10_DELIV: 0080000020
Tracked
Process & TRACKING
/ ReferenceType
Planned - is fixed
Event Altkey:
Tracked
xri://sap.com/id:party:system:
Process
[EHPOST0 type:id
1, - “xri://sap.com/id” is
GTTMSG0 fixed
1] - party: get from the
token’s tenant
- system:
APPSYS/E1EHPTID- E1EHPTI
Altkey
AYPPSYS (Segment: D
E1EHPAO)
- type: TRXCOD References
- id: TRXID

For example: xri://sap.com/id:


LBN#10000001: D2OCLNT100:
OBP10_DELIV: 0080000020

START_DATE
TIMZON ValidFrom
END_DATE
TIMZON E1EHPTI ValidTo
ACTION: D
- S Set(Create) -> ‘ADD’ action
- C Change -> ‘ADD’

66
- D Delete -> ‘DELETE’
Default ‘ADD’
ACTUAL_BUSINESS_DATETIM actualBusinessTimestamp
E
ACTUAL_BUSINESS_TIMEZON actualBusinessTimeZone
E
ACTUAL_TECHNICAL_DATETI
ME
ACTUAL_TECHNICAL_TIMEZO actualTechnicalTimestamp
NE E1EHPCP
PARTITION_KEY_HINT /
PLANNED_EVENT_UPDATE_ST
RATEGY plannedEventUpdateStrategy
REPORTED_BY reportedBy
YN_SHP_HDR_DLV_NO
YN_SHP_HDR_DLV_NO_LOGSY Altkey
S
MILESTONE E1EHPEE eventType
Location Altkey:
xri://sap.com/id:party:system:
Location:object type:location
id
- “xri://sap.com/id” is
fixed
- party: get from the
token’s tenant
- system: get from the
IDOC header: sndprn E1EHPEE locationAltKey
- “Location” is fixed
- object type: LOCTYPE
- location id: LOCID1

For example:
Planned xri://sap.com/id:LBN#10002424
Event :Q8JCLNT774:Location:shippin
gPoint:4711

LOCID2 eventMatchKey
MILESTONENUM payloadSequence
MSG_EXP_DATETIME
MSG_EXP_TZONE plannedTechnicalTimestamp
MSG_ER_EXP_DTIME
MSG_EXP_TZONE plannedTechTsEarliest
MSG_LT_EXP_DTIME
E1EHPEE plannedTechTsLatest
MSG_EXP_TZONE
EVT_EXP_DATETIME plannedBusinessTimestamp
EVT_EXP_TZONE plannedBusinessTimeZone
EVT_ER_EXP_DTIME plannedBizTsEarliest
EVT_LT_EXP_DTIME
plannedBizTsLatest

67
SRCTX EventReasonText
E1EVMH
SRCID DR02
EventReasonCode

Actual Altkey:
Event xri://sap.com/id:party:system:
[EVMS type:id
TA02, - “xri://sap.com/id” is
GTTM (Common fixed
SG01] Code) - party: get from the
token’s tenant
- system: first read from
ORIGINAL_SRC_SYSTE
M (Segment:
E1EVMTI
E1EVMPAR), if there is Altkey
no such field in the D
payload; then read from
IDOC header: sndprn
- type: TRXCOD
- id: TRXID

For example: xri://sap.com/id:


LBN#10000001: Q8JCLNT774:
OBP10_DELIV: 0080000020

Location Altkey:
xri://sap.com/id:party:system:
Location:object type:location
id
- “xri://sap.com/id” is
fixed
- party: get from the
token’s tenant
- system: get from the E1EVMLI
locationAltKey
IDOC header: sndprn D
- “Location” is fixed
- object type: LOCCOD
Actual
Event (Common - location id: LOCID1
[EVMS Code)
TA02, For example: xri://sap.com/id:
GTTM LBN#10000001:Q8JCLNT774:L
SG01] ocation:shippingPoint:4711

LOCID2 E1EVMLI
eventMatchKey
D
MESSAGE_SOURCE_TYPE E1EVMPA
messageSourceType
R
TRACKING referenceType
/
- is fixed
Altkey:
AltKey
xri://sap.com/id:party:system: References
type:id

68
- “xri://sap.com/id” is
fixed
- party: get from the
token’s tenant
- system: APPSYS
- type: APPOBJTYPE; E1EVMRE
F02
get from the
trackingIdType of
tracked process,
which is maintained in
the Tracked Process
header
- id: APPOBJID

For example: xri://sap.com/id:


LBN#10000001: D2OCLNT100:
OBP10_DELIV: 0080000020

START_DATE

START_TIME validFrom

(Common TIMZON E1EVMRE


Code) F02
END_DATE

END_TIME validTo

TIMZON
Actual
ACTION:
Event
- A Active -> ‘ADD’
[EVMS action
TA02, - D Deactive-> ‘Delete’
GTTM Default ‘ADD’
SG01] EVTDAT
E1EVMH actualBusinessTimestamp
EVTTIM DR02

EVTZON actualBusinessTimeZone
ACTUAL_TECHNICAL_DATETI
ME
ACTUAL_TECHNICAL_TIMEZO actualTechnicalTimestamp
NE E1EVMPA
PARTITION_KEY_HINT R
/

REPORTED_BY reportedBy
PLANNED_EVENT_MILESTONE
or eventType
PLANNED_EVENT_CODE
PLANNED_EVENT_LOCID1
locationAltkey
or

69
GTT GTT PLANNED_LOCATION_ID
Standar Upda PLANNED_EVENT_LOCTYPE E1EVMPA
d Event tePla or R
nEve PLANNED_LOCATION_TYPE
nt PLANNED_EVENT_LOCID2 eventMatchKey
or
PLANNED_EVENT_MATCH_KEY
IS_FINAL_PLANNED_EVENT isFinalPlannedEvent
PLANNED_EVENT_MILESTONE
NUM
or payloadSequence
PLANNED_PAYLOAD_SEQUENC
E
PLANNED_EVENT_MSG_EXP_D
ATETIME
or plannedTechnicalTimestamp
PLANNED_TECHNICAL_TIMES
TAMP
PLANNED_EVENT_MSG_ER_EX
P_DTIME
plannedTechTsEarliest
or
PLANNED_TECH_TS_EARLIST
GTT
PLANNED_EVENT_MSG_LT_EX
Actual Upda P_DTIME
Event tePla plannedTechTsLatest
or
[EVMS nEve PLANNED_TECH_TS_LATEST E1EVMPA
TA02, nt PLANNED_EVENT_EVT_EXP_D R
GTTM ATETIME
SG01] or plannedBusinessTimestamp
PLANNED_BUSINESS_TIMEST
AMP
GTT PLANNED_EVENT_EVT_ER_EX
Standar P_DTIME
d Event plannedBizTsEarliest
or
PLANNED_BIZ_TS_EARLIST
PLANNED_EVENT_EVT_LT_EX
P_DTIME
plannedBizTsLatest
or
PLANNED_BIZ_TS_LATEST
PLANNED_EVENT_EVT_EXP_T
ZONE
or plannedBusinessTimeZone
PLANNED_BUSINESS_TIMEZO
NE
ACTION_CODE action_code
REF_PLANNED_EVENT_MILES
GTT TONE
eventType
Dela or
yedE REF_PLANNED_EVENT_CODE E1EVMPA
vent, REF_PLANNED_LOCID1 R
or
GTT REF_PLANNED_LOCATION_ID locationAltkey
OnTi REF_PLANNED_EVENT_LOCTY
PE

70
meE or
vent REF_PLANNED_LOCATION_TY
PE

REF_PLANNED_EVENT_LOCID
2
or eventMatchKey
REF_PLANNED_EVENT_MATCH
_KEY

71
72
www.sap.com/contactsap

© 2020 SAP SE or an SAP 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 or an SAP affiliate company.

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 or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP or its affiliated companies shall not be liable
for errors or omissions with respect to the materials. The only warranties for SAP or SAP affiliate company 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.

In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related presentation, or to develop or release any functionality
mentioned therein. This document, or any related presentation, and SAP SE’s or its affiliated companies’ strategy and possible future developments, products, and/or platform directions and functionality
are all subject to change and may be changed by SAP SE or its affiliated companies at any time for any reason without notice. The information in this document is not a commitment, promise, or legal
obligation to deliver any material, code, or functionality. All forward-looking statements are subject to various risks and uncertainties that could cause actual results to differ materially from expectations.
Readers are cautioned not to place undue reliance on these forward-looking statements, and they should not be relied upon in making purchasing decisions.

SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in Germany and other
countries. All other product and service names mentioned are the trademarks of their respective companies. See http://www.sap.com/corporate-en/legal/copyright/index.epx for additional trademark
information and notices.

You might also like