I have one requirement which is similar to consignment but once the PGI is done ,I want my sales order to get deleted. Is there any standard settings that we can achieve this? or atleast please suggest me any user exit that I can get through with this.
There is no standard way of doing this...But it is simple
As soon as you PGI gets generated in the PGI program ask you ABAPER to call the BAPI to delete the Sales order while saving in the background.
I guess this should work in the back ground incase the system does not lock the Sales order for deletion as it is appearing in the document flow.
Also you can write a background job to delete the (SM36/sm37) searching for the relavent sales orders where the PGI is done and delete them in batches.
the second option can be done at night in batch jobs
There is no standard setting to do this. Only way to do so is through ABAP programming. However I I would advise you not to do this. Reasons are as follow:
- If you delete the sales order, the audit trail is now broken, you have a consignment delivery with material movement without any order.
- Presumably once the customer has consumed the inventory you want to bill him for it. If you deleted the sales order you will have a devil of a time to do billing. Things like pricing info, payment terms etc comes from the sales order.
I am rather interested in your business reasons why you need to delete the sales order after PGI.
If must go and delete the sales order, one place you could do so is to use the delivery user exit MV50AFZ1 where there is a routine on save. Inside this routine you can check for PGI being performed and then proceed to delete the sales order. Be warned, you must do a complete job of deleting everything about this sales order else you will have database inconsistnecies.