Skip to Content

Call BAPI_GOODSMVT_CREATE several times without COMMIT Issue


I have a requirement which is to create many Goodsmovements for the same material :First 101 and then 343. If 101 fails, then 343 shoundn't be created. If 101 works fine and 343 is wrong, then 101 shouldn't be created.

For that I call BAPI_GOODSMVT_CREATE at first time to create 101, but without doing a COMMIT. After that and if 101 doesn't have any error, I would have to call BAPI_GOODSMVT_CREATE for 343 movement, but at that time I am getting an error because I don't be allowed to do a second bapi call without doing COMMIT work.

How I could achieve that?

Thanks for your time and best Regards

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Apr 11, 2018 at 06:45 PM

    I haven't done anything like this and it feels somewhat strange to me, but you could possibly 'predict' the results using the "TESTRUN"-Parameter? Test the BAPI using your GDSMVT and only proceed to 'real' Execution when you are quite sure what will work ...

    Also there are some hints in the "Goods Movement via BAPI"-Wiki (link) and SAP-KBA's 520813 "FAQ on Good Movement BAPI" (link) ...

    Add comment
    10|10000 characters needed characters exceeded

    • I though as much, however I wanted to raise this as the first / best option.

      I don't know if you can get the multiple BAPI-Calls to work in sequence by calling them in a different LUW using DESTINATION 'NONE'? Even if that would work, it still seems like a 'hacked solution' so I wouldn't be in favour of that ...

      The BAPI uses FM "MB_CREATE_GOODS_MOVEMENT" internally : if you are allowed to use anything other than a BAPI you might try that FM directly (as a last resort)?

      Personally, I would use the 'TEST' and if that doesn't work out, stick to Posting with COMMIT and possibly Retracting the GoodsMovements when necessary ...

  • Apr 16, 2018 at 04:27 PM

    I have achieved that calling the bapi in TESTRUN first and if all is right, then I call with COMMIT.

    Best Regards

    Add comment
    10|10000 characters needed characters exceeded