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

Fail safe logic needed for purchase order upload program

Hello all,

i am working on creating PO's by reading data from a text file. I need to implement fail safe logic in it, which is to make sure this program uploads all the records in the text file successfully. For example, i have 1000 records in my text file and while running the upload program if the program times out while creating the 500th PO or if SAP is down at that time, then we have 499 PO's created and 501 yet to be created. But if we run the same program again, we will generate duplicate PO's for 499 again. I want to avoid this kind of problem.

How do i implement this idea?

Kindly guide me on this.

Thanks.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 09, 2005 at 03:21 PM

    You can use BAPI_PO_CREATE to create the PO and then choose one of the two options.

    1. Commit work if all the PO's are successfully created or else Rollback work.

    2. Commit successfull POs one by one and write / download an error file ( in same structure as original file but with only error records ) for error cases.

    Further you correct the generated error file and process it again ( not the original file ).

    Thanks,

    Ram

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Ok ..

      Then I would suggest you use Application Log to keep the success and error messages of PO processing.

      You can check trsnaction SLG0 and create your own application log object.

      Then you need to use FMs BAL_LOG_* to crate and add messages to it.

      This way you will have a facility to check as which of your records are converted to PO for a run.

      In case SAP gets down in between , still you can find the details using Xn SLG1 and then accordingly remove the records from your file which are already converted to PO.

      Thanks,

      Ram

  • Posted on Jun 09, 2005 at 12:22 PM

    I would suggest trying to create a Batch Input Session.

    If a po would error out, then the session will flag it. You can re-run the session and it will only process the ones that had errors.

    Regards,

    Rich Heilman

    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.