Skip to Content
Author's profile photo Avinash Bandela

SAP PI- B2B ANSIX12 Inbound Scenario

EDI ANSIX12 Inbound

This is an inbound scenario where data flow is as follows. Let’s take EDI 850(Orders) in our example.

External Partner——–EDI 850 File—–(1)—->PI————-IDOC——–(2)——>ECC

External Partner<——–997 Ack——(3)——PI

External partner sends an EDI 850 file to PI. PI converts it in to an IDOC and sends it to ECC. And also PI sends a 997 EDI file back to External partner as an acknowledgement.

There are several ANSIX12 EDI transactions like 810(Invoice), 850(Orders), 856(Shipment) etc. But in our example we talk about 850(Orders).

Prerequisites

  1. Firstly we need to on-board all partners involved, in to PI TPM. TPM stands for Trading Partner Management which is a B2B central repository to maintain all partner information.

     2. We’ll on-board following 3 partners in to TPM.

    1. Partner_A
    2. Partner_B
    3. Partner_C

     3. Along with these 3 partners we on-board one more partner which acts as self-partner.

    1. Partner_ECC

     4. Before we on-board partners in TPM, we need to create corresponding parties in ID.

    1. Party_A
    2. Party_B
    3. Party_C
    4. Party_ECC

     5. Above all, make sure B2B add on is installed in our PI landscape.

Things to do in TPM

Step 1: Create all parties in ID

In our example, we have 4 parties to create.

/wp-content/uploads/2016/05/f_961863.png

Step 2: Create all Partners in TPM

To create partners in TPM, we first login in to B2B integration cockpit using following URL.

http://PIHostName:port/b2bic

Postfix b2bic to PI url to login in to integration cockpit, which looks like following

/wp-content/uploads/2016/05/f_961863.png


Click on Trading Partner Management and add our partners there.

/wp-content/uploads/2016/05/f_961863.png

In Party Name select its corresponding party which we have already created in ID in step 1.


Now go to identities tab and give a unique partner ID and partner ID qualifier for the partner and save it.


Here, we give partner ID in identifier text box and ID qualifier in agency code text box. In this case partner ID is 000000000A and Qualifier is ZZ.

/wp-content/uploads/2016/05/2_961873.png

Now go to Messages tab, add message type ANSIX12 850 of version 4010 and save it.

/wp-content/uploads/2016/05/3_961874.png

Now go to EDI Acknowledgments tab, then go to ANSIX12 tab, mark 997 acknowledgment as required and save it.

/wp-content/uploads/2016/05/4_961875.png

Similarly create partners for Partner_B, Partner_C and Partner_ECC as well.


Use partner IDs as 000000000B, 000000000C, 0000000ECC respectively. And use ZZ as qualifier for all partners.


While creating Partner_ECC, select partner type as self.

/wp-content/uploads/2016/05/5_961876.png

/wp-content/uploads/2016/05/6_961877.png

Step 3: Create Agreements

Now we create partner agreements for all partners. Agreement is created between External-partner and self-partner we created. In our example since we have 3 partners, we create 3 agreements.

     a. A-ECC

     b. B-ECC

     c. C-ECC

To create an agreement for partner A, select it and go to Agreements tab and click on Create.

/wp-content/uploads/2016/05/7_961878.png

  Similarly create agreements for Partner_B and Partner_C too.


Things to do in ID

In ID, we create 3 ICOs. Below is the reason why we do that.


To achieve our functionality, we have to do following 2 things.


  1. Send EDI file from external partner to ECC
  2. Send a 997 acknowledgment back to partner


So, technically it looks like 2 ICO’s are enough here. But as a part of first step (where we send EDI file from partner to ECC), we don’t send it directly to ECC. But we split this in to 2 flows. First flow is from external partner to EDISeparator channel. And second flow is from EDISeparator channel to ECC. The reason why we do this is, we need EDISeparator channel to split incoming EDI message in to multiple EDI messages if contains multiple transactions in it. And also EDISeparator channel is needed to send a 997 acknowledgment back to partner.


Hence we need to create following 3 ICOs in ID.

ICO 1

External Partner——EDI 850 File——>PI———- EDI 850 File ———>EDISeparator

ICO 2

EDISeparator——EDI 850 XML File——–>PI———- IDOC XML ———>ECC

ICO 3

EDISeparator——EDI 997 File——–>PI———- EDI 997 File——->External Partner


I have created 2 Business components, one for external partner and other for EDISeparator. Besides, I have one more business system for ECC.

  1. BC_ExtPartner
  2. BC_Split_conv
  3. BS_ECC

Note: For simplicity, I have used a file channel to pick EDI messages instead of using AS2.


Creating ICO 1

In ICO 1, sender component would be external partner component and receiver component would be EDISeparator component.

/wp-content/uploads/2016/05/1_962987.png

While creating this ICO, give some dummy name for Interface and Namespace. This interface and namespace need not be present in Integration Repository.


Give sender channel as NFS/FTP file channel (for simplicity, I have used file sender channel instead of AS2 sender channel). We will place our EDI files in this path.


In file sender channel modules tab, give following module sequence.

/wp-content/uploads/2016/05/2_961873.png

TPMContentAccessModule is required to dynamically fetch partner information from TPM based on sender partner ID, qual and receiver partner ID, Qual combination when ICO gets a new EDI file.


EDISearchParametersModule adds few EDI search parameters like correlation ID which will be helpful while monitoring EDI messages.


In Receiver tab, give business component we created for EDISeparator as receiver communication component. In this case, it is BC_Split_conv.

/wp-content/uploads/2016/05/3_961874.png

In Receiver Interfaces tab, give some dummy names for Name and Namespace. They need not be present in Integration Repository.

/wp-content/uploads/2016/05/4_961875.png

In outbound Processing tab, give EDISeparator receiver channel which receives incoming EDI file.

/wp-content/uploads/2016/05/5_961876.png

In EDISeparator receiver channel, check Read from Dynamic Headers check box. This ensures TPM configuration we did will be given priority to configuration we do in this channel. For example if we say Ack is not required in communication channel and Ack is required in TPM configuration, TPM configuration will be given priority and Ack will be sent.

/wp-content/uploads/2016/05/6_961877.png

Now, EDISeparator receiver channel does two things.

  1. If incoming EDI message has multiple messages in it, EDISeparator receiver adapter will split that EDI message in to multiple individual EDI messages. If it contains only single EDI message, it will just send out single EDI file as it is.
  2. If the partner is configured as acknowledgment required in TPM, EDISeparator adapter will create another EDI message with 997 transaction as an acknowledgment.

Creating ICO 2

Now, we create ICO 2 to receive splitted EDI messages which is explained in point 1.


So, sender component would be EDISeparator business component and receiver component would be ECC.


In this ICO, give some dummy Interface and Namespace name. They need not be in Integration Repository.

/wp-content/uploads/2016/05/7_961878.png

In EDISeparator sender channel do following configuration. Since this ICO should pick up splitted EDI 850 messages, we configure channel as following so that this channel will pick up only EDI 850 splitted messages and ignore the rest.

/wp-content/uploads/2016/05/8_962997.png

Incoming message is in raw EDI format. First we have to convert this EDI file in to XML file. Hence we use a predefined SAP module to do that.

Go to Modules tab and configure following module sequence.

/wp-content/uploads/2016/05/9_962998.png

TPMContentAccessModule and EDISearchParametersModule are optional. X12ConvertedModule is required to convert ANSIX12 EDI file to XML file. tpm.enable parameter ensures to use TPM configuration while conversion.

Now go to Receivers tab and give receiver as ECC.

/wp-content/uploads/2016/05/10_963002.png

Now go to Receiver Interfaces tab and give message mapping which we have created to convert EDI XML to IDOC XML.

/wp-content/uploads/2016/05/11_963003.png

I have already created a mapping which converts EDI XML to IDOC XML in Integration repository. I am not covering that in this document. There is an SAP provided mapping for EDI 850. You can refer that to create your own mapping or just use that same mapping in this ICO.

/wp-content/uploads/2016/05/12_963004.png

Now, go to outbound processing tab and give IDOC receiver channel.

/wp-content/uploads/2016/05/13_963005.png

Creating ICO 3

Now, we need to create ICO 3 to receive splitted 997 EDI message and send it as an acknowledgment back to partner.


Here since no message mapping is involved, we just route the EDI file to partner and no XML conversion is required.


Give some dummy name to Interface and Namespace. They need not be there in Integration Repository.

/wp-content/uploads/2016/05/14_963006.png

Create an EDISeparator sender channel to pick up EDI 997 messages and use it here.

