09-30-2013 3:57 PM
Hi,
I have a requirement where I need to delete a packaging line item from Outbound Delivery and subsequently block corresponding schedulining line item in Sales order at the line item level. But as per the business logic, this whole activity needs to be performed after checking batch's date of manufature (MCHA-HSDAT or MCH1-HSDAT). Now, I have chosen the exit EXIT_SAPLV50E_003 (Enhancement V50EPROP; called through LT12 after user clicks SAVE). Reason for choosing this exit is, first it provides me with BATCH NUMBER and DELIVERY NUMBER and also, at this step user is certain about using the the selected BATCH. Inside the exit, I have used BAPI BAPI_OUTB_DELIVERY_CHANGE for deleting the delivery line item after checking batch's Date of Manufature and then I used BAPI BAPI_SALESORDER_CHANGE for blocking the corresponding scheduline line item at the item level. After each of these BAPI calls, I called BAPI_TRANSACTION_COMMIT to commit my changes to the respective documents.
I tested this enhancement in the following way -
1. Creat sales order (VA01)
2. Create an outbound delivery (VL01N - with reference to the Sales Order created in Step 1)
3. Create an transfer order (LT03 - with reference to the Delivery created in Step 2)
4. Confirm transfer order (LT12 - with reference to the transfer order created in Step 3)
In LT12 finally, I get the error "Picking quantity larger than delivery quantity". Here, I want to mention that the enhancement is working fine as the delivery line item is getting deleted correctly and the sales order scheduline line item is also getting blocked at item level correctly.
Now, my questions are as follows -
1. Why this error is appearing?
2. How can I make sure that this error doesn't appear?
3. If the choice of exit is right?
Thanks & regards,
Sambaran Ray
09-30-2013 4:04 PM
It sounds like there are picked items attached to the delivery. If so, you can't just delete/cancel lines. You've got to reverse the pick.
Neal
10-01-2013 11:24 AM
Hi Neal,
Thanks for your response. However, I understand the fact that there is a picked item. In this scenario, the delivery has an actual item and two packaging materials. Now, in transfer order only the actual item gets picked as far as I understand. And in my case, I am deleting one of the packaging materials and not the actual item. Correct me, if my understanding is wrong. When I do it manually it doesn't throw any error.
What I meant by manually is, when I delete the delivery line item manully in VL02N after confirming the transfer order in LT12, standard SAP doesn't throw any error.
Regards,
Sambaran Ray
10-01-2013 1:25 PM
Before you do it manually, get into debug. Then do your manual step. I expect that it will go through a number of functions and forms. These will contain what your code is missing.
Neal