Upload XML File GTS
Upload XML File GTS
Applicable Releases:
GTS 7.2
Version 1
December 2008
Typographic Conventions
Icons
Type Style
Description
Icon
Example Text
Example text
Emphasized words or
phrases in body text, graphic
titles, and table titles
Example text
Example text
<Example
text>
EXAMPLE TEXT
Description
Caution
Note or Important
Example
Recommendation or Tip
Table of Contents
1.
2.
3.
Prerequisites....................................................................................................................2
4.
Step-by-Step Procedure..................................................................................................3
5.
4.1
4.2
4.3
Run the modification program to update the customs office identification number in
GTS..........................................................................................................................8
Appendix..........................................................................................................................9
1.
Business Scenario
The list of US Port Codes is a required master data in SAP Global Trade Services (GTS) Customs
Management and can be uploaded from an XML file. During upload, SAP GTS creates these port
codes as customs office business partners in the system. In the current release of GTS 7.2, the port
code (ex. 2809) in the XML file is used as both the external business partner number (if this option is
selected) and the office number of the customs office in GTS.
In some cases, existing business partners (ex. 2809 Vendor John Doe) in GTS may overlap with these
customs office numbers (ex. 2809 Port of San Francisco). Therefore, the upload of the XML file may
generate conflicts during the business partner creation for the customs offices.
This How-To guide provides a workaround to solve the issue while uploading the XML file of customs
offices. The goal is to create unique business partners for US customs offices (ex. US2809) and then
assign the appropriate port code (2809).
2.
Background Information
The list of US customs offices is published in the Schedule D from US Customs and Border
Protection (CBP). Each US customs office is identified with a unique 4-digit identification number in
Schedule D. In this guide, the XML file of US customs office is used to illustrate the procedure of the
workaround.
Here are the major steps of the workaround provided in this guide:
...
This guide is based on the SAP GTS 7.2 release. However, this approach can also be applied to other
SAP GTS releases.
The ABAP program in Appendix A is only a sample code for reference. Please modify it accordingly to
fit your system environment.
CAUTION
In GTS, if you have business partner external numbers in the format USxxxx where xxxx
is the 4-digit official US customs office identification number; you will run into the conflicts
that this workaround tries to solve. In this case, you need to modify the step 1 and step 3
accordingly. However, the approach remains the same.
3.
Prerequisites
Software
SAP GTS 7.2
The Compliance and Customs Management are working in your SAP GTS system.
Hardware
SAP GTS server
Required/recommended expertise or prior knowledge
Basic knowledge of SAP GTS
Basic knowledge of ABAP programming
Basic knowledge of XML.
4.
Step-by-Step Procedure
First of all, you need to get the XML file of US customs office from your data provider. The file from
CBP website is not in the XML format at the time this guide is written.
4.1
...
1. Open the XML file of the US customs offices with an editor, such as notepad.
2. Add two characters US in front of the 4-digit identification number for each customs office, as
shown in following.
Note
If you already have business partners with external numbers in the format USxxxx where
xxxx is the 4-digit official US customs office identification number; you can add other
characters instead, such as ABC. However, you will need to modify the ABAP program
in the Appendix of this guide accordingly.
3. Save and close the XML file.
4.2
...
2. Before the upload, check the existing information in GTS system for legal regulation ACE by
clicking on Maintain Customs Office Numbers.
3. Load the XML file by clicking on the Load Customs Offices from XML File in the Customs
Offices section.
4. Provide the information of Data Provider, Legal Regulation, and the full path of the XML file.
Tip
You might want to try the Simulation Mode first to make sure everything is correct
before the actual upload.
5. Click on Execution button and wait to see the message Tasks performed successfully in the
display log.
6. Click on the Save button to save the data in database.
7. Display the result of the upload by clicking on Maintain Customs Office Numbers in the
Customs Offices section (or transaction /SAPSLL/BP_MAIN_DNR).
8. Enter the legal regulation, and US* in the Business Partners selection field.
Notice the customs office identification number in the column OFN has the values in the format
USxxxx, where the xxxx is the customs office identification number. We need to remove the prefix
US created during the XML file upload to make it a 4-digit number as published by the CBP.
9. Check the business partner creation of the customs offices after the upload with transaction BP.
4.3
...
1. Create the modification program with the sample code in Appendix A as reference, by SE38.
Modify it accordingly to fit your system environment.
2. Activate and execute the program.
3. Verify the result by clicking on Maintain Customs Office Numbers in the Customs Offices
section (or transaction /SAPSLL/BP_MAIN_DNR). The column OFN should be only assigned
with the 4-digit official US customs office number.
5.
Appendix
This is only a sample code for reference. Please modify it according to your system environment.
Appendix A - ABAP program to remove the prefix for the customs office
numbers in GTS
*&---------------------------------------------------------------------*
*& Report Z_MODIFY_OFN
*&
*&---------------------------------------------------------------------*
*& The report removes the prefix for the customs office numbers,
*& for example from 'US5582' to '5582'.
*&
*&---------------------------------------------------------------------*
REPORT Z_MODIFY_OFN.
DATA: update_needed TYPE syst-input value ' '.
DATA: l_pinid
TYPE /SAPSLL/ADRLRID-pinid.
DATA: lt_adrlrid TYPE TABLE OF /SAPSLL/ADRLRID.
FIELD-SYMBOLS <ls_adrlrid> TYPE /sapsll/adrlrid.
SELECT *
FROM /sapsll/adrlrid
INTO TABLE lt_adrlrid
WHERE pinid like 'US%'.
IF sy-subrc = 0.
LOOP AT lt_adrlrid ASSIGNING <ls_adrlrid>.
l_pinid = <ls_adrlrid>-pinid.
SEARCH l_pinid for 'US*'.
IF SY-SUBRC = 0 and ( strlen( l_pinid ) = 6 ).
<ls_adrlrid>-pinid = l_pinid+2(4).
update_needed = 'X'.
ENDIF.
ENDLOOP.
IF update_needed = 'X'.
update /SAPSLL/ADRLRID from TABLE lt_adrlrid.
IF sy-subrc = 0.
WRITE: 'The table of customs offices is updated successfully.'."#EC NOTEXT
ELSE.
WRITE: 'Table update failed.'.
"#EC NOTEXT
ENDIF.
ENDIF.
ELSE.
WRITE: 'There is no record to be updated. Everything is OK.'."#EC NOTEXT
ENDIF.