PR Closure using Function Module
Issue : Mark Old Purcahse Requsiton as closed.
Solution : Marking a PR for closure is 10 seconds work, but if the PR is 10 years old and for the same PR material is deleted or vendor or PIR then the sytem will not allow you to close the PR.
We can use fucniton Module : BAPI_REQUISITION_DELETE.
Let me explain with a Example.
1. Consider a PR which was created long back.
2. Go to Tcode SE37 Fucniton Builder and give BAPI_REQUISITION_DELETE.
3. Execute function module and give required PR number.
4. After entering PR number, doble click on Table “REQUISITON_ITEMS_TO_DELETE“, and give line item number of PR and Mark “X” in column “C“.
5. After entering values, come back and execute function module.
6. Please check your PR , PR is marked as Closed.
In this way we can close a PR.
This fucniton module can be used to convert one PR at time.
you can close multiple PR at a time. Please check with your ABAP team members they can create a program using this function module.
I would be very very careful with this function module.
It is an old function module which is only still there because SAP wants to be upward compatible. It has contrary to the standard BAPI design the commit within. Reference OSS note 394058 - BAPI_REQUISITION and COMMIT WORK
And if you really want to use it then make sure you are current with the OSS notes, there are 31 with program fixes since this FM deleted more than it was supposed to do.
thanks a lot for the info. Juergen.
Hi all ,
I benefited from this bapi to change a lot of PR items. Belowed program can be used by developers.
The point of focus that there are two options : Delete indicator and closed. Please check BAPIEBAND structure.
Regards.
M.Ozgur Unal