04-11-2018 6:19 PM
Hi,
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
04-11-2018 7: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) ...
04-11-2018 7: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) ...
04-11-2018 11:28 PM
Thanks for your reply Nic.
In fact, that solution was the one’s I had taken into account to achieve my requirement if there wasn’t any chance to do that without TEST.
Best regards.
04-12-2018 6:07 AM
Hi Adrian,
As stated in the BAPI Documentation, you can use Parameter TESTRUN .
"You can use a simulation function before posting the goods movement to check how the data is updated in the database."
Regards
Himanshu
04-12-2018 8:35 AM
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 ...
04-11-2018 11:24 PM
Thanks Roberto, but I already know how bapi’s work. My question is other.
Best regards.
04-16-2018 5:27 PM
I have achieved that calling the bapi in TESTRUN first and if all is right, then I call with COMMIT.
Best Regards
04-16-2018 7:28 PM