Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
jirifridrich
Participant
0 Kudos
395

Agreement

Agreement is the heart of Trading Partner Management - it is here where all configuration components meet.

When creating Agreement, we have to create Agreement Template first. This is a generic Agreement, which can be reused and modified for as many Agreements as needed.

As we have many trading partners, we can create Agreement Template with My Company only and individual Agreements will be partner-specific. As we specify Type System here, we create one Template for IDoc communication and one for X12 communication, depending on what message method we are using.

jirifridrich_0-1733915351110.png

Now we create the Agreement based on our Agreement Template. We usually select Copy from Template to have Agreements independent, even though binding the template may be useful in case our trading partners share similar configuration.

jirifridrich_1-1733915351111.png

This is an example of an Agreement between My Company and our ACME trading partner. Don't worry too much about the Type System Version, as it can be always edited later, based on real message content.

jirifridrich_2-1733915351112.png

B2B Scenarios

The detailed message exchange configuration is specified in B2B Scenarios, where we define inbound / outbound flows. Let's demonstrate it on inbound (partner is sending an IDoc to us).

jirifridrich_3-1733915351113.png

We populate individual boxes in alignment with our TPM configuration. It is here, where all the components meet! Here we connect SCI Sender / Receiver adapters with TPM message configuration and apply Mapping, which we built in Integration Advisor. In the inbound scenario we have to read the above diagram from right to left.

Once we save it and activate, the configuration is moved to TPM Partner Directory, which we can imagine as a database with all the data necessary for successful message exchange.

Sending a test AS2 message

Only now, we can try to send a message, as we have the whole chain configured. Let's do it.

Just one thing before that - in order for this to work, we have to have this SAP-built package installed and configured. You can get it on SAP Business Accelerator Hub. This is more of a SAP Cloud Integration topic, so I will skip it here. If there is a demand, I can write another article about it.

jirifridrich_4-1733915351113.png

I will simulate a partner's call by Mendelson AS2 client with a sample IDoc message. The IDoc header is what matters to TPM, so let's just focus on that.

jirifridrich_5-1733915351114.png

Now we run the transfer and the message was sent to TPM.

We can see the message in TPM proprietary B2B Monitor.

The result is an error, which is nothing unusual in the beginning and its resolution will help us further understand the TPM logic.

jirifridrich_6-1733915351114.png

Let's click it and see the Details of the error.

jirifridrich_7-1733915351114.png

The 'Partner Directory lookup failed' error can be really frustrating, if we don't know what to look for.

jirifridrich_8-1733915351115.png

What the error is saying is that the IDoc message doesn't correspond to the configuration, which we saved into Partner Directory.

TPM takes several so called Lookup Keys and if they don't match, it throws this error. Now we have to compare the above Lookup Keys from the message with Lookup Keys from Partner Directory.

In TPM B2B Scenarios menu, we go on Partner Directory Data tab and look for the record, which represents our Agreement. Here we can see the Lookup Keys combination, which we need to match.

jirifridrich_9-1733915351116.png

Now we have Lookup Keys string from the message exchange and Lookup Keys string from Partner Directory. Now we have to compare them. Doing so, be careful even about the dashes, upper case, numbers, everything. Those strings need to match 100%.

We see 5 Keys:

  • 'AS2-SAP_IDoc' is derived from out partner Type System
  • '1809_FPS02' is the version of the Type System we selected. We could change it in the Trading Partner profile, if this was causing a mismatch
  • '10001_ACME_IDOC' is our partner Identifier (configured in Trading Partner profile) and it needs to be specified in the IDoc as SNDPRN (Sender Partner)
  • 'QS4CLNT300' vs 'DS4CLNT100' - we have mismatch in the SAP client identification. In our TPM Agreement we declared DS4CLNT100, but our partner is sending different value in RCVPRN (Receiver Partner) value. Let's fix it in our IDoc and set value DS4CLNT100
  • 'ORDRSP.ORDERS05' - In Partner Directory this is derived from the MIG in the TPM configuration, whereas in the IDoc it is a combination of <MESTYP>.<IDOCTYP>
    Mismatch in this is usually the hardest to fix, as we may need to redefine the MIG. I take a shortcut here and rename it in the IDoc

This is our new IDoc header

jirifridrich_10-1733915351116.png

The IDoc now passes TPM, as the Lookup Keys match and TPM was able to identify the Sender, Receiver, the exchange type, message format and the mapping.

jirifridrich_11-1733915351116.png

As we can see, we can resolve the mismatch either by changing the message content, or the configuration. Changing the configuration is usually a better option, as we may not be able to control what the partner is sending.

 

Labels in this area