cancel
Showing results for 
Search instead for 
Did you mean: 

Scenario - Webservice - XI - BW. How to Avoid duplicate records?

Former Member
0 Kudos

Hi all,

Webservice --> XI -->BW .

BPM has been used to send to send the response back.

BPM :

start ->Receive(Request)> Transformation(Responsemap)>Send(SendtoBW)->Send(Send Response) ---> stop.

We are making use of MSGID to maintain the uniqueness of each message which is coming from Webservice. Uniqueness is maintained for the combination of sale-num:trans-num:sap-saletype:sale-type like below. One msgID will be registered in XI for each Unique message.

ex: sale-num:trans-num:sap-saletype:sale-type

1983:5837:E:NEW

If they receive any duplicate message again it will send the response back to webservice as "DUPLICATE_GUID:c9237200-0c69-2a80-dd11-79d5b47b213a".*

It is working correctly. But only problem is when XI is down or if any communication failure happens in the middle of the processing like below example.

Sample example which has failed recently. A webservice call has been failed three times and the reasons are..

First time :

It got the error as ""FAILED TO INVOKE WEB SERVICE OPERATION OS_CWUSales

Error receiving Web Service Response: Fatal Error: csnet read operation failed (No such file or directory) (11773)" .

Second time:

MessageExpiredException: Message c9237200-0c69-2a80-dd11-79d5b47b213a(OUTBOUND) expired.

Third Time :

"DUPLICATE_GUID:c9237200-0c69-2a80-dd11-79d5b47b213a" ""

If you observe when the call made 2nd time, the MsgID has been registered but due to server down or some other reason it could not able to process further.So MSGID got registered here but processing wasn't happened for the message. When they retried thrid time again to send the same call again they are getting error as "DUPLICATE GUID".

DUPLICATE GUID means it has meaning that the message has been processed and the records has been updated in the backend system which is not happened now.

Final Result is :

Status in Webservice showing as "it has been updated in receicing system" as it is indicating as duplicate guid.

- But it has not updated in backend system which is a problem.

Firstly is there any suggestions on how to solve this problem?

Is there any better way to handle this duplicate thing instead of Msgid?

Please help me in solving this.

Thanks & Regards

Deepthi.

Edited by: deepthi reddy on Jan 7, 2009 2:07 AM

Edited by: deepthi reddy on Jan 7, 2009 2:07 AM

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Its always better to maintain the Duplicate Check in the backend system. If not, I think messageId is the goodway to handle for SOAP scenarios.

The reason why I posted this question is I thought some of the messages are missing in BPE when XI is crashed. But when i checked in SXMB_MONI_BPE monitoring, I found the messages are in "Continue Process After System Crash". Now I kept this point also in daily monitoring tasks.

Thanks to Rajeev for helping in understanding this concept.

Former Member
0 Kudos

Hi Deepti,

Here are two solutions from my side:

1) Use a block.Add a send step in the block and with following properties :

use ack type as Application,also sepcify a exception for this send step.Use a control step to catch this exception and perform the relevant action.

But I'm not sure of this becoz I doubt wheter the exception branch will be executed if application error occurs.Please give it a try.

2) Make BW receiver interface as sync and use a flag in teh response message to indicate the status.

Use a block.Add a sync send step and also specify the exception.Add a deadline and exception branch in the block.

If the sync step is not executed completely due to system connectivity failure then the deadline branch will be executed.

If the sync step is executed,then you need to chk the flag value.

For the branch for which the record is updated in BW then next send step will send a response to webservcie.

Or else if teh flag states that there was some application error due to which teh record is not updated you can execute the exception branch with a send step.

Hope this solves your problem

Former Member
0 Kudos

Hi Deepthi,

My suggestion: You can have a Webservice - BW synch-synch synario without BPM. Sender SOAP adapter sending a synch req msg, getting it mapped to BW req and getting its response back from BW, then map it to webservice response and send to webservice without any receiver SOAP adapter.

Regarding the problem of duplicate check: see when your BW system gets req msg, it processes it and then sends a response msg.........in this response message have a STATUS field with values S for success and E for error - send this response to webservice and store it in database for that req MSGID ........now in web service application, check the response code for a MSGID and if it is E for error, then only resend the msg to BW.

Regards,

Rajeev Gupta

Former Member
0 Kudos

>> My suggestion: You can have a Webservice - BW synch-synch synario without BPM. Sender SOAP adapter sending a synch req msg, getting it mapped to BW req and getting its response back from BW, then map it to webservice response and send to webservice without any receiver SOAP adapter.

Thanks for the suggestion . Looks like a good Idea.

>> Regarding the problem of duplicate check: see when your BW system gets req msg, it processes it and then sends a response msg.........in this response message have a STATUS field with values S for success and E for error - send this response to webservice and store it in database for that req MSGID ........now in web service application, check the response code for a MSGID and if it is E for error, then only resend the msg to BW.

Initially they have planned the same way. But sometimes the response is getting very late back from BW. So now once the request reached to XI then immediately they are sending back the response from XI itself withhardcoded "OK" status. They are not waiting for BAPI response from BW.

So If message is succesfull the Status will go as "OK"

If message is not succesfull the status will go with blank. and this will indicate that there is some problem in the other side. Then they will check the SOAP Fault message which will have the errors like

"DUPLICATE_GUID:c9237200-0c69-2a80-dd11-79d5b47b213a".

"FAILED TO INVOKE WEB SERVICE OPERATION "

Right now they are having the issue only for duplicate data and response time to go back. So by making use of MsgID they solved the Issue.But due to this we are seeing daily so many error messages failing with this DUPLICATE error in production which is hampering the performance.

So we are thinking of to get rid of this MsgId method and BPM. So from your first answer I think we can able to acheive it w/o BPM and after that I need to check the response time how fast it will go back to webservice.

-Deepthi.

Former Member
0 Kudos

Hi,

after that I need to check the response time how fast it will go back to webservice - this will mainly depend on how much time your BW BAPI is taking to process the req msg...........

if you can tell me in detail the BAPI which you are invoking and the requirement of how quickly the response is needed - then i can suggest you a way of doing it in asynch way because synch scenarios put more load on the system than asynch scenarios - but as i said, it will depend on the scenario requirements.

Regards,

Rajeev Gupta

Former Member
0 Kudos

Hi Rajeev,

Webservice --> XI --> R/3 and reponse going back to webservice.

Can you please explain the steps how we can acheive the same scenario without using BPM and without using Synchrunous?

- Deepthi

Former Member
0 Kudos

Hi,

Okay for this, you will make two aysnc scenarios - one for request sending and second for response receiving.

In first scenario, have a msg interface as outbound asynch and map it to BAPI req msg. Give the WSDL from sender agreement in ID to the SOAP application so that they can send a req msg to your XI system.

In second scenario, get the BAPI response and map it to SOAP response asych msg interface which will be external definition containing SOAP response structure. Then send this response to SOAP application by reciever SOAP adapter.

Regards,

Rajeev Gupta

Former Member
0 Kudos

Hi,

Why don't you try using the application acknowledgement in BPM when you send data to BW system.

you can put a check that if you receive the application acknowledgement for an particular message only then capture the GUID.

Regards,

Pragati

Former Member
0 Kudos

>> you can put a check that if you receive the application acknowledgement for an particular message only then capture the GUID.

Can you please elaborate on it please..

Former Member
0 Kudos

Hi Deepti,

You can try any one of the 2 solutions:

1) Use a block.Add a async send step and set Acknowelegment to Application.Add a exception branch

and specify the relevant action for exception.

but i'm not sure if the exception branch wil be trigerred when application ack is in error.

2) Make BW side sync:

Use a block.Add a sync send step in it.Add a deadline branch in the block.

If there is some connectivity error between PI and BW teh deadline branch will ve executed.Add a send step in the deadline branch which will be executed then.

Check the response of the BW.Make use of a flag.

Check the status of the flag in the reponse msg,if the record is updated in BW then execute the send step to send back the response.

Else if the record is not updated in BW then execute the send step in the THEN branch.

Let me know if your issue is solved.