• Kevin

SAP EM Application Interface with SAP GTS

Having covered why SAP decided to integrate SAP GTS with SAP EM, this section discusses what objects are available in SAP GTS to integrate with SAP EM.


The SAP EM Application Interface (AI) is provided for SAP GTS as a basis plug-in called PI_BASIS. The standard BAdI interface is used to integrate with the SAP EM module. The details around those BAdI and BAPI calls will not be described here, but the details around the specifics behind the SAP GTS objects will be.


SAP GTS Related Objects


The following SAP GTS objects are enabled to trigger events to SAP EM using the provided SAP EM Application Interface (AI):

  • Customs documents: Compliance

  • Customs shipments

  • Presentation documents

  • Inbound customer delivery documents

  • Pre-declarations

  • Customs declaration

Changes to any of these documents can be configured, down to the field level, to trigger an event bound for SAP EM. Each SAP GTS implementation project should analyse what key fields are required for monitoring. These fields will be the triggers for events sent to SAP EM. These events will ultimately result in a status change to the related trade document providing visibility to this change to all with access to the SAP EM Web UI report.


Triggering SAP EM from SAP GTS documents


In order to trigger communication of an event to SAP EM for a particular SAP GTS document, the related document needs to be configured. The figure below shows how the SAP EM Business Process Type (BPT) with value “GTS_IMPORT” is entered in to the Customs Declaration document type (CULOIM).

Configuring Import Customs Declaration Document for SAP EM

Once this configuration is complete, the Field EMBPT, located in table /SAPSLL/CUHD, will start to show the value “GTS_IMPORT.” The values of these fields are for customs declaration documents of type “CULOIM.” The BAdI implementation /SAPSLL/EM_CUS_DOC_IMP validated by the filter object, shown in the figure below, will then pick it up and process it as a SAP EM relevant event message.

Filter Object for Export Declaration Document

SAP EM Integration Documents


For event management integration into GTS, SAP has provided two Business Process Types:

  • GTS_EXPORT to cover an export scenario

  • GTS_IMPORT to cover an import scenario

SAP GTS Business Process Types

Business Process Types (BPT)

A Business Process Type (BPT) is the classification of objects or processes in an Application System (in this case, SAP GTS) that are SAP EM relevant. The BPT has linked to it all the relevant tables and structures, containing the relevant data that describes the applicable object or process. For example, an Export Custom Clearance Document would contain data in the header structure that includes customs document number, name of the user that created the document, date and time that it was created, currency values, country of departure and destination, weight, quantity, incoterms and more.

GTS_EXPORT – Export Scenario

Enhancement Implementation (Export) - /SAPSLL/EM_CUS_DOC_EXP

If the project requires new fields or structures to be passed into the SAP EM AI, the suggestion is to create a custom implementation of this BAdI to implement enhanced ABAP code. In other words, when any of the above structures and corresponding fields do not fully meet specific requirements, customize a BAdI implementation to retrieve the additional fields so that they can be used within the SAP EM AI in a standard manner.

This BAdI has a filter EMBPT (table /SAPSLL/CUHD) that has to evaluate to TRUE before the BAdI implementation code is executed. In this instance, for the export BAdI implementation code to be executed, the Field EMBPT needs to contain the value 'GTS_EXPORT'.


GTS_IMPORT – Import Scenario

Enhancement Implementation (Import) - /SAPSLL/EM_CUS_DOC_IMP

If the project requires new fields or structures to be passed into the SAP EM AI, SAP suggests creating a custom BAdI to implement with enhanced ABAP code.

Application Object Types (AOT)

Application Object Types are business objects that have the capability of being tracked in SAP EM. All the data that was populated in the BPT BAdI is available to use in the AOT configuration and development functions.

The AOTs have characteristics (parameters) that describe what the tracked object is all about. AOTs have events (Expected and Unexpected) that occur during its processing cycle. Tracking IDs are values that distinguish one AOT from another and are used by events to find the Event Handlers that they relate to. An AOT relates to an Event Handler (EH) in SAP EM. In SAP EM, the Event Handler holds the statuses for the business process and is determined by the events that are received (or not received) for a particular Event Handler.


For example, if a “CREATE” event is received for an Import Customs Declaration Document Event Handler, the status for the Event Handler will change to “Import Customs Declaration created.” If an event is then received that states “Customs on Hold,” the status will update accordingly to reflect this change. The import operations person is alerted that there is an issue that needs to be reviewed.


The following AOTs have been provided for in the SAP EM AI:

  • CUSTOMS_DOC: Export Scenario

  • CUSTOMS_DOC_IMP: Import Scenario

Note: If modifications are required, copy the AOTs that are provided and make the needed adjustments to the copied versions.

The details of each AOT are described below:


CUSTOMS_DOC – Export Scenario

  • Related BPT: GTS_EXPORT

  • Main Object: CUSTOMS_DOC_HEADER_NEW – one Event Handler created per customs document

  • Unique Application Object ID (AOID): Customs Document GUID

  • Tracking ID Extractor function module /SAPSLL/EM_AI_CUS_DOC_TID extracts the following Tracking IDs: CUS_DOCNO: Customs Document Number, CUS_GUID: Customs Document GUID, SALES_NO: Sales Order Number (if applicable), DLNR: Delivery Number (If applicable), TR_NBR: Transportation Order Number (if applicable)

  • Control Parameter Extractor Function module /SAPSLL/EM_AI_CUS_DOC_CNTRL extracts the following parameters: Document Type, Email address of last user to make a change

  • Info Parameter Extractor Function module /SAPSLL/EM_AI_CUS_DOC_INFO extracts the following parameters: Document Type

  • Expected Event Extractor Function module /SAPSLL/EM_AI_CUS_DOC_EE extracts the following expected events: GTS_ED_SENT: Export Declaration Sent, GTS_EXP_ACC: Export Accepted, GTS_EXP_REL: Export Released, GTS_EXP_EXIT: Export Exit

CUSTOMS_DOC_IMP – Import Scenario

  • Related BPT: GTS_IMPORT

  • Main Object: CUSTOMS_DOC_HEADER_NEW – one Event Handler created per customs document, Del. OBJ. Table: CUSTOMS_DOC_HEADER_OLD

  • Unique Application Object ID (AOID): Customs Document GUID

  • Tracking ID Extractor function module /SAPSLL/EM_AI_CUS_DOC_IMP_TID extracts the following Tracking IDs: CUS_DOCNO: Customs Document Number, CUS_GUID: Customs Document GUID, SALES_NO: Sales Order Number (If applicable), DLNR: Delivery Number (If applicable), TR_NBR: Transportation Order Number (If applicable)

  • Control Parameter Extractor function module /SAPSLL/EM_AI_CUS_DOC_IMP_CNTR extracts the following parameters: Document Type, Email address of last changer

  • Info Parameter Extractor function module /SAPSLL/EM_AI_CUS_DOC_IMP_INFO extracts the following parameters: Document Type

  • Expected Event Extractor function module /SAPSLL/EM_AI_CUS_DOC_IMP_EE extracts the following expected events: GTS_ID_ACC: Import accepted, GTS_ID_CR: Import Declaration Created, GTS_ID_SENT: Import Declaration Sent, GTS_IMP_REL: Import Authorized

Note: In order to bring real value to a GTS solution integrated with SAP EM, additional attributes would need to be added to SAP EM. These attributes would permit querying and displaying these values independently of doing it through GTS system. Fields that would be good to include for a customs clearance document are: customs document number, name of the user that created the document, date and time that it was created, currency values, country of departure and destination, weight, quantity, incoterms, etc.

Event Types (ET)

An event type is used to bundle code in the SAP EM AI that evaluates whether an event needs to be raised (i.e., a status change to a document has been detected). If the event needs to be raised, the event type is used to extract the needed event data to send to the SAP EM system.


To correctly interpret the Event Type details below, follow these simple guidelines for the format:


Event: <Name of the event type> — what event is sent to SAP EM

  • Event Relevance: This function module contains the code to determine uder what condition the event is to be triggered. If it is TRUE that the event should indeed be triggered, then continue to the event extractor, otherwise halt any further processing and do not send any event to SAP EM.

  • Event Extractor: This function module contains the code to extract the data from the GTS system to send to the SAP EM system in the form of a SAP EM event message.

Note: The SAP EM system is “dumb” in that it knows nothing about GTS or the documents that it handles. The system has to be given all of the details about the document and event that has been changed in order for SAP EM to be able to react accordingly and display the relevant details to other interested parties

Import Scenario

The related BPT is BPT: GTS_IMPORT.

  • Event: GTS_ID_ACC – Import customs declaration received. Event Relevance: /SAPSLL/EM_AI_ID_ACC_MSG_REL Event Extractor: /SAPSLL/EM_AI_EV_MSG_ID_ACC

  • Event: GTS_ID_CR – Import customs declaration created Event Relevance: /SAPSLL/EM_AI_ID_CR_MSG_REL Event Extractor: /SAPSLL/EM_AI_EV_MSG_ID_CR

  • Event: GTS_ID_SENT – Import customs declaration sent Event Relevance: /SAPSLL/EM_AI_ID_SEND_MSG_REL Event Extractor: /SAPSLL/EM_AI_EV_MSG_ID_SENT

  • Event: GTS_IMP_REL – Import customs declaration released Event Relevance: /SAPSLL/EM_AI_ID_REL_MSG_REL Event Extractor: /SAPSLL/EM_AI_EV_MSG_IMP_REL

Export Scenario

The related BPT is GTS_EXPORT.

  • Event: GTS_ED_SENT – Customs export declaration sent Event Relevance: /SAPSLL/EM_AI_ED_SEND_MSG_REL Event Extractor: /SAPSLL/EM_AI_EV_MSG_ED_SENT

  • Event: GTS_EXP_ACC – Customs export declaration received Event Relevance: /SAPSLL/EM_AI_ED_ACC_MSG_REL Event Extractor: /SAPSLL/EM_AI_EV_MSG_ED_ACC

  • Event: GTS_EXP_CANC – Customs export declaration cancelled Event Relevance: /SAPSLL/EM_AI_ED_CANC_MSG_REL Event Extractor: /SAPSLL/EM_AI_EV_MSG_ED_CANC

  • Event: GTS_EXP_EXIT – Export executed Event Relevance: /SAPSLL/EM_AI_ED_EXIT_MSG_REL Event Extractor: /SAPSLL/EM_AI_EV_MSG_ED_EXIT

  • Event: GTS_EXP_REL – Customs export declaration released Event Relevance: /SAPSLL/EM_AI_ED_ACC_MSG_REL Event Extractor: /SAPSLL/EM_AI_EV_MSG_ED_REL

121 views

© 2020 by ERPGenie. All Rights Reserved