SAP PI - B2B ANSIX12 Inbound Scenario
SAP PI - B2B ANSIX12 Inbound Scenario
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.
a. Partner_A
b. Partner_B
c. Partner_C
3. Along with these 3 partners we on-board one more partner which acts as self-partner.
a. Partner_ECC
a. Party_A
b. Party_B
c. Party_C
d. Party_ECC
Things to do in TPM
Step 1: Create all parties in ID
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
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.
Now go to Messages tab, add message type ANSIX12 850 of version 4010 and save it.
Now go to EDI Acknowledgments tab, then go to ANSIX12 tab, mark 997 acknowledgment
as required and save it.
Similarly create partners for Partner_B, Partner_C and Partner_ECC as well.
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.
Things to do in ID
In ID, we create 3 ICOs. Below is the reason why we do that.
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.
ICO 1
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.
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.
EDISearchParametersModule adds few EDI search parameters like correlation ID which will
be helpful while monitoring EDI messages.
In Receiver Interfaces tab, give some dummy names for Name and Namespace. They need
not be present in Integration Repository.
In outbound Processing tab, give EDISeparator receiver channel which receives incoming EDI
file.
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.
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.
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.
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.
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.
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.
Create an EDISeparator sender channel to pick up EDI 997 messages and use it here.
Receiver will be External partner here.
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).
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.
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.
Alert Moderator
Assigned tags
Related Questions
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
o Like(1)
Roberto Cantero
Hello,
https://scn.sap.com/docs/DOC-71653
regards,
Roberto.
Like(0)
Former Member
Like(0)
Mohammed Younus
Hi Avinash,
regards,
Younus
o Like(1)
ambuj mishra
Well explained and covers lot of areas about B2B ANSI integration. Thanks for sharing Avinash.
o Like(1)
Dibyajit Das
o Like(1)
sivakrishna sathu
o Like(2)
janardhan reddy
o Like(0)
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”
Regards
Vishal J
o Like(0)
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
Like(0)
Bhalchandra Wadekar
December 12, 2016 at 4:36 pm
Hi Vishal,
Thank you,
Bala
Like(0)
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
Like(0)
Bhalchandra Wadekar
Thanks, Vishal.
Regards,
Bala
Like(0)
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
o Like(0)
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
Like(2)
kavi tha
Hi Manoj ,
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
o Like(0)
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…..
o Like(0)
Former Member
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.
o Like(0)
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.
Thanks,
Avinash B
Like(0)
Nguyen Steven
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
o Like(0)
Peter Ellebye
Hi.
Use localejbs/X12ConverterModule
Best regards…
Peter