I need some help regarding price update of line items which are delivered but not invoiced yet.
I am calling the FM 'BAPI_SALESORDER_CHANGE' and passing the line item (say 10) whose price needs to be updated. This line item is neither delivered nor invoiced. Result, correct change of price for line item 10.
In the above order, i am adding another line item (say 30), which is completely delivered, but I have not yet created an invoice for it. I want that this line item's price should not be changed (as delivery is already created for it). So, in my price update report, I check and filter this line item (10) and pass only line item 30 to the BAPI. Result: not only line item 30 but line item 10 also gets updated with new price!!
I created a new line item(40) and created an invoice for it after completely delivering it. When I call the BAPI now, I again filter the line items 30 and 40 and pass only line item 10 which i want to be updated.
Line item 10 - updated with new price
Line item 30 - updated with new price
Line item 40 - not updated
Any line item that is completely delivered should not be updated with the new price regardless of it having an invoice or not.
I am running a custom report to find the line items that need change and calling the BAPI_SALESORDER_CHANGE and passing those line items to update the price.
This process is updating all line items in the SO that are not invoiced regardless of weather I am passing it to the BAPI or not
As far as i know, the checking of the invoice is in some standard program, and hence had debugged the BAPI and got the FM SD_SALES_DOCUMENT_SAVE which in my opinion is doing the change. But on further debugging I lost track of the tables which were holding the data as the code is flowing through a number of user exits and standard forms.