Skip to Content
0

Schdule Line Date is not updating in BAPI_SALESORDER_CHANGE

Jan 17, 2017 at 02:22 PM

50

avatar image

Hi,

I have used the BAPI_SALESORDER_CHANGE for updating Schdule Line Date.

But, the bapi always updates the default schdule line as '0001' and other schdule line removes from the sales order.

Please see my written code:

salesdocument = gw_final1-soc_no. " Sales Order No
order_header_inx-updateflag = 'U'.

wa_schedule_lines-itm_number = '000010'.
wa_schedule_lines-sched_line = '0002'.
wa_schedule_lines-req_date = '20170120'.
APPEND wa_schedule_lines TO schedule_lines.
CLEAR wa_schedule_lines.

wa_schedule_linesx-itm_number = '000010'.
wa_schedule_linesx-sched_line = '0002'.
wa_schedule_linesx-req_date = 'X'.
wa_schedule_linesx-updateflag = 'U'.
APPEND wa_schedule_linesx TO schedule_linesx.
CLEAR wa_schedule_linesx.

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = salesdocument
order_header_in = order_header_in
order_header_inx = order_header_inx
TABLES
return = return
schedule_lines = schedule_lines
schedule_linesx = schedule_linesx.
IF sy-subrc = 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
IMPORTING
return = wa_return.
ENDIF.

Please suggest the same.

Regards

Amol Khochare

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers