Skip to Content

Rollback work after a Batch Input

Hi!

I need to rollback the changes made if there are errors occured during execution of two batch input programs in my calling program (using rollback work).

Is this possible?

Thanks,

Jeff

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 24, 2005 at 06:04 AM

    when you do batch input or bdc we cannot rollback but when got some errors it will not post the document. So you neednot rollback

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 24, 2005 at 06:42 AM

    Hi RollBack will be done automatically if any erros is there in case of Batch Input. you need not to do roll back explicitly.

    regards

    vijay

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      hello all,

      actually our problem is like this, we have 2 BDC to call, say BDC1 and BDC2. If at least one failed, we should rollback changes made by both calls.

      for example:

      call BDC1

      call BDC2

      if the first call (BDC1) has no error, and the second call (BDC2) fails, then we want to rollback changes made by the first BDC (BDC1) call...

      please help us...

      many thanks!

  • Posted on Nov 24, 2005 at 07:40 AM

    Hi Jeff,

    have a look here: call-transaction's-and-batch-input

    Andreas

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 24, 2005 at 07:59 AM

    Hi Jeffrey,

    You can achieve your requirement like this...

    Call BDC1.

    if sy-subrc = 0. " BDC1 successfull

    Call BDC2.

    endif.

    Regards,

    Raj

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Sid!

      I already feared, that this is your requirement. But this is not according the transaction logic.

      Per definition a transaction is the combination of tables, which have to be changed together to get a consistent status in DB.

      A second transaction is independent - but can have a link as follow-on document.

      It is OK to have step 1, but not step 2 in the system - e.g. a goods issue, but no goods receipt of receiving plant. The process is obviously not finished, but we have a consistent status.

      If in this example the truck has an accident, then we can't just cancel the goods issue -> in general it's not possible to rollback some transactions.

      Still it's possible to correct some faults, e.g. by creating storno documents, by deletion of created master data... But this is a separate step (with a different transaction / movement type / function code), not just a 'go-back' statement in a report.

      Either you develope a correction 'just book step 2 after error'-report, or you have to add a 'cancel step 1'-function in case of step 2 failure.

      Regards,

      Christian

  • Posted on Nov 24, 2005 at 09:06 AM

    hi

    ROLLBACK will be done automatically for the records which contains error.So you dont need to do it manually..

    Regards,

    Abdul

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 24, 2005 at 04:33 PM

    You can't rollback after a commit, but you could put some logic in to do a reversal if the original BDC fails.

    Rob

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 24, 2005 at 06:39 PM

    Hi,

    You have call the second BDC by checking the return code of the First BDC and by reading the First BDC success message(This can be done with the help of the FM <b>FORMAT_MESSAGE</b>.

    So After the First BDC got successfully executed only then call the Second BDC transaction .

    There is no concept of Rollback in BDC.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 24, 2005 at 06:49 PM

    Develop BDC3 to rollback BDC1 in case of BDC2 failure.

    So you will have BDC1, BDC2 and BDC3. Check whether this works for your requirement.

    Thanks

    Anantha

    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.