Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member8655
Active Participant
0 Kudos
 

In SAP PI world, getting acknowledgement and processing on the basis of that acknowledgement is a very common scenario. During different use cases, I was required to get response from R/3 system and process it further on the basis of acknowledgement received. The way I found initially, to get the acknowledgement from R/3 system, was to use event and call proxy from the IDOC receiving system.

 

Blog by Rene Klumberg, Code free dispatch confirmation from ERP to MDM using PI, helps to move ahead it that direction.

Code free dispatch confirmation from ERP to MDM using PI


But what if we don't have the required event as in case with Vendor Business object where we don't have event for Vendor create/change. Then we can schedule report RBDSTATE with variants configured that help to generate acknowledgments ALEAUD for inbound Vendor Create IDOCs. In general, this acknowledgement message, ALEAUD, appears as below image in SXMB_MONI.

To get a separate message entry in SXMB_MONI for ALEAUD, make the configuration mentioned in this link.

http://help.sap.com/saphelp_nw04/helpdata/en/44/a1b46c4c686341e10000000a114a6b/content.htm

So after configuration done based on above link, a separate message appears in the SXMB_MONI.

Now after this configuration with a defined scenario in Integration Directory, these messages can be collected and dumped into any file server for further usage. With the scenario discussed above, we don't have a clear picture of a particular acknowledgment is for which IDOC number till we have a manual check on that.  Now if you have defined a correlation on the basis of field element in messages then we can use these ALEAUDIT for further processing in ccBPM, but again if we don't have any field which can be used for defining correlation then what to do? Can we use IDOC number? but that is generated in adapter, so we don't have IDOC number readily available to compare with ALEAUDIT message received.

So lets start, in this blog I will talk about the scenario, Vendor master create, where after sending an IDOC from SAP PI to a SAP ERP system I want to get an ALEAUD message back and process further based on that message. We need a ccBPM process that will send the IDOC message and then will pick the correct ALEAUD based on the correlation.

But again the question remains the same, what will be the condition in our correlation? I would say IDOC number. Yes, we will have our correlation based on IDOC number. We will have an ABAP mapping program to retrieve IDOC number generated in XI system and then on the basis of the retrieved IDOC number and E1STATE-DOCNUM field of ALEAUDIT message, our correlation will work and get correct acknowledgement and process further.

Let us first start with the scenario we are going to discuss.

I won't go through the development of all the design objects. I will just provide a reference to the objects that are required and a note for the special interface objects and mapping objects to be created for this scenario.

 

Object

Name/details

Used By

Data Type

Vendor, Address

Sender Interface

Message Type

Vendor

Sender Interface

Message Interface

Vendor_OB

Sender Interface

 

ALEAUD_AB

ccBPM

 

CREMAS_AB

ccBPM

 

ZALEAUD4XI_AB

ccBPM

Imported Objects

RFC: ZALEAUDIT4XI

ccBPM

 

IDOC: ALEAUD.ALEAUD01

ccBPM

 

IDOC: CREMAS.CREMAS03

ccBPM, Receiver Interface

Message Mapping/ Interface mapping

Between Vendor and CREMAS

Between source and ccBPM

 

An ABAP mapping between CREMAS and RFC: ZALEAUDIT4XI

ccBPM, to retrieve IDOC number

Here is the mapping program; I have highlighted the section in this mapping program that is responsible to get IDOC number based on PI system tables SWFRXIHDR and IDXRCVPOR and then push it into the RFC request message ZALEAUDIT4XI.

ABAP Mapping to retrive IDOC Number. 

Talking about integration process, it will look like this:

Correlation in this integration process is defined based on:

1) IDOC number (generated in XI system and is retrieved in a RFC request message ZALEAUDIT4XI through ABAP mapping) and

2) Field E1STATE-DOCNUM of response ALEAUD (to be received from target SAP ERP by ccBPM).

Step 4 in the ccBPM, which is an RFC call, will trigger an ALEAUD message for the inbound IDOC Vendor Create message. Here the RFC that will trigger the acknowledgement:

 

RFC ZALEAUDIT4XI to trigger ALEAUD. 

I assume that all the required ALE setting are already done in the target system to receive the CREMAS IDOC and send ALEAUD message as a response back to XI system.

Based on the above correlation correct ALEAUD message will be picked and further processing can be done. There are different fields in ALEAUD which can be helpful like field ALEAUD01.IDOC.E1ADHDR.E1STATE.STAPA1 contains the Document number created in the target system, field ALEAUD01.IDOC.E1ADHDR.E1STATE.STATYP contains the status of the IDOC message which can be used for error processing.

The scenario I have taken gives just a idea on how correct ALEAUD message can be gather in SAP PI. One can add more steps as per requirement too process further on the basis of ALEAUD. 

3 Comments