Skip to Content
Author's profile photo Narayana N

Release Strategy: Restrict lower users to revoke PO after the complete release by superior

Dear Friends,


I would like to share with you all a scenario which I’ve come across in ‘PO Release Strategy’, and the requirement has been met by introducing a small enhancement.


Note: There was no solution in ‘Standard SAP’ (confirmed by SAP), thus achieved the requirement thru enhancement


The Scenario:


Example: PO Release Strategy is configured for 3 level as explained below;


1st Level:      L2 – Local Purchase Manager

2nd Level:     L3 –  Finance Manager

3rd Level:      GM – General Manager (Final/Highest Level)


For the above stated release strategy the standard SAP has provided an option to the 1st and 2nd (L2 – Local Purchase Manager & Finance Manager) level approvers to revoke the purchase order, which is released completely by 3rd level (General Manager). Few business advises to restrict this functionality, as they expect the functionality should be like once the PO gets released by General Manager (final approver), neither Finance Manager nor Local Purchase Manager should have the authorization to revoke the PO, until the General Manager revokes it.

Solution:

Restricted the release authorization at the role level for the transaction code ME29N, by doing screen enhancement. Since the requirement is not achievable in standard sap (confirmed by SAP).


Steps:

  1. Go to transaction code ME29N–> enter purchase order number, which is waiting for release–> enter /h (debug mode) in command bar–> then click on ‘Release Strategy’ tab in PO header–>it would take you to the program ‘SAPLMERELVI–> find out for the ‘Include – lmerelvici1–>double click on the include and then go to method ‘HOTSPOT_CLICK–> write the restriction logic for the desired roles as shown in below logic.

Transaction Code: ME29N

Program Name: SAPLMERELVI

Include Program: LMERELVICI1 

In Method: HOTSPOT_CLICK

Method.png

Method2.png


Fucnctional Logic:

  1. Once we go to the transaction ME29N to release the PO, the program would check for the PO release status (Structure: MEPO_REL_GENERAL- FRGKX≠ R or (Just for reference: EKKO-FRGRL=X))–> if the PO is not completely released (FRGKX ≠ R) skip the process–>  if the PO is released completely (FRGKX = R or (Ref: EKKO-FRGRL= ‘ ’)) go to table AGR_USERS (list of users) and check for the role–> if the user has role: ‘GM:GENERAL_MANAGER‘, allow the user to revoke the PO–> if he doesn’t has the given role, display an error message as ‘You are not Authorized to revoke the Release Strategy, until final level revokes the PO

Design.png


ABAP Code:

IF sy-tcode = ‘ME29N’.
TYPES:
BEGIN OF ty_agr_users,
agr_name
TYPE agr_users-agr_name,
uname
TYPE agr_users-uname,
END OF ty_agr_users.

DATA : lv_user TYPE sy-uname,
it_agr
TYPE TABLE OF ty_agr_users,
wa_agr
TYPE ty_agr_users.

if MEPO_REL_GENERAL-FRGKX = ‘R’.

lv_user = sy-uname.
SELECT
agr_name
uname
FROM agr_users
INTO TABLE it_agr
WHERE uname = lv_user.

READ TABLE it_agr INTO wa_agr WITH KEY agr_name = ‘GM:GENERAL_MANAGER’.
IF sy-subrc <> 0.
MESSAGE ‘You are not Authorized to revoke the Release Strategy, until the final level revokes the PO’ TYPE ‘I’ .
EXIT.
ENDIF.
ENDIF.
clear : lv_user,it_agr,wa_agr.
ENDIF.


Result:

Local Purchase Manager is trying to revoke a purchase order, which has already released by Finance Manager & General Manager, but system is throwing an error message, as expected.

Error.png     

Hope this document is clear for you and helps you in your current or future project(s) .

Thank you for reading the document .

Narayana N

Assigned tags

      34 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Ravindra Devarapalli
      Ravindra Devarapalli

      Hi,

      Nice document. Good...

      Regards,

      Ravindra

      Author's profile photo Narayana N
      Narayana N
      Blog Post Author

      Thank you Ravindra 🙂

      Author's profile photo Yosea Sibero
      Yosea Sibero

      Nice one...however dont forget NOT to give tcode ME28 to the approvers, otherwise they can cancel the release through this tcode.

      Author's profile photo Narayana N
      Narayana N
      Blog Post Author

      Thank you Yosea 🙂 , thanx for the suggestion. 🙂

      Author's profile photo Former Member
      Former Member

      Good effort Narayana 🙂

      Author's profile photo Narayana N
      Narayana N
      Blog Post Author

      Thank you Rao 🙂

      Author's profile photo Sudeep A
      Sudeep A

      Dear Narayana,

      Good document. The requirement was there in one of my previous projects. Must be useful for upcoming projects as well..

      By the way.. you could have removed the *BREAK-POINT from the code 😆 Anyway good effort.

      Regards,

      Sudeep.

      Author's profile photo Mehmet Ozgur Unal
      Mehmet Ozgur Unal

      Good effort, keep it up.

      Author's profile photo Narayana N
      Narayana N
      Blog Post Author

      Thank you Sudeep,

      Thanks for telling, I've removed the 'BREAK-POINT' 😉

      Author's profile photo Former Member
      Former Member

      Good Job Narayana 🙂

      Author's profile photo Jinal Patel
      Jinal Patel

      Hi Narayana,

      Good doc. May be useful in future developments.

      Keep it up!

      Regards,

      Jinal Patel

      Author's profile photo Former Member
      Former Member

      Hi Mr.Narayana,

      Too good...

      Regards,

      Dhamotharan.R.

      Author's profile photo Narayana N
      Narayana N
      Blog Post Author

      Thank you Patel & Dhamotharan for your comments 🙂

      Regards,

      Narayana N

      Author's profile photo Former Member
      Former Member

      Nice document Narayana.

      Regards,

      Sri

      Author's profile photo Former Member
      Former Member

      Hello Narayana,

      Nice Idea Keep it up...

      Regards

      Balaraju Muddam

      Author's profile photo Former Member
      Former Member

      Very helpful doc. Thanks for sharing the info.

      Author's profile photo Narayana N
      Narayana N
      Blog Post Author

      Dear Krish Sri, bala raju, SAP FC

      Thank you for the comments 🙂

      Regards.

      Narayana Nagaraju

      Author's profile photo Former Member
      Former Member

      very useful document !! 🙂

      Author's profile photo Swapnil nevrekar
      Swapnil nevrekar

      Good One!

      Best Regards,

      Swapnil

      Author's profile photo Former Member
      Former Member

      Good one..

      Thanks

      Vasuki

      Author's profile photo Former Member
      Former Member

      Hi!

      Nice document.

      Thanks.

      Author's profile photo PRASOON AK
      PRASOON AK

      Nice Document. Thanks for sharing.

      Thanks & Regards,

      AKPT

      Author's profile photo Former Member
      Former Member

      Thanks Narayana. Useful document.

      Regards.

      Satish.

      Author's profile photo Narayana N
      Narayana N
      Blog Post Author
      Author's profile photo Former Member
      Former Member

      Nice Document

      How do we proceed if instead of waiting final approval to restrict users, the revoke stays impossible when my direct superior already approved the PO.

      In you example, if Finance Manager already approved PO, local purchase manager should not be able to revoke PO.

      Thanks for your help.

      Author's profile photo Narayana N
      Narayana N
      Blog Post Author

      Hi Patrick,

      Sorry for the delay in response.

      If you are looking for such an enhancement, please follow the below procedure to achieve it. The method is better in terms of flexibility and for compatibility.

      • Create a custom table as shown below;
      Release Group Release Strategy Release Code Role Name Release Level
      P3 S5 L1 LP:Local_Purchase_Manager X - 1st Level
      P3 S5 L2 FM:Finance_Manager XX -2nd Level
      P3 S5 L3 GM:General_Manager XXX - 3rd Level
      • Write a logic as, whenever a user tries to revoke a purchase order, system should check for the release strategy (EKKO-FRGSX) and current release level (if EKKO-FRGZU=X means the 1st level release is completed, if EKKO-FRGZU=XX means the 2nd level release is completed and so on).

      Release Status.JPG

      • Pass those information to the custom table and find out the release level and relevant role to release/revoke the purchase order
      • Go to table AGR_USERS à pass the user id and find out that which role does the user has, out of specified roles in the custom table for the release strategy
      • If the user has got the role which is highest level (GM=XXX) in the custom table then the system should allow him to revoke the purchase order
      • If the user has got the role which is equal to the current release level then system should allow him to revoke the purchase order
      • If the user has got the role which is lower to the current release level then the system should throw him up an error message as ‘Release not possible as the next level has already released’


      Please let me know, if you require any clarification.

      Thanks & Regards,

      Narayana N

      Author's profile photo Pavithra P
      Pavithra P

      Hi Narayana,

      Wow, what a document! very well explained 🙂 . The language and the flow is really understandable easily. Thanks a lot for sharing such a nice document 🙂

      Keep sharing your knowledge.

      Best Regards.

      Pavithra

      Author's profile photo Narayana N
      Narayana N
      Blog Post Author

      Thank you Pavithra 🙂

      Thanks & Regards,

      Narayana N

      Author's profile photo Former Member
      Former Member

      Nice  Document  Narayana  🙂

      Author's profile photo Former Member
      Former Member

      Super................

      Author's profile photo Former Member
      Former Member

      Hi Narayana,

      Nice Document & very clear explanation with screenshots.

      Thanks

      Ravinder

      Author's profile photo Former Member
      Former Member

      Hi Narayana,

      Could you please help me how to add this solution to release cancellation through ME28 (ALV).

      Author's profile photo Narayana N
      Narayana N
      Blog Post Author

      Hi ismaile samy,

      The procedure is almost same, but I would advise you to get clear understanding of your business requirement, and if the requirement is same as this document, sit with your abaper and ask him to implement the given solution by finding the right spot for the transaction ME28.

      If you require any assistance on any specific question, please do let me know.

      Thanks & Regards,

      Narayana N

      Author's profile photo Former Member
      Former Member

      Good one