Quantcast
Channel: SCN : All Content - SAP ERP - Logistics Materials Management (SAP MM)
Viewing all articles
Browse latest Browse all 6446

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

$
0
0

Dear Friends,


I would like to share with you a scenario, which I've come across in 'PO Release Strategy' and solved by doing a small enhancement, as there was no solution in 'Standard SAP' (confirmed by SAP).


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 (Highest Level)


In standard SAP for the current scenario, SAP has provided a provision to 'Local Purchase Manager' (1st Level) / Finance Manager (2nd Level) to revoke the purchase order, which is released completely by 'General Manager' (3rd Level). Few business advise to restrict this functionality, as they expects the functionality like, once the PO gets released by General Manager, neither Finance Manager nor Local Purchase Manager should have the authorization to revoke the PO, until the Operations Head 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

Method.png


Fucnctional Logic:

  1. Once we go to the transaction ME29N to release the PO, the program would check for the PO release status (Table: MEPO_REL_GENERAL, Field: FRGKX)--> if the PO is not released (FRGKX ≠ R) skip the process-->  if the PO is released completely (FRGKX = R) 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


Viewing all articles
Browse latest Browse all 6446

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>