Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Reject PR Programmatically

suwandi_cahyadi
Contributor
0 Likes
2,511

Hi,

How to reject PR programmatically?

I found this BAPI_REQUISITION_RESET_RELEASE to cancel release. But this BAPI does not set the EBAN-BANPR (Proc. state) to '08' (Release Refused).

Thank you.

1 ACCEPTED SOLUTION
Read only

Nicolas
Active Contributor
2,177

Hello,

It seems that it is not possible to reject a purchase requisition with a BAPI. Check note https://launchpad.support.sap.com/#/notes/2012650 for more information.

You could debug ME54N to find how the system rejects a purchase requisition.

Tip: Have a look in method IF_RELEASABLE_MM~INITIATE_RELEASE of class LCL_REQ_HEADER in function group MEREQ.

Regards

4 REPLIES 4
Read only

Nicolas
Active Contributor
2,178

Hello,

It seems that it is not possible to reject a purchase requisition with a BAPI. Check note https://launchpad.support.sap.com/#/notes/2012650 for more information.

You could debug ME54N to find how the system rejects a purchase requisition.

Tip: Have a look in method IF_RELEASABLE_MM~INITIATE_RELEASE of class LCL_REQ_HEADER in function group MEREQ.

Regards

Read only

2,177

Hi,

Thank you for the reply. I have debugged ME54N, in my case it's in local class LCL_RELVIEW_MM, method execute, line 234 'MEREJECT'. I traced and it seems it updates BANPR to '08'. But I suppose, I am not expected to use the same way as in ME54N because it uses local classes (not sure if we can use those local classes in other programs).

I actually found a way to update BANPR by using BAPI_PR_CHANGE. include program L2105I03 method if_bapi_mereq~map2i_is2erp (line 184), it updates item and itemx from extensionin.

Thank you.

Read only

Nicolas
Active Contributor
0 Likes
2,177

Hi,

Indeed, class LCL_RELVIEW_MM is the class behind the tab "Release strategy" of transactions ME**N. When you click on "Cancel release", the fcode is handled in method execute of lcl_relview_mm which call method IF_RELEASABLE_MM~INITIATE_RELEASE of class LCL_REQ_HEADER.

Are you sure the way you find to update BANPR is correct ? Because, if I check in my system, method if_bapi_mereq~map2i_is2erp calls a BADI (ME_BAPI_PR_IBS) which can only be implemented by SAP.

Regards,

Read only

0 Likes
2,177

Yes, it is for SAP implementation only, but I think we can create implicit enhancement at the end of the method.