/wp-content/uploads/2016/05/15_963007.png

Receiver will be External partner here.

/wp-content/uploads/2016/05/16_963011.png

Give some dummy names for Interface and Namespace.

/wp-content/uploads/2016/05/17_963012.png

In outbound processing, configure one NFS file receiver channel to place 997 EDI files. (In real time, we use AS2 adapter and route the 997 files to partner).

/wp-content/uploads/2016/05/18_963013.png

That’s it! We are done with configuring. Below picture gives an overall view on how EDI inbound interface works. In real-time we use AS2 adapter to connect to external partner instead of file channel in our example.

/wp-content/uploads/2016/05/19_963017.png

To test the interface end to end, take a sample EDI ANSIX12 850 file and change sender ID, Qualifier and receiver ID, Qualifier so that they will match with our partner configuration.


For example, if we are testing with Partner A, following should be configured.


Sender Partner ID: 000000000A

Sender Partner ID Qualifier: ZZ

Receiver Partner ID: 0000000ECC

Receiver Partner ID Qualifier: ZZ


/wp-content/uploads/2016/05/20_963018.png

While testing you will be able to see in message log that sender and receiver partner information is fetched dynamically using TPMContentAccessModule based on partner ID and qualifier combination in incoming EDI file.

/wp-content/uploads/2016/05/21_963019.png

Assigned Tags

      23 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Hi Avinash,

      I appreciate your wonderful document,actually I am searching for complete B2B step-by-sptep blog at last I found it.Good work Keep it up!

      Thank you!

      Bhoopal

      Author's profile photo Roberto Cantero
      Roberto Cantero

      Hello,

      Check that link:

      https://scn.sap.com/docs/DOC-71653

      Step by step here

      regards,

      Roberto.

      Author's profile photo Former Member
      Former Member

      Looking for EDI outbound scenario

      Author's profile photo Younus Mohammed
      Younus Mohammed

      Hi Avinash,

      Good work in explaining the inbound B2B scenario in details.

      Keep it up. Continue blogging.

      regards,

      Younus

      Author's profile photo ambuj mishra
      ambuj mishra

      Well explained and covers lot of areas about B2B ANSI integration. Thanks for sharing Avinash.

      Author's profile photo Dibyajit Das
      Dibyajit Das

      Thanks Avinash for sharing the blog.

      Author's profile photo sivakrishna sathu
      sivakrishna sathu

      Very useful blog Avinash, keep going.

      Author's profile photo janardhan reddy
      janardhan reddy

      Very useful information.. Thanks...

      Author's profile photo Former Member
      Former Member

      Hi Avinash,

      I was trying to replicate the above scenario. All configuration works fine, apart from "Read from Dynamic Headers" in the EDISeperator Receiver channel. As soon as I enable this check I start getting below error.

      "Transmitting the message to endpoint <local> using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: javax.resource.ResourceException: com.sap.aii.adapter.ediseparator.ra.property.handler.PropertyHandlerException: Unable to get property: ControlKey from CPA cacheControlKey"

      Do you have any pointers to fix this issue ?
      We are on SP04 latest patch for B2B addon.

      Regards
      Vishal J

      Author's profile photo Avinash Bandela
      Avinash Bandela
      Blog Post Author

      Hi Vishal,

      When you check the checkbox “Read from Dynamic Headers”, settings are dynamically read from
      TPM instead of channel.

      Usually we get this kind of exception if modules are wrongly configured in the channels. Please check your module sequence used. Kindly refer module configuration in channel screenshots I showed above.

      Thanks,
      Avinash B

      Author's profile photo Bhalchandra Wadekar
      Bhalchandra Wadekar

      Hi Vishal,

      Were you able to solve your error?

      Please can you tell us how you rectified the error.

      Thank you,
      Bala

      Author's profile photo Former Member
      Former Member

      Yes Bala, I was missing the TPMContentAccessModule in the file sender communication channel.
      Once I added that, the issue was resolved.

      Regards
      vj

      Author's profile photo Bhalchandra Wadekar
      Bhalchandra Wadekar

      Thanks, Vishal. 🙂

      Regards,
      Bala

      Author's profile photo kavi tha
      kavi tha

      Hi Avinash

      i have some doubt regarding “Read from Dynamic Headers” actually how it will work.

      based on your previous post as per my understanding is if we select “Read from Dynamic Headers” it will generate 997 based on TPM configurations. am i correct??

      once we configure the “Read from Dynamic Headers” option in general tab in Receiver Ediseparator side then no need to config next tab”ANSIX12″ in receiver edi separator “997 ACK Required” option ??

      Even if we select both options (“Read from Dynamic Headers” and ” 997 ack required “) what will be happen is it work?? which case we have to use “Read from Dynamic Headers” option .

      if we not configure TPM configuration then it will not work “Read from Dynamic Headers” option??

      One more doubt is you configured three partys A,B,C in ID level but you didnt use while create in BUSINESS COMPONENT LEVEL and Communication level .than what is the use for creating party in ID level. And how we create link TPM config details in ID level .using this module been localjbs/TPMContentAccessModule it will create link TPM to ID.

      Thanks
      Kavitha

      Author's profile photo Manoj K
      Manoj K

      Kavitha,

      When you select both in channel and mention Dynamic , the high Priority is given to dynamic so it will read configuration from TPM.

      if we not configure TPM configuration then it will not work “Read from Dynamic Headers” option??
      No you will get an error.

      Using this module been localjbs/TPMContentAccessModule it will create link TPM to ID.
      Yes you are correct.

      The parties name created in TPM is just a name for a customer it need not be same which you use in ID , what is more important is the Identifier you mention in the TPM under that party.

      Br,
      Manoj

      Author's profile photo kavi tha
      kavi tha

      Hi Manoj ,

      Thanks for your reply.

      I have doubt regarding in party's .

      I saw Party's in ID but he didn't use any where in ID level i mean if we configure the party's in ID we will use business system/component and communication channel as well .But i didn't see that configuration .

      Thanks
      Kavitha

      Author's profile photo Former Member
      Former Member

      How can I change the GS07 - segment in 997 - for example if a customer is sending "T" in 850 - the 997 should send "T" in GS07. But for us it sends "X" - by default to all customers in 997.
      Need help..... 

      Author's profile photo Former Member
      Former Member

       

      We use SAP PO – B2B for EDI.

       

      We have setup EDI separator channel to send 997 automatically as we receive any inbound documents from any customers.

       

      Question -  if 850 document for example – received from customer has value in GS07 – “T”  - which is responsible agency code – in this case customer is sending value – ‘T’

       

      But in 997 we send document – has GS07 with value “X” – which seems to be default in all 997 that we send to any customers.

       

      We want to change this to be T or we want to make sure it reads from the document and sends the value customer has sent… is this possible?

       

      Thank you very in advance for your help.

       

      Author's profile photo Avinash Bandela
      Avinash Bandela
      Blog Post Author

      Hi Alpesh,

      There's one way of doing it. You might have created an ICO for sending 997 to customer. In that ICO's sender EDISeparator channel, use X12ConverterModule to convert it to XML. Then use an intermediate mapping to change its value to 'T'. In the receiver channel convert the mapping output XML to X12 file again using X12ConverterModule.

      Hope this answers your question.

      Thanks,
      Avinash B

      Author's profile photo Nguyen Steven Linh
      Nguyen Steven Linh

      Hi Avinash,

      Great blog!

      I would like to have small questions: I saw there are Parties created in ID but you did not define BC, CC, ICO, etc. for each party. Instead, used BC, CC, ICO, etc has empty Party.

      What is the role of Parties in ID? Did you only use them to fill in TPM?

      Best Regards,

      Steven Nguyen

      Author's profile photo Peter Ellebye
      Peter Ellebye

      Hi.

      The blog refers to the module X12ConvertedModule.
      It's a typo...

      Use localejbs/X12ConverterModule 🙂

       

      Best regards...
      Peter

       

      Author's profile photo Kasi Vishwanath
      Kasi Vishwanath

      Hi ,

      I have created scenario as mentioned above and process EDI file via File channel, it went through and generated 850 IDOC.

      But 997 Ack is not triggered even in TPM selected 997 required. Channel itself not triggered.

      in B2B Acknowledgement in Monitoring status is showing in process

      Could you please help me out.

      Regards

      Dhyanesh

      Author's profile photo cheng cheng
      cheng cheng

      Hi,

      It's so helpful for us to understand the data flow even after all these years.

      As a beginner , I have another problem with this——

      Is there a software for developer to test sending?

      Regards

      CC