Some times there will be rare scenarios that GR to be done for only few line items in an inbound delivery. In this cases we can use BAPI_GOODSMVT_CREATE to create GR. off course it is well know FM, but there is a reason why I am writing this blog, when we use this BAPI we will come across two issues, those are wired issues and to resolve them I had to struggle a bit, so I wanted to mention those remedies in this blog.
The first issue is Once GR has been create the GR is not showing in the Inbound Delivery document flow, for this we have one FM which can be used to resolve this. i.e SD_DELIVERY_UPDATE.
The Second issue is the Inbound status have not been updated as expected, for this we have a standard program RVDELSTA, after above FM has been called we need to run this program and it will be updated the IBD status as appropriate. actually foe every delivery we can't manually execute this program, so we have to call this program in our program. So, what i did just copied this program and removed the code which gives output. and called the program in my program and issue got resolved.
Those two remedies I just wanted share in this blog, for detailed code check the attachment which may helpful if you stuck in same situation.