One day or other you might get a chance to integrate GS1 systems.
That day shouldn’t be challenging for you :smile: .
This Blog describes as how to exchange/create GS1 understandable messages which will let PI [7.1] to post the GS1 understandable documents and the sample use case for developing the same.
It is much painful at the initial stage to find the correct way of integrating GS1 systems via SAP PI and there is no proper SDN blog or discussions available for the same.
Hence I have shared this information based on my project learning.
It doesn’t contain any step by step for deployment or development and It describes the how to frame/create/Build the Main GS1 Document XML schema using the available GS1 standard sub schema.
It is for Intermediate PI Consultants.
Hints /Prerequisites:
GS1 XML Business Message Standards (BMS)
GS1 Main XML message consisting of multiple segments/Layers like
GS1 XML Business Message Architecture
Basically we need to generate the xml in the above consolidated segments which will let us to post GS1 documents successfully.
Sample Use case
Our requirement is to post the Pricing (Add/Update) document to GS1 from ECC via PI.
This is designed as simple Asynchronous Proxy to File scenario.
Initial Steps
In order to build/frame the GS1 - XML Business Message Architecture based XML output we have to follow the following steps
Step 1:
Here I have used V2.8 of GS1- BMS
Once you have downloaded the schemas , unzip it and keep in your local desktop.
The folder structure would be as follows
For e.g.,
PriceSynchronisationDocument schema is under the folder path as ean.ucc\gdsn
Step 2:
We may not directly use / import in XI to use as external definition which we have downloaded in earlier step.
We need to adjust\Edit the external definition as follows
Once you have extracted relevant schemas (.xsd) , please open the xsd and check check any relative paths specified as../../. in the xsd:import - schemaLocation.
Remove the relative paths and save.
Note :
You need to check all the schemas before you upload to XI System. Make sure that it has the proper folder path.
Sample :
<xsd:import namespace="urn:ean.ucc:2" schemaLocation="../../ean.ucc/common/Document.xsd"/>
After correction it would be looking like as follows
Note :
Simple xsd import statement ../../ string replacing it's not sufficient , once we have imported the provided standard schemas, we need to find out the issues in imported external definition ,manually edit and re-import the error-schema and dependent schema . It is applicable wherever you find issue in schema (red lines in External definition ).
Steps to be Performed in ESR
Importing external Definitions
Once you have removed all the relative paths in standard GS1 Schemas, upload all the XSD using import external definition option from ESR.
In PI 7.1 we have the option to do the mass upload of external definition
Steps to be performed in XML editing tool
Step 1 :
Open the sample output xml whihc you have received from the GS1 team for the relevant Business Document
Sample would be as follows
It has all the GS1 BMS components as mentioned above.
Step 2 : Open the sample GS1 xml using XML tool
Once you import this xml, it will try to load all the corresponding linked schema for validation
Once it got successfully loaded , please click on the infer XSD Schema
It will pop up and ask you as where to store the generated schema
Select the required folder path and click on finish.
Basically it will generate 4 schemas using the sample xml file as follows
If you open the First Schema in XML tool, in this example it is GS_Example_ADD0
You can see the schema layout as follows
Now we need to adjust the schema location to actual file path .
Open GS_Example_ADD1 and change the import schema location as follows
<xs:import schemaLocation="ean.ucc/common/DocumentCommand.xsd" />
<xs:import schemaLocation="ean.ucc/common/Message.xsd" />
Open GS_Example_ADD2 and change the import schema location as follows
<xs:import schemaLocation="schemapath/GS_Example_ADD1" namespace="urn:ean.ucc:2" />
<xs:import schemaLocation="ean.ucc/gdsn/PriceSynchronisationDocument.xsd" namespace="urn:ean.ucc:gdsn:2" />
Open GS_Example_ADD3 and change the import schema location as follows
<xs:import schemaLocation=" schemapath /GS_Example_ADD2.xsd" />
Create a folder and zip all the above files. We will call this as “Architecture Schema”.
We have to import this to ESR once you have imported all the standard schemas which you have downloaded in earlier step.
Note :
schemapath - this is the folder name in which you have zipped the schemas and upload to XI.
E.g,
In below example Source filed value ean.ucc/gdsn is theschemapath
This Covers the following
In next blog we are going to see how to use this in ESR to generate the expected GS1 Business Document XML.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
9 | |
7 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |