11-23-2009 10:02 AM
Hi,
I am using BAPI_SALESORDER_CHANGE FM, I am trying to use the Update flag as 'U' I have passed the HEader and HEader_inx with sales area and the sales order number. In Item I have passe item number, material number, quantity and in Items_INx I have passed Update fklag as 'U' and 'X' to target quantity, and in schedule_lines table again I have passed item number scedule line number and Req_qty and then passed schedule_lines_inx with updateflag as U and req_qty as 'X', the qty which I am giving insterad of getting over written it is adding to the previous value.
For eq if the previous qty value is 10 if I pass 8 using this FM after comminting it is becoming as 18 , is this the functionality of this FM or can we over write the existing qty ?
Any updates ?
Edited by: Varun on Nov 24, 2009 12:33 PM
11-26-2009 5:34 AM
HI Varun,
To Change the Item Quantity you need to pass only item no and material in Item and do not pass target quantity in the Item.
And do the same in Item_inx, so in Item_inx pass only Item number, Update Flag = 'U' and material = 'X'.
In scedule lines you pass item number,sched line and req quantity eq '8'.
In scedule lines inx pass item number,sched line,Update Flag = 'U' and req_qty = 'X'.
wa_order_item_in_chg-itm_number = '000010'.
wa_order_item_in_chg-material = 'YYY'.
APPEND wa_order_item_in_chg TO it_order_item_in_chg.
wa_order_item_inx_chg-itm_number = '000010'.
wa_order_item_inx_chg-updateflag = 'U'.
wa_order_item_inx_chg-material = 'X'.
APPEND wa_order_item_inx_chg TO it_order_item_inx_chg.
wa_schedule_lines_chg-itm_number = '000010'.
wa_schedule_lines_chg-sched_line = '0001'.
wa_schedule_lines_chg-req_qty = '8'.
APPEND wa_schedule_lines_chg TO it_schedule_lines_chg.
wa_schedule_linesx_chg-itm_number = '000010'.
wa_schedule_linesx_chg-sched_line = '0001'.
wa_schedule_linesx_chg-updateflag = 'U'.
wa_schedule_linesx_chg-req_qty = 'X'.
APPEND wa_schedule_linesx_chg TO it_schedule_linesx_chg.