2018 Nov 02 10:20 AM
Hello Folk's i'm struggiling with the bapi in object. I need to changed the edatu at item level, the return of the bapi is that the sales order is changed but no changed is made...
i'm comitting after calling the bapi.
here's my sample code:
ls_header_x-updateflag = 'U'.
assign ls_schdl to <schdl>.
assign ls_schdlx to <schdlx>.
assign ls_items to <items2>.
assign ls_itemsx to <items2x>.
<schdl>-itm_number = '000010'.
<schdlx>-itm_number = '000010'.
<schdl>-sched_line = '0001'.
<schdlx>-sched_line = '0001'.
<items2>-itm_number = '000010'.
<items2x>-itm_number = '000010'.
<schdlx>-itm_number = '000010'.
<schdl>-dlv_date = '20181111'.
append <schdl> to lt_schdl.
<schdlx>-dlv_date = 'U'.
<schdlx>-updateflag = 'U'.
append <schdlx> to lt_schdlx.
<items2x>-updateflag = 'U'.
append <items2> to lt_items.
append <items2x> to lt_itemsx.
*update the data
call function 'BAPI_SALESORDER_CHANGE'
exporting
salesdocument = p_vbeln
order_header_inx = ls_header_x
tables
order_item_in = lt_items
order_item_inx = lt_itemsx
return = lt_return
schedule_lines = lt_schdl
schedule_linesx = lt_schdlx.
read table lt_return assigning <return> with key type = 'E'.
if sy-subrc ne 0.
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'
importing
return = ls_return.
endif.
2018 Nov 13 12:03 AM
thanx y'all but i couldn't solve the issue so i made it by using a batch input 😞 , for now is ok but i will return on it...
2018 Nov 02 12:33 PM
Pass <schdlx>-dlv_date ='X'. instead of <schdlx>-dlv_date ='U'.
2018 Nov 02 1:06 PM
thanx for you reply, but no effects.
the strange things is that even by testing the bapi in se37 (in a sequence with the bapi_commit), i have the same issue.
2018 Nov 02 1:07 PM
pass 'X' on <schdlx>-Field which you pass into this structure <schdl>
2018 Nov 02 1:40 PM
thanx for your replu
<schdlx>-dlv_date ='X'.
But no effects.
2018 Nov 02 3:48 PM
Used Code Like below code With all Mandatory Field E.g : SO , Item , Qty , plant , etc
<schdl>-itm_number ='000010'.
<schdlx>-itm_number ='X'.
<schdl>-dlv_date ='20181111'.
<schdlx>-dlv_date ='X'.
<schdlx>-updateflag ='X;. This field also 'X'
append<schdl>to lt_schdl.
2018 Nov 02 10:10 PM
Hi Marco,
I must admit your code is a little confusing to me but from what I see I cannot see any obvious mistakes other than the on already mentioned.
But I looked up some of my own code, where I am changing a schedule line. I would try to just change the schedule and not the order item.
Cheers,
Peter
2018 Nov 03 2:19 PM
hello Peter, thanx for ur reply can please show me a piece of your code in order to understand where am i missing please?
Thanx again
2018 Nov 05 8:24 AM
Hi Marco,
Check your LT_RETURN: maybe the bapi returns no error but you have some message explaining what's going on.
2018 Nov 13 12:03 AM
thanx y'all but i couldn't solve the issue so i made it by using a batch input 😞 , for now is ok but i will return on it...
2024 Feb 13 5:23 PM - edited 2024 Feb 13 5:31 PM
Hola, disculpa por la tardanza, pero me he topado con el mismo error.
A mí me funcionó pasarle el VGBEL en el SALESDOCUMENT
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = wa_lips-vgbel
order_header_inx = ls_u_header_x
TABLES
return = lt_return
order_item_in = lt_items
order_item_inx = lt_items_x
schedule_lines = lt_schedule_lines
schedule_linesx = lt_schedule_linesx.