Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_SALESORDER_CHANGE

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

former_member188827
Active Contributor
0 Kudos

try using commit work after bapi call or call BAPI_TRANSACTION_COMMIT.

Edited by: abapuser on Mar 29, 2010 1:31 PM

3 REPLIES 3

former_member188827
Active Contributor
0 Kudos

try using commit work after bapi call or call BAPI_TRANSACTION_COMMIT.

Edited by: abapuser on Mar 29, 2010 1:31 PM

Former Member
0 Kudos

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

Former Member
0 Kudos

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