In CS Repair Process, by standard, after Post Goods Receipt is done in the delivery; user can only create Service Orders by directly going into VA02(Repair Sales order). Another way is to use report SDREPA01/02 to make the business decision without going in to VA02. The requirement now is to trigger the creation of service order directly after PGI in delivery is done before exiting VL02N(delivery).
We are using FM: SD_REPAIR_ORDER_CONFIRMATION to create the service order directly after PGI is done in VL02N. The service order is created for the item received just after the GR is done and before exiting VL02N.
The solution/FM works for only 1 line item but fails if multiple materials are used in the delivery.
It means that if a delivery is used for let's say 3 materials, then after GR the FM will create service order for only third/last item. The first and second items(materials) won't get a service order created against them. Moreover, we can't even create the service orders for the first 2 items manually(VA02) or via report SDREPA01 after the FM is called(possibly because the system status of the items has already changed to BDMD)