‎2004 Oct 18 12:33 PM
Dear Reader,
The BAPI_SALESORDER_CHANGE is not changing the ordered quantity when giving the field ITEM-TARGET_QTY a new value.
Another field (reason of rejection ITEM-REASON_REJ)in the same program but in a different occasion is changing definately.
Here by the source:
w_headerx-updateflag = 'U'.
w_itemx-ITM_NUMBER = p_posnr.
w_itemx-updateflag = 'U'.
w_itemx-TARGET_QTY = 'X'.
append w_itemx to t_itemx.
w_item-ITM_NUMBER = p_posnr.
w_item-TARGET_QTY = w_vbap1-kwmeng.
move w_vbap1-kwmeng to w_item-TARGET_QTY.
append w_item to t_item.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
SALESDOCUMENT = p_vbeln
ORDER_HEADER_INX = w_headerx
SIMULATION = ' '
TABLES
RETURN = t_return
ORDER_ITEM_IN = t_item
ORDER_ITEM_INX = t_itemx
Thanks in advance for your support and advise.
Regards,
Adriaan Knappert
06-14337908
‎2004 Oct 18 12:46 PM
‎2004 Oct 18 1:47 PM
Dear Siggi,
Thanks for your reply. I've the call function BAPI_TRANSACTION_COMMIT after my function. So this is not the solution.
Regards,
Adriaan Knappert
‎2004 Oct 18 2:00 PM
Hi, Adriaan,
Have you tried also adding the schedule line information for the related order line as well into the BAPI ?
Kind regards
Colin.
‎2004 Oct 18 4:02 PM
Dear Colin,
Thanks for your further interest. I've added three fields according the schedule lines but still the amount has been unchanged.
w_schedulex-ITM_NUMBER = p_posnr.
w_schedulex-REQ_QTY = 'X'.
w_schedulex-updateflag = 'U'. "ins AAK
w_schedulex-SCHED_LINE = 'X'.
append w_schedulex to t_schedulex.
w_schedule-ITM_NUMBER = p_posnr.
w_schedule-SCHED_LINE = '0001'.
move w_vbap1-kwmeng to w_schedule-req_qty.
Regards,
Adriaan Knappert
‎2004 Oct 19 8:52 AM
Hi,
In your code you do not seem to append W_SCHEDULE to anything. Is it appended to SCHEDULE_LINES ?
Also, are you getting anything returned in the RETURN table when you execute the function ?
Kind regards
Colin
‎2004 Oct 18 1:14 PM
Hi,
Call function BAPI_TRANSACTION_COMMIT after your function.
Kind regards
Colin.
‎2004 Oct 18 1:46 PM
Hi Colin,
Thanks for your reply. I've the call function BAPI_TRANSACTION_COMMIT after my function. So this is not the solution.
Regards,
Adriaan Knappert