03-29-2010 12:28 PM
Hi All,
I am trying to add a line item to a Sales Order using BAPI_SALESORDER_CHANGE (from exit USEREXIT_SAVE_DOCUMENT of SAPMV45A prog).
When I execute the the BAPI separately with my parameters it works fine, but from my code in the USEREXIT or even from a test report program, I am unable to append the line item.
I am effectively passing just mat. no., item categ. and qty., using salesdocument, order_header_inx, order_item_in, order_item_inx, return parameters of BAPI. Also tried passinf schedule lines. But no go.
Please advice if I am missing soemthing. Please help.
Thanks.
03-29-2010 12:31 PM
try using commit work after bapi call or call BAPI_TRANSACTION_COMMIT.
Edited by: abapuser on Mar 29, 2010 1:31 PM
03-29-2010 12:31 PM
try using commit work after bapi call or call BAPI_TRANSACTION_COMMIT.
Edited by: abapuser on Mar 29, 2010 1:31 PM
03-29-2010 12:32 PM
Are you trying to change the sales document which you are currently being processed ? Or you are trying to change some
other sales documents?
Regards
Vinod
03-29-2010 12:35 PM
Hi Barnita,
It did not work because you need to do a commit work after calling BAPI.
Most important thing is you should not use BAPIs in User exits, as Commit work in Exit will create inconsistency.
So you will have to find another method to add the line item, and "not BAPI in User Exit method".
Regards
Srikanth M