Skip to Content

Program returns bad result when first called in the morning

Hi All,

I'm using BAPI_BATCH_CREATE to create new batches and after that, BAPI_DELIVERYPROCESSING_EXEC to create an inbound delivery with batch split.

The problem is that when I run the program for the first few times in a day, the bapi creates two deliveries instead of one. After a few runs, it starts behaving correctly which means it creates only one delivery with correct data for the rest of the day.

The next morning when I run the program, the problem is back. It returns wrong data for a few runs and after that it runs well for the rest of the day.

The input data for BAPI_DELIVERYPROCESSING_EXEC is always the same, only the result it returns sometimes is wrong. No actual error is returned for any of the bapis.

Any idea why a program would behave like this?

Add a comment
10|10000 characters needed characters exceeded

  • If I were in the same situation, and If I couldn't guess what's different between the morning erroneous runs and the rest of the day, I would add temporarily some ABAP code to trace some information which could be useful to analyze the issue.

  • Very mysterious. In my experience, a lot of the initially mysterious stuff can be traced back to authorization issues of some sort. No idea how this would be the case here though.

    Try to capture both scenarios as an ST12 trace (= ABAP and SQL combined), you can then compare two traces and see where processing logic or SQL accesses deviate.

  • Just a thought - Is there some parallel program scheduled in the system which uses the same BAPI ?...Else Sandra's and Thoma's suggestions as very concrete. I have expereinced some weird issues due to authorization so SU53 can also be looked into.

Related questions

1 Answer

  • Posted on Jun 18, 2019 at 10:56 AM

    may be you have to wait after running first bapi.

    "wait up to 3 seconds."

    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.