In this blog post, I will show a simple scenario using B2B integration advisor.
Check this blog post for initial context: Beginner's Guide to EDI Integration
To have understanding of overall features, check out this blog post: Overview of components in Integration Advisor
In this demo scenario, incoming EDI 850 is converted to custom sales order message.
The below is the sample input EDI 850. Please note, the below EDI does not represent/contain production data. It is fake data.
ISA*00* *00* *ZZ*AB01000000001 *ZZ*CD01000000002 *030415*1314*U*00401*000601830*1*T*>~
GS*PO*AB01000000001*CD01000000002*20030415*1314*000341219*X*004010~
ST*850*0001~
BEG*00*DS*HW20240312**20220921*0332014937~
CUR*BY*USD~
REF*CO*0232014937~
REF*EU*2244460-DKM-0922~
PER*BD*HWPROCUREMENT3*TE*630-295-7512~
PER*IC*STEVE SMITH*TE*789-213-4444*EM*steve.smith@cao.com~
FOB*DE~
DTM*002*20220920~
TD5**2*FDE4**FedEx Ground*******CG~
N1*BT*INSIGHT DIRECT USA, INC.~
PER*AP*ORDER FLOW TEAM*TE*480-333-3000*EM*LICENSING@INSIGHT.COM~
N1*ST*Park Place Corporate Office*92*0021793569~
N2*Tayrum Steve MITCHELL~
N3*3533330 PHELPS DR~
N4*IRVING*TX*750386507*US~
PER*IC*Dayrum Keith MITCHELL*TE*2149959713~
PO1*00010*6*EA*228.41*CP*BP*DDDDELL-P22D22H*VP*9FDDDDDZ828~
CTT*1~
SE*20*0001~
ST*850*0002~
BEG*00*DS*LC20240312**20220922*0332024801~
CUR*BY*USD~
REF*CO*0332424801~
REF*EU*450176628677~
PER*BD*Licensing 7*TE*567-222-5698*FX*480-760-6126~
FOB*DE~
CSH*BK~
DTM*002*20220921~
TD5**2*UPSS**UPS Ground*******CG~
N1*BT*INSIGHT DIRECT USA, INC.~
PER*AP*ORDER FLOW TEAM*TE*480-333-3000*EM*LICENSING@INSIGHT.COM~
N1*ST*Sam Andersen*92*0010395441~
N3*3457 DASON AVE~
N4*DOCATELLO*ID*832042037*US~
PER*IC*STEVE SMITH*TE*847-402-5000~
PO1*00010*1*EA*433.67*CP*BP*ESD-DDD809A-G00-15.0*VP*6DDDTP459~
PO1*00020*1*EA*433.67*CP*BP*ESD-DDD809A-F00-15.0*VP*6EDDTP459~
PER*FF*JILL CARTER*TE*687-402-4247*EM*JCARTER@ALLSTATE.COM~
DTM*092*20220921~
DTM*093*20230921~
CTT*2~
SE*23*0002~
GE*2*000341219~
IEA*1*000601830~
Each ST segment will create one target SalesOrder structure.
As in the sample data, it has 2 ST-SE segment pair, it will generate 2 message for target.
Expected output for 1st ST segment:
<?xml version="1.0" encoding="UTF-8"?>
<POEnvelope>
<EDIHeader>
<SenderID>AB01000000001 </SenderID>
<ISAControlNum>000601830</ISAControlNum>
<GrpControlNum>000341219</GrpControlNum>
<TxnCntrlNum>0001</TxnCntrlNum>
</EDIHeader>
<PO>
<Header>
<PONum>HW20240312</PONum>
<PODate>2022-09-21</PODate>
<POType>Original</POType>
<CustomerOrderNum/>
<EndUserOrderNum/>
<RequestedDate>2022-09-20</RequestedDate>
<ShipTo>
<Name>Park Place Corporate Office</Name>
<Address>IRVING,TX,750386507,US</Address>
</ShipTo>
<BillTo>
<Name>INSIGHT DIRECT USA, INC.</Name>
</BillTo>
<BuyerInfo>
<Department>HWPROCUREMENT3</Department>
<Telephone>630-295-7512</Telephone>
</BuyerInfo>
<ContactInfo>
<Department>STEVE SMITH</Department>
<Telephone>789-213-4444</Telephone>
<Email>steve.smith@cao.com</Email>
</ContactInfo>
</Header>
<Items>
<Item pos="1">
<ItemNum>00010</ItemNum>
<Quantity>6</Quantity>
<UoM>EA</UoM>
<BuyerPartNo>DDDDELL-P22D22H</BuyerPartNo>
<SellerPartNo>9FDDDDDZ828</SellerPartNo>
</Item>
</Items>
</PO>
</POEnvelope>
For 2nd ST segment,
<?xml version="1.0" encoding="UTF-8"?>
<POEnvelope>
<EDIHeader>
<SenderID>AB01000000001 </SenderID>
<ISAControlNum>000601830</ISAControlNum>
<GrpControlNum>000341219</GrpControlNum>
<TxnCntrlNum>0002</TxnCntrlNum>
</EDIHeader>
<PO>
<Header>
<PONum>LC20240312</PONum>
<PODate>2022-09-22</PODate>
<POType>Original</POType>
<CustomerOrderNum/>
<EndUserOrderNum/>
<RequestedDate>2022-09-21</RequestedDate>
<ShipTo>
<Name>Sam Andersen</Name>
<Address>DOCATELLO,ID,832042037,US</Address>
</ShipTo>
<BillTo>
<Name>INSIGHT DIRECT USA, INC.</Name>
</BillTo>
<BuyerInfo>
<Department>Licensing 7</Department>
<Telephone>567-222-5698</Telephone>
<Fax>480-760-6126</Fax>
</BuyerInfo>
</Header>
<Items>
<Item pos="1">
<ItemNum>00010</ItemNum>
<Quantity>1</Quantity>
<UoM>EA</UoM>
<BuyerPartNo>ESD-DDD809A-G00-15.0</BuyerPartNo>
<SellerPartNo>6DDDTP459</SellerPartNo>
</Item>
<Item pos="2">
<ItemNum>00020</ItemNum>
<Quantity>1</Quantity>
<UoM>EA</UoM>
<BuyerPartNo>ESD-DDD809A-F00-15.0</BuyerPartNo>
<SellerPartNo>6EDDTP459</SellerPartNo>
</Item>
</Items>
</PO>
</POEnvelope>
Create MIG (Message Implementation Guideline) for source message. Use 'Get Proposal' option to get proposals.
Based on the requirement, the nodes are qualified, for example, N1 segment - one is for Bill-To Party, another one is for Ship-To Party.
Target system can only accept PO number as max length of 20 chars. Also, PO number will either start with HW or LC. The below checks are applied.
Another example is it allows to set status. If we want some fields to be further validated by reviewer, mark those status as 'For review'.
Here, only the below currency codes are selected from standard ISO code list.
Create Custom Message for target custom PO message structure.
Then create MIG based for the create custom message.
In target side, we want PO Date to be in format 'YYYY-MM-DD'.
Create a MIG Code list.
And assign this codelist to 'POType' in Target MIG.
Create MAG for mapping source to target. As custom message is used at target, proposal will not give any results.
SenderID, ISAControlNum and GrpControlNum are assigned to arbitrary constant values, which later will be changed in iflow.
For POType, code value mapping is used. The criteria to use code value mapping is both source and target field (leaf nodes) should be assigned to a codelist.
I
Address should be like - City Name,State or Province Code,Postal Code,Country Code
To get position,
Download the cloud integration runtime artifacts or use 'Inject' functionality.
For flow design, refer to standard template 'EDI Integration Templates for SAP Integration Advisor'.
The below is the custom iflow for this scenario.
Input EDI 850 message
It will split the incoming message based on based on number of ST segments. Also, it can be used to auto generate acknowledgement.
Validate Message option checks if it the EDI document is valid. For example, if SE01 contains incorrect count, it will send a negative acknowledgement and stop the processing.
For example, if 2nd SE02 contains incorrect count, all ST segments are rejected as Transaction mode is 'Interchange'.
Now, if we change Transaction mode to 'Message', 1st one will be accepted and 2nd one will be rejected.
Create Acknowledgement is based on 'Check EDI Envelop' i.e, ISA14. As ISA14 value is 1, the EDI 997 message is generated.
For Interchange number in EDI 997, Number Range is used.
The next value will be using for the incoming unique message (determined based on ISA13). If the message is duplicate, the same value will be used in EDI 997.
The output of EDI Splitter as per current configuration, 2 EDI 850 message and 1 EDI 997 message.
For EDI 997, standard header 'EDI_ACKNOWLEDGEMENT' value is true.
The below headers are generated due to EDI Splitter step.
<?xml version="1.0" encoding="ISO-8859-1"?><ns0:Interchange xmlns:ns0="urn:sap.com:typesystem:b2b:116:asc-x12:004010">
<S_ISA>
<D_I01>00</D_I01>
<D_I02> </D_I02>
<D_I03>00</D_I03>
<D_I04> </D_I04>
<D_I05_1>ZZ</D_I05_1>
<D_I06>AB01000000001 </D_I06>
<D_I05_2>ZZ</D_I05_2>
<D_I07>CD01000000002 </D_I07>
<D_I08>030415</D_I08>
<D_I09>1314</D_I09>
<D_I10>U</D_I10>
<D_I11>00401</D_I11>
<D_I12>000601831</D_I12>
<D_I13>1</D_I13>
<D_I14>T</D_I14>
<D_I15>></D_I15>
</S_ISA>
<FunctionalGroup>
<S_GS>
<D_479>PO</D_479>
<D_142>AB01000000001</D_142>
<D_124>CD01000000002</D_124>
<D_373>20030415</D_373>
<D_337>1314</D_337>
<D_28>000341219</D_28>
<D_455>X</D_455>
<D_480>004010</D_480>
</S_GS>
<M_850>
<S_ST>
<D_143>850</D_143>
<D_329>0001</D_329>
</S_ST>
<S_BEG>
<D_353>00</D_353>
<D_92>DS</D_92>
<D_324>HW20240312</D_324>
<D_373>20220921</D_373>
<D_367>0332014937</D_367>
</S_BEG>
<S_CUR>
<D_98>BY</D_98>
<D_100>USD</D_100>
</S_CUR>
<S_REF>
<D_128>CO</D_128>
<D_127>0232014937</D_127>
</S_REF>
<S_REF>
<D_128>EU</D_128>
<D_127>2244460-DKM-0922</D_127>
</S_REF>
<S_PER>
<D_366>BD</D_366>
<D_93>HWPROCUREMENT3</D_93>
<D_365>TE</D_365>
<D_364>630-295-7512</D_364>
</S_PER>
<S_PER>
<D_366>IC</D_366>
<D_93>STEVE SMITH</D_93>
<D_365>TE</D_365>
<D_364>789-213-4444</D_364>
<D_365_2>EM</D_365_2>
<D_364_2>steve.smith@cao.com</D_364_2>
</S_PER>
<S_FOB>
<D_146>DE</D_146>
</S_FOB>
<S_DTM>
<D_374>002</D_374>
<D_373>20220920</D_373>
</S_DTM>
<S_TD5>
<D_66>2</D_66>
<D_67>FDE4</D_67>
<D_387>FedEx Ground</D_387>
<D_284>CG</D_284>
</S_TD5>
<G_N1>
<S_N1>
<D_98>BT</D_98>
<D_93>INSIGHT DIRECT USA, INC.</D_93>
</S_N1>
<S_PER>
<D_366>AP</D_366>
<D_93>ORDER FLOW TEAM</D_93>
<D_365>TE</D_365>
<D_364>480-333-3000</D_364>
<D_365_2>EM</D_365_2>
<D_364_2>LICENSING@INSIGHT.COM</D_364_2>
</S_PER>
</G_N1>
<G_N1>
<S_N1>
<D_98>ST</D_98>
<D_93>Park Place Corporate Office</D_93>
<D_66>92</D_66>
<D_67>0021793569</D_67>
</S_N1>
<S_N2>
<D_93>Tayrum Steve MITCHELL</D_93>
</S_N2>
<S_N3>
<D_166>3533330 PHELPS DR</D_166>
</S_N3>
<S_N4>
<D_19>IRVING</D_19>
<D_156>TX</D_156>
<D_116>750386507</D_116>
<D_26>US</D_26>
</S_N4>
<S_PER>
<D_366>IC</D_366>
<D_93>Dayrum Keith MITCHELL</D_93>
<D_365>TE</D_365>
<D_364>2149959713</D_364>
</S_PER>
</G_N1>
<G_PO1>
<S_PO1>
<D_350>00010</D_350>
<D_330>6</D_330>
<D_355>EA</D_355>
<D_212>228.41</D_212>
<D_639>CP</D_639>
<D_235>BP</D_235>
<D_234>DDDDELL-P22D22H</D_234>
<D_235_2>VP</D_235_2>
<D_234_2>9FDDDDDZ828</D_234_2>
</S_PO1>
</G_PO1>
<G_CTT>
<S_CTT>
<D_354>1</D_354>
</S_CTT>
</G_CTT>
<S_SE>
<D_96>20</D_96>
<D_329>0001</D_329>
</S_SE>
</M_850>
<S_GE>
<D_97>1</D_97>
<D_28>000341219</D_28>
</S_GE>
</FunctionalGroup>
<S_IEA>
<D_I16>1</D_I16>
<D_I12>000601831</D_I12>
</S_IEA>
</ns0:Interchange>
<?xml version="1.0" encoding="ISO-8859-1"?><ns0:Interchange xmlns:ns0="urn:sap.com:typesystem:b2b:116:asc-x12:004010">
<S_ISA>
<D_I01>00</D_I01>
<D_I02> </D_I02>
<D_I03>00</D_I03>
<D_I04> </D_I04>
<D_I05_1>ZZ</D_I05_1>
<D_I06>AB01000000001 </D_I06>
<D_I05_2>ZZ</D_I05_2>
<D_I07>CD01000000002 </D_I07>
<D_I08>030415</D_I08>
<D_I09>1314</D_I09>
<D_I10>U</D_I10>
<D_I11>00401</D_I11>
<D_I12>000601831</D_I12>
<D_I13>1</D_I13>
<D_I14>T</D_I14>
<D_I15>></D_I15>
</S_ISA>
<FunctionalGroup>
<S_GS>
<D_479>PO</D_479>
<D_142>AB01000000001</D_142>
<D_124>CD01000000002</D_124>
<D_373>20030415</D_373>
<D_337>1314</D_337>
<D_28>000341219</D_28>
<D_455>X</D_455>
<D_480>004010</D_480>
</S_GS>
<M_850>
<S_ST>
<D_143>850</D_143>
<D_329>0002</D_329>
</S_ST>
<S_BEG>
<D_353>00</D_353>
<D_92>DS</D_92>
<D_324>LC20240312</D_324>
<D_373>20220922</D_373>
<D_367>0332024801</D_367>
</S_BEG>
<S_CUR>
<D_98>BY</D_98>
<D_100>USD</D_100>
</S_CUR>
<S_REF>
<D_128>CO</D_128>
<D_127>0332424801</D_127>
</S_REF>
<S_REF>
<D_128>EU</D_128>
<D_127>450176628677</D_127>
</S_REF>
<S_PER>
<D_366>BD</D_366>
<D_93>Licensing 7</D_93>
<D_365>TE</D_365>
<D_364>567-222-5698</D_364>
<D_365_2>FX</D_365_2>
<D_364_2>480-760-6126</D_364_2>
</S_PER>
<S_FOB>
<D_146>DE</D_146>
</S_FOB>
<S_CSH>
<D_563>BK</D_563>
</S_CSH>
<S_DTM>
<D_374>002</D_374>
<D_373>20220921</D_373>
</S_DTM>
<S_TD5>
<D_66>2</D_66>
<D_67>UPSS</D_67>
<D_387>UPS Ground</D_387>
<D_284>CG</D_284>
</S_TD5>
<G_N1>
<S_N1>
<D_98>BT</D_98>
<D_93>INSIGHT DIRECT USA, INC.</D_93>
</S_N1>
<S_PER>
<D_366>AP</D_366>
<D_93>ORDER FLOW TEAM</D_93>
<D_365>TE</D_365>
<D_364>480-333-3000</D_364>
<D_365_2>EM</D_365_2>
<D_364_2>LICENSING@INSIGHT.COM</D_364_2>
</S_PER>
</G_N1>
<G_N1>
<S_N1>
<D_98>ST</D_98>
<D_93>Sam Andersen</D_93>
<D_66>92</D_66>
<D_67>0010395441</D_67>
</S_N1>
<S_N3>
<D_166>3457 DASON AVE</D_166>
</S_N3>
<S_N4>
<D_19>DOCATELLO</D_19>
<D_156>ID</D_156>
<D_116>832042037</D_116>
<D_26>US</D_26>
</S_N4>
<S_PER>
<D_366>IC</D_366>
<D_93>STEVE SMITH</D_93>
<D_365>TE</D_365>
<D_364>847-402-5000</D_364>
</S_PER>
</G_N1>
<G_PO1>
<S_PO1>
<D_350>00010</D_350>
<D_330>1</D_330>
<D_355>EA</D_355>
<D_212>433.67</D_212>
<D_639>CP</D_639>
<D_235>BP</D_235>
<D_234>ESD-DDD809A-G00-15.0</D_234>
<D_235_2>VP</D_235_2>
<D_234_2>6DDDTP459</D_234_2>
</S_PO1>
</G_PO1>
<G_PO1>
<S_PO1>
<D_350>00020</D_350>
<D_330>1</D_330>
<D_355>EA</D_355>
<D_212>433.67</D_212>
<D_639>CP</D_639>
<D_235>BP</D_235>
<D_234>ESD-DDD809A-F00-15.0</D_234>
<D_235_2>VP</D_235_2>
<D_234_2>6EDDTP459</D_234_2>
</S_PO1>
<S_PER>
<D_366>FF</D_366>
<D_93>JILL CARTER</D_93>
<D_365>TE</D_365>
<D_364>687-402-4247</D_364>
<D_365_2>EM</D_365_2>
<D_364_2>JCARTER@ALLSTATE.COM</D_364_2>
</S_PER>
<S_DTM>
<D_374>092</D_374>
<D_373>20220921</D_373>
</S_DTM>
<S_DTM>
<D_374>093</D_374>
<D_373>20230921</D_373>
</S_DTM>
</G_PO1>
<G_CTT>
<S_CTT>
<D_354>2</D_354>
</S_CTT>
</G_CTT>
<S_SE>
<D_96>23</D_96>
<D_329>0002</D_329>
</S_SE>
</M_850>
<S_GE>
<D_97>1</D_97>
<D_28>000341219</D_28>
</S_GE>
</FunctionalGroup>
<S_IEA>
<D_I16>1</D_I16>
<D_I12>000601831</D_I12>
</S_IEA>
</ns0:Interchange>
This step will add qualifier to the node names using preproc.xsl.
For example, If PO Number does not start with HW or LC, it will throw an error.
To convert source structure to target structure.
XSLT mapping to populate control number for reference in target message.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="#all">
<xsl:mode on-no-match="shallow-copy" />
<xsl:output method="xml" indent="yes" />
<xsl:param name="SAP_EDI_Interchange_Control_Number" as="xs:string" />
<xsl:param name="SAP_EDI_GS_Control_Number" as="xs:string" />
<xsl:param name="SAP_EDI_Sender_ID" as="xs:string" />
<xsl:param name="SAP_ST_Control_Number" as="xs:string" />
<xsl:template match="/POEnvelope/EDIHeader/SenderID">
<xsl:copy>
<xsl:value-of select="$SAP_EDI_Sender_ID" />
</xsl:copy>
</xsl:template>
<xsl:template match="/POEnvelope/EDIHeader/ISAControlNum">
<xsl:copy>
<xsl:value-of select="$SAP_EDI_Interchange_Control_Number" />
</xsl:copy>
</xsl:template>
<xsl:template match="/POEnvelope/EDIHeader/GrpControlNum">
<xsl:copy>
<xsl:value-of select="$SAP_EDI_GS_Control_Number" />
</xsl:copy>
</xsl:template>
<xsl:template match="EDIHeader">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
<TxnCntrlNum>
<xsl:value-of select="$SAP_ST_Control_Number" />
</TxnCntrlNum>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
The below shows the steps for SOAP to EDI coversion.
Regards,
Priyanka Chakraborti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
4 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |