cancel
Showing results for 
Search instead for 
Did you mean: 

Correlating AS2 MDN to Original IDoc?

Former Member
0 Kudos

Hi All -

I have got the following scenario:

1) Backend system (ECC) sends IDoc to SAP PI.

2) SAP PI maps IDoc to EDIFACT message and sends via AS2 to B2B Partner.

3) B2B Partner sends back AS2 MDN to acknowledge receiving of AS2 message.

__Question:__

How can I now correlate the AS2 MDN to the original IDoc and so forward the acknowledgement to the Backend system?

I was thinking to use the 'Correlation ID' which is contained in the AS2 MDN and is the same ID as the original SAP PI message.

However, how do I practically retrieve the IDoc number (part of original IDoc message and used as identifier in the ECC system) from the persisted messages of SAP PI?

Can I code an ABAP or JAVA program which is than called within a mapping to query the persisted messages and give back the correlating IDoc number?

Are there other ways to achieve this?

Thanks for your inputs.

Best Regards, Mathias.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

When AS2 message is sent out, create a new message(MDN_IDOC_Corr MSg) that will ahve the requried prams that will trigger a new Integration scenario (Lets say MDN_IDOC_Correlation Scenario) or Use an Adapter module to write an XML file just before the last adapter module...

As mentioned above, a 2nd integration scenario will pick this file & will wait for MDN to be corelated. Once MDN is received, you can map the MDN to ALEAUD to send an ack back to the ECC system..

We used the adpter module to write the XML file in my previous project. There are few adv of using the adapter module over creating it from teh message mapping.

-Siva Maranani

Former Member
0 Kudos

Hi Everyone - Thanks alot for the input.

However, I am not yet satisfied with the solution.

@ Siva - Regarding the BPM. Wouldnt that be a bit of overhead on a high volume scenario that I have to run? I am just thinking of the amount of messages that will be waiting in the Integration Process for the MDN to come back. Also, how would the actual correlation look like?

@ Ravi - In the scenario described I am getting a MDN which only contains the original message ID, but not the IDoc number.

@ Aamir - The difference to your scenario is that you receive a functional acknowledgement that contains the required identifiers such as the IDoc number. Also, how can I send back the MDN to the backend when I do not enrich it with the original IDoc number. The backend systems wont recognize any data from within the MDN.

Going back to my original question: Could I use a similiar program as the payload search to query the persisted messages? Or should I add some storage logic to the outbound flow and write the required data into a custom table, which I can than read-out again once the MDN is received?

Thanks.

Mathias

Former Member
0 Kudos
Or should I add some storage logic to the outbound flow and write the required data into a custom table, which I can than read-out again once the MDN is received?

This should be a better approach.You can have a ABAP mapping which will store the information in some table when the actual IDOC goes out(outbound flow) and then on way back in MDN,you can look into this table and populate the original fields.

Thanks

Aamir

Former Member
0 Kudos

Hi Mathias,

Approach1:

I would definately not consider using BPM overhead on a high volume scenario. As the Output file(that will be generated) will be a simple XML message with just the data required for corelating with the MDN. All MDN's are expected to received within 1 min or less than 5 min.(B'cos it is a System level Acknowledgement), Hence if the BPM is not closed within the specified time period(1min or 5 min), raise an exception.

The Corelation file that will be generated can look like

<MDN_Corr>

<SenderAS1ID> --> Will be used for Corelating the MDN

<ReceiverAS2ID> --> Will be used for Corelating the MDN

<TimeStamp>

<IDOCNumber>

<EDI_ISA_Control_No> --> Will be used for Corelating the MDN

<EDI_Message_Type>

</MDN_Corr>

Approach2:

It might be very resource intensive to perform payload search. (and in some cases, the messages are archived, hence might result in bad search). Hence, you can have Z-Table all the fields as mentioned in the XML message. 1:1 mapping b/n EDI_ISA control number & IDOC_Number will be your lookup key-value params

-SM

Former Member
0 Kudos

The Adv of using a BPM is you would know the Outbound EDI messages for which an MDN has not been received within the specified time period. Which means your partner hasn't confirmed the successful receipt of the EDI msg that you had sent & raise an alert msg.

- SM

Former Member
0 Kudos

Hi Guys - Thanks again for your input. Points already awarded.

We will go ahead with a custom table and manipulation of the outbound flow to store the required data for the correlation. Once the MDN comes in, a query will be execute to this table to get back the original message information.

Given the time, we will also develop an option to directly search in the persisted messages, as this comes with less development effort, since the outbound flow stays untouched.

Thanks, Mathias.

Former Member
0 Kudos

>>develop an option to directly search in the persisted messages

Luck is on your side:)

there is already a report to do this for you

/people/alessandro.guarneri/blog/2006/02/14/super-message-monitor-for-sap-xi

/people/sravya.talanki2/blog/2006/02/21/abap-based-trex-in-xi-proto

Thanks

Aamir

Former Member
0 Kudos

Hi Aamir - Thanks for pointing this out.

We have the payload search already implemented and thats why we will be going with this option for a search at runtime if time allows.

Mathias

Answers (2)

Answers (2)

ravi_raman2
Active Contributor
0 Kudos

In the aleaud there is a field that stores the Original Idoc number.

Do a search on SDN and its mentioned in a few places.

You can use that also.

Regards

Ravi Raman

Former Member
0 Kudos

>>Can I code an ABAP or JAVA program which is than called within a mapping to query

We followed the exact same method when we were corelating EDI 855(PO acknowledgment) against the EDI 850(Outbound PO),but in our case the acknowledgments were coming from the external partners after the PO's have reached them and they have posted the acknowledgment back.

as far as i can remember,MDN is automatically triggered(kind of like ALEAUD in SAP system) so there is no need to do any corelation between the outbound message and inbound MDN.

I vaguely remember there is some option in receiver AS2 adapter where you can enable MDN notification and then you do some extra configuration steps and MDN does back to SAP system without any of the co-relation.

I did that long time ago so i might be wrong but i guess thats how MDN used to work:)

Thanks

Aamir