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...
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'
salesdocument = iorder_number
order_hdr_in = iorder_hdr_in
order_header_inx = iorder_hdr_inx
return = ireturn.
IF sy-subrc = 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
wait = 'x'.