See how to enhance the SAP Transportation Management XML structure so that the shipment container number is included at the header level and then passed along to SAP ERP Central Component. This applies when SAP Process Integration is used as the middleware.
Key Concept
In SAP Transportation Management a container is a device that holds a material or package. It is an article of transport equipment that is specially designed for the carriage of goods. In the transportation industry 20-foot and 40-foot containers are generally used as per the International Organization for Standardization norm.
While working for a leading transportation company, I encountered this requirement: My customer wanted to have the container ID at the header level, which is not possible in standard SAP. The customer also wanted the vendor invoice verification to be used on the container number. This is reflected in the reference field in both the service purchase order (PO) and the service entry sheet.
In any ocean transportation scenario, the container type and ID play a very important part. When you check a forwarding order, you always assign the container type, item type, or equipment type at the item level. However, the scenario I am going to describe involves enhancements to move the ID to the header level. An ID at the header level applies to the item levels below it, saving considerable time.
This client wanted to have the freight settlement document request in SAP Transportation Management (SAP TM) transferred to SAP ERP Central Component (SAP ECC) via SAP Process Integration (SAP PI). In the blueprinting phase I determined that the container number, which is maintained in the forwarding order, must be available as a reference in SAP ECC transaction code MIRO. The same details should be visible in the header tab in the forwarding order itself.
To implement the process to meet these requirements, you take the following steps:
- Create a custom tab in the forwarding order (FWO) in the SAP TM system. This tab is in the header and contains the container ID. Maintain other settings so that there is synchronization in the vendor payment between SAP TM and SAP ECC.
- Enhance the standard Web services in the SAP middleware interface in SAP PI to involve the new custom tab from FWO. This enables the XML message generation that contains the required information.
- Configure settings in SAP ECC that pave the way for the vendor invoice posted against the relevant information.
Specific examples show the various enhancements I had to make to the XML structure to generate a corresponding message in SAP ECC. I also highlight the configuration settings needed to create a PO and service entry sheet in the background. First I provide some basic details.
Business Requirement Details
During the blueprinting session, the business required that the enhancement be based on the three-way match functionality in SAP ECC. That is, the quantities maintained in the service PO and the corresponding service entry sheet should match the vendor invoice. That meant that I needed to capture the container number for any ocean scenario from the SAP TM system and then update the same in the service PO or service entry sheet in the SAP ECC system, to match the vendor invoice.
The enhancement was required to capture the container number in the Your Reference field in the PO (i.e., table EKKO and field IHREZ) via the use of the Web service, as shown in Figure 1.

Figure 1
Your Reference field in the PO creation screen
Figure 2
Figure 2
Reference field in the Accept. Data tab
When you create and save a forwarding order, freight units are created. In a full load container (FCL) scenario specific to the transportation industry, 1 freight unit = 1 container when you select the item type as container. To illustrate, if an FCL transport contains three containers for sending materials from shipper A to consignee B, the forwarding order is created with three line items with one container each with specific dimensions (Figure 3).

Figure 3
A forwarding order with three line items with one container each
Now going back to the original business requirement, my solution was to create a separate custom tab at the header level in the forwarding order. The tab incorporates the container ID at the header level only. At the point of consolidation and deconsolidation during the port of arrival and discharge, the vendor invoice in SAP ECC is posted based on the information captured in the forwarding order. I now show you how to create the tab and explain how the data flow takes place between SAP TM and SAP ECC via a Web service using SAP PI.
Process Flow
The SAP TM process is initiated by the creation of a forwarding order in SAP TM. When the forwarding order is saved in the system the charges are calculated. The charges are calculated based on the various charge types, which are beyond the scope of this article. In brief, for every charge that is based on the invoicing you need to create charge types, rate tables, and scales. You ultimately capture all the above data in a charge calculation sheet that is abbreviated as TCCS in SAP TM.
Based on the TCCS, the charge calculations are performed in SAP TM. After the charges are determined in FWO, the document needs to be confirmed. An SAP TM process has various stage types. The main carriage process is the stage in which the main mode of transport is specified, such as ocean. The stage before a main carriage is pre-carriage process. You need to create a freight order for those various stages. It’s here that you specify the carrier or vendor along with the purchasing organization in the freight order.
You can have separate TCCSs for each stage in the forwarding order. Based on the services provided by the carrier or vendor the charges are determined in the freight order. Then as a follow-up action from the freight order you create a freight settlement document. This freight settlement document is the draft invoice in SAP TM. In the freight settlement document you click the Save and Transfer button (Figure 4). The service is then called in SAP PI, which actually creates the service PO and the service entry sheet in SAP ECC.

Figure 4
Create a service PO in SAP ECC
Step 1. SAP TM Settings
You first need to create a custom tab for the header where the container ID appears. For any business object, you need to identify where the custom tab is required, and whether it is a forwarding order, a freight unit, or a freight order. In the SAP TM system, you execute transaction code /N/BOBF/CONF_UI to have a complete view of the various business process objects and their corresponding data structure and tables.
However, in my example of an enhancement in the structure, you start the BOBF Enhancement Workbench using transaction code /BOBF/CUST_UI, as shown in Figure 5. It shows the list of enhancement objects that already exist as well as the standard objects that you can enhance. The top text bubble indicates the description of various business objects and the second one indicates the name of the technical object for which the description has been provided by the first arrow.

Figure 5
Existing enhancement objects
You need to append the field in the extension include. Every structure has associated fields, and for any technical enhancement the structure needs to be enhanced with the new technical field. Unless this is done the new technical field is not included in the service. Therefore you append the structure name /SCMTMS/INCL_EEW_TOR_ROOT as shown in Figure 6. To get to Figure 6, double-click the object /SCMTMS/TOR in Figure 5.

Figure 6
Standard extension included in ABAP code for business object /SCMTMS/TOR
Double-click the Extension Include field in Figure 6 to go to Figure 7. You then append the Z structure name ZEEW_FOR_CUST_TAB.

Figure 7
Add the new field to the structure
Use transaction code SE84 and select the Web Dynpro component. This gives you the detail of the node user interface (UI) structure /SCMTMS/INCL_EEW_TOR_ROOT shown in Figure 8. You then append the Z structure ZEEW_FOR_CUST_TAB manually by adding it into the Component Name box. Next you maintain the Configuration ID by clicking it. Via the Technical details tab (not shown) you can find the configuration ID and save it after providing the relevant package name. You can check the details by using transaction code SE84.

Figure 8
Maintain the Configuration ID
Now when you proceed to any FWO document number, you can view the custom tab where, based on the specific ABAP code, the container ID field is populated.
Step 2. SAP PI Settings
You now need to use the SAP TM–SAP ECC? ERP invoice integration scenario in the Enterprise Services Repository. This is because you need to transfer the settlement document from SAP TM to SAP ECC to create an invoice verification process. You first set up a Remote Function Call (RFC) connection using transaction code BD54 (Figure 9). Specify the connection type as H as it is an ABAP-type connection. Specify the system where the SAP PI system needs to be interconnected. In my example it is SAP ECC as I specified that system in the Logon & Security tab.

Figure 9
Basis transaction displaying the system to which the connection needs to be set up
Next you populate the container ID in the XML structure generated from SAP PI. Identify the service initially using transaction code SPROXY to enter the Enterprise Service Repository shown in Figure 10. Select the Enterprise Services Browser option so that you can choose among the various services available.

Figure 10
View the available services
Click the proper service; in this case, TransportationOrderSCMExecutionRequest_Out, as shown in Figure 11.

Figure 11
Available services
Send the name of the service to your organization’s ABAP team to do the relevant coding. You can then view the field (i.e., the container ID in the enhanced XML structure) by using transaction code SPROXY. You can use the same transaction code to view it in the SAP PI system.
Step 3. SAP ECC Settings
Once the above settings are made you configure the necessary settings from the SAP ECC side. To do this, follow menu path SPRO > Integration with other SAP components > Transportation Management > Invoice Integration > Invoicing > Definition for transportation charge elements > Define category codes. The freight settlement process is triggered in SAP TM. To create a service PO automatically in the background in SAP ECC, you first need to define the various charge category codes so that the charge types can be assigned to such codes. This is required as every cost center-accounted PO has some specific GL accounts to which costs can be posted. For the cost to be debited or credited, the category code needs to be in place for the system to identify it so that the cost can be booked against the correct charge type.
The system automatically calculates the charge calculation related to the vendor invoice based on the defined category codes, which are then captured in a rate table. A rate table is included in the charge calculation sheet. Once the user saves the charge calculation sheet, the vendor invoice is calculated. For a charge calculation to be available, you need to create scales. The user manually inserts scales into the rate table, and the system compiles a rate table comprising various charges. The charges are ultimately captured in TCCS where charge calculation is done. For example, if ZBC is the base charge charged by vendor and its value is 100 rupees, then the vendor invoice is for 100 rupees. Let’s assume that the container charge related to this scenario is ZBC.
The subcategory code is the linkage between charge types and the category codes you defined above. ZBCA01, shown in Figure 12, is the prefix I am using for the subcategory codes. The difference between a category code and a charge type is that a charge type is the condition type based on which the charges are calculated, while a category code is the reference group within which all charge types are compiled together. All rates and values are maintained under a charge type only.

Figure 12
Define subcategory codes
You now assign the charge type code to a category code as shown in Figure 13.

Figure 13
The assignment between the charge type and category code
The next activity is to assign a service master record with a charge type and the category codes to the account assignment. Note that the vendor involved provides a type of service for transporting goods. The practice when you create a freight settlement document in SAP TM is always to monitor the freight service provided by the vendor. Therefore, you need to trigger a service PO after the creation of a service entry sheet. Follow menu path SPRO > Integration with Other SAP Components > Transportation Management > Invoice Integration > Invoicing > Assignment of transportation charge elements > Assign service master record and account assignment category. This takes you to Figure 14, where you maintain the linkage between category code, subcategory code, charge type, activity number, and account assignment.

Figure 14
Assignment of category code, subcategory code, charge type, and activity number in service master
You align the SAP TM organizational units with SAP ECC (i.e., you assign the purchasing business areas from SAP TM to the organizational units in purchasing in the SAP ECC system). Follow menu path SPRO > Integration with other SAP components > Transportation Management > Invoice Integration > Invoicing > Definition for transportation charge elements > Define category codes. Click the New Entries button and enter the category codes and description (Figure 15).

Figure 15
Assign category codes
Then follow menu path SPRO > Integration with other SAP components > Transportation Management > Invoice Integration > Invoicing > Mapping of organizational units > Assign organizational units for Purchasing. Enter the values for the Logical system, TM Pur. (purchasing) Organization, and TM Purchasing Group. Then enter the values for the SAP ECC Purchasing Org. (organization), Purch. Group, Plant, Company Code, Document Type, and Material Group (Figure 16).

Figure 16
Entries that needs to be maintained for assignment of TM org units to SAP ECC
Indrani Basak
Indrani Basak is a freelance SAP SCM consultant who has worked in various SCM projects in the areas of logistics, transportation management, and transportation planning. Indrani also has worked in implementation and support projects.
You may contact the author at .
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.