10-20-2008 1:37 PM
Hello every body,
For Sales Order Update , I am using BAPI
" BAPI_SALESORDER_CHANGE ".
I could delete So line item and insert line item, successfully.
But for Updating SO line item,
Im also Updating Schedule lines,
My problem is : while updating my line item with new quantity , it is adding the new quantity with existing quantity.
Reason behind this is , this BAPI is creating a new schedule line rather than updating a existing schedule line.
Udate Flag for schedule line is "U", i am passing schd_line number also for update.
Example :
If existing SO item Qty is 20.
i want to update it to 30, by passing quantity 30 to BAPI.
After executing BAPI.
Present Qty is 50. But i am expecting 30.
Thanks In advance.
Regards
Sunil
10-20-2008 1:47 PM
are you using ORDER_ITEM_INX segment correctly?
10-20-2008 2:09 PM
Hi,
I guess you need to pass the difference of the new and the old quantity.
See in debug mode by putting a break point in the function
SD_SALES_DOCU_MAINTAIN
on line 870. its adding to the schedule line.
I unable to test at the moment with schedule lines thus not sure what happens.
regards,
Advait
10-25-2008 10:03 AM
11-01-2008 6:07 AM
i didn't got any solution. Do u have any solution for this.
I had tried to delete the schedule line and insert a new schedule line for the same.
But it doesn't worked as , my Payment Requisition number will be changed. which is important for PO creation.
If u have any solution for the same, please help me..
Thanks in advance
regards
Ravi
11-03-2008 8:11 AM
Hi,
Did you try to pass the difference between the existing scheulde quantity and the new schedule quantity ?
example if the existing quantity is 20 and you want to update it to 30, pass 30-20 = 10 to the BAPI
regards,
Advait
11-10-2008 12:28 PM
11-11-2008 5:19 AM
i face same problem but now i solve .
u can pass schedule line (vbep-etenr) with order item (vbap-posnr)
then append it and then pass into bapi like
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = p_vbeln
order_header_in = i_hdr
order_header_inx = i_hdrx
TABLES
return = i_ret
schedule_lines = i_sched
schedule_linesx = i_schedx.
11-11-2008 6:44 AM
Thanks a lot for all your help and support.
I had solved this issue.
Problem was :
while passing schedulelinesx to bapi, i was passing 'X' in the schedule line item, but we are supposd to pass line item munber, as we are passin item_number as posnr in item -X table.
Regards
Sunil