cancel
Showing results for 
Search instead for 
Did you mean: 

Correlation of Asynchronous calls

0 Kudos

Hi,

We are Integrating SAP with Thirdparty using PI.

At first we have created the synchronous interfaces for our scenario and later we want to go to Async calls.

We are going with RFC --> PI --> SOAP.

whenever SAP trigger the data, the SOAP is executed and return the messages. The problem is that it is taking more than 30 min to execute and send the response back to SAP R/3 because of huge data.

So we have create the 2 Async interfaces.

1. SAP --> PI --> TP  --- request async

2. TP --> PI  --> SAP  --- response async

now the problem is that we want to track the response message from TP for its request from SAP.

The message data flow was very high and per day we are triggering RFC around 100 times(min).

Suppose if any of the request from RFC sent to TP and failed to give response. Is there any possibility that PI can send alerts that for this even if the TP system is not available or down or failed to send the response.

Please help me with this.

regards,

Praveen

Accepted Solutions (1)

Accepted Solutions (1)

ambrish_mishra
Active Contributor
0 Kudos

Hi Praveen,

If the TP system is not available, it will show an error at adapter level and alert will be generated if CCMS alerts are set up in your PI system. If third party failed to send any response, I am afraid you have limited options. Here you will have to do customize tracking, for example, if it is a custom RFC, store a key value(s) in a custom table outbound and update the status inbound.

create a program which is run through a background job and checks every 10 mins if there are any records in the table where response was not received(status is null)and trigger an email to TP and business owner with details.

Hope it helps!

Ambrish

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Praveen,

I support Udo's approach and only would like to add that I recommend you to not do this in PI, but on the sender SAP system. This way you leave the upgrade path to Java-only open plus you don't need to change values in the message sent from SAP system. This is usually better for audit purposes. Additionally, on sender system you could assign alerts directly to the users related to the business case. On PI you wouldn't have the user data and you would have to pass an alert to some admin first.

Regards,

Jörg

0 Kudos

Thank You for your valuable answers.

We are using SAP PI 7.1.

Can you please let me know how can we acheive this using ccBPM ?

regards,

udo_martens
Active Contributor
0 Kudos

Hi Praveen,

you can try it, but as mentioned before it might not work (performance problems).

You send an asynchronous RFC message (call with IN BACKGROUND TASK) to PI and map it to a BPM message (abstract IF representing TP request). You activivate a correlation on a message unique field, may be you need to generate that i ERP.

Then you need a block having a deadline branch, where you execute a control step. Best would be to jump into an exception branch (for better reuse) and raise there an alert. In the block you have the send step to TP (using same container as first receive step) and the receive step using the correlation on the unique field. Of course TP has to send back the unique number. Put here as well the mapping outside BPM and send the response with the same container to SAP. Define for all send steps an exception and jump into your branch.

/Udo

Former Member
0 Kudos

Going from the description of your volume and requirements I can only recommend not to do this in PI, least with ccBPM.

Regards,

Jörg

ambrish_mishra
Active Contributor
0 Kudos

Praveen,

In your case, ccBPM is not ideal. I suggest to follow the approach on a custom table in ECC. Details in my post above.

For BPM, you can work with a key field in the RFC and make sure the same comes back in the response and follow the design which Udo has suggested.

Hope it helps!

Ambrish

0 Kudos

Thank you for your response.

I suggested the same with the SAP team to maintain a table and create an alert from their end.

Now they are asking me to send the MESSAGE ID from SAP PI.

If we trigger the data from SAP --> PI--> TP

They want the message ID which is generated in SAP PI for both SAP and TP systems in an asynchronous scenario.

To achieve this we need an UDF.

Please help me with this.

regards,

udo_martens
Active Contributor
0 Kudos

Hi Praveen,

to pick the message at pi would not be constructive, because you need a unique id already in SAP (to be able to correlate). A good idea would be to use proxy instead of RFC because you could pick the message id:

http://help.sap.com/saphelp_nw73/helpdata/en/a1/082589fc4246f09793039d5fb01a17/content.htm

To pick the id in the udf (for sending to receiver)

String MessageID;

java.util.Map param = container.getTransformationParameters();

MessageID = (String) param.get (StreamTransformationConstants.MESSAGE_ID);

return MessageID;

/Udo

ambrish_mishra
Active Contributor
0 Kudos

Hi Praveen,

Message ID solution won't work. Message ID is generated after the RFC is executed so how will it help to correlate the message. Which RFC are you using. Try and use a key field in the RFC for correlation.

Hope it helps!

Ambrish

aashish_sinha
Active Contributor
0 Kudos

Hi Praveen,

My first question is what PI version you are using? If using PI 7.31 - You can raise alert in case of any kind of failure, you just need to add alert rule (ID) and specify it in adapter. If by any case, data is not reaching to thirdparty, SOAP receiver will raise alert message.

Now I will come to your main question, As per above, I can understand synchronous scenario is taking lots of time so you changes it to 2 Async scenario. I can see 3 drawbacks in sysnc approach.

1. SOAP Receiver - In this case, instead using SOAP - try with rest adapter, possibly you will get response a bit faster.

2. RFC Sender - Don't use RFC adapter for big data - Change it to proxy - Proxy Communication is best approach in this case.

3. Data Size - Big data always gives problem, send it in chuck.

Now i will give you another approach -

Use RequestResponseBean and ResponseOneway Bean and create a scenario like below -

Proxy -> PI -> TP(SOAP Adapter) -> Proxy receiver (generate server proxy). Use RequestResponseBean and ResponseOneWayBean in Sender channel  (Strictly for PI 7.31 - where Proxy communication uses SOAP Sender Channel).

Regards

Aashish Sinha

udo_martens
Active Contributor
0 Kudos

Hi Praveen,

you can theoretically use ccBPM (suppose you have PI double stack), correlating request to and response from TP. In a dead line branch you would raise an alert and then stop the process.

The problem is here the TP runtime of 30 min and the load of 100 msg/min. That would lead to 3000 ccBPM instances at the same time and i guess you might get some performance issues.

Therefore, i would correlate the messages inside SAP with a Z-table. You need of course a unique value inside request and response to correlate. So you have this unique value, a time stamp request and a timestamp response (the receiving RFC has to put in that). A SAP job is reading frequently the table is is detecting missing responses for requests older than 30 min and executes alerts.

/Udo