Skip to Content
author's profile photo Former Member
Former Member

Suggestions

Hi,

We have requirement where we have to update SAP and SQL server DB simulatenously from a web application.

I mean when a user clicks on Submit button in Web application, the data should get posted to Both SAP and SQL Server instanteously. If update fails in one, the transaction should get rolled back in both. How this can be done in XI ?

Pls help me with your suggestions.

Best Regards

Karthik

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 06:42 AM

    karthik,

    you can do one thing. Use BPM and first call SQL Server( or SAP) synchronously and check back the response. If its error you dont even call SAP.

    If its success, then call SAP. But if SAP call fails then you have to delete the row from SQL server usign another delete.

    I dont know whether we can rollback the SQL Server action if SAP call fails but my suggestion is as above.

    --Archana

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 06:46 AM

    Hi,

    For your requirement BPM with execption handling is the best solution.

    Steps

    1. Receive

    2. Transformation(1:2) - Two message types on the receiver side.

    3. block within that add 2 send. (one to SAP and other to another DB)

    4. two exception handling branches. if first send fails stop the BPM there.

    If it is exception from second send step, undo the first send step operation and then stop the BPM

    Regards,

    P.Venkat

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 10, 2007 at 08:16 AM

    Hi,

    Just adding to the discussion here, how are you posting the data to your SAP system? Are you using Idocs? If yes, you would need to use Idoc Acknowledgements to get the status of the call to the SAP system.

    Like pointed by others, you will have to use a BPM and maybe make the call in a fork to both the JDBC and the SAP system, get the response and then do the validation.

    The only problem I see is what if the call to the JDBC fails and you need to undo your Idoc call? Then you would need another Idoc to undo the changes of the previous call.

    So, i guess a better thing to do would be like Archana suggested, make the call to the JDBC , get the response and if successful, make the call to the Idoc , get the Idoc acknowledgement and then if Idoc has application error, undo the call to the JDBC!

    Regards

    Bhavesh

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 10, 2007 at 08:22 AM

    hi,

    I believe there is also another way that those presented

    1. call the SAP via an RFC inside which you will invoke a BAPI (which will update

    your dataset)

    2. after that (still in RFC but after the bapi call) call DB update via a sync call (ABAP proxy or RFC) and wait for a response

    3. if response is ok (meaning DB update was ok) then commit the bapi

    if not do not commit the bapi and the data will not be updated in SAP

    Regards,

    michal

    -


    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.