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' problem

Former Member
0 Kudos

Hi Iam trying to update the customer purchase order number field in the sales order VBKD-BSTKD...Iam using 'BAPI_SALESORDER_CHANGE' for this...but when I execute the program iam seeing that its clearing the purchase order number in the order instead of updating with the new purchase order number...I have pasted the code extract iam using...can anyone tell me what might be the issue...

Any help is appreciated...

Larry

DATA : ireturn TYPE bapiret2 OCCURS 0 WITH HEADER LINE,

iorder_hdr_in TYPE bapisdh1,

iorder_hdr_inx TYPE bapisdh1x,

iorder_number LIKE bapivbeln-vbeln.

MOVE 'newtest' TO iorder_hdr_in-purch_no_c.

MOVE 'U' TO iorder_hdr_inx-updateflag.

MOVE 'X' TO iorder_hdr_inx-purch_no_c.

iorder_number = '0000591574'.

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

EXPORTING

salesdocument = iorder_number

order_hdr_in = iorder_hdr_in

order_header_inx = iorder_hdr_inx

TABLES

return = ireturn.

IF sy-subrc = 0.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'x'.

endif.

2 REPLIES 2

Former Member
0 Kudos

whats the return value you are getting?

0 Kudos

Update...Its working now...Thanks.