Wednesday, 29 November 2017

Revoke User to Release TR

In this doc we will discuss various methods to restrict the user to release the Transport request in SAP.

THis scanerio is used when you are having third party support and you want to check all TRs at your end and dont want to give them authorization to release the TRs.

We don’t have any enhancement points in program so we will go with BADI.

First Method: Authorization Check Method


This is a little bit complex method but you will learn authorization object creation & using it in SAPUser Roles.

Go to SU21:

SAP ABAP Development, SAP ABAP Guides, SAP ABAP Tutorials and Materials, SAP ABAP Certificatons

Fill the Object name, class, authorization field:

SAP ABAP Development, SAP ABAP Guides, SAP ABAP Tutorials and Materials, SAP ABAP Certificatons

Click on permitted activities & fill Release Code activity i.e. 43:

SAP ABAP Development, SAP ABAP Guides, SAP ABAP Tutorials and Materials, SAP ABAP Certificatons

Now save it all.

Now Punch Tcode SE19 &

Create Implementation of CTS_REQUEST_CHECK Badi as in following Screenshot:

SAP ABAP Development, SAP ABAP Guides, SAP ABAP Tutorials and Materials, SAP ABAP Certificatons

Select 2nd option which is area to check coding before releasing a request:

SAP ABAP Development, SAP ABAP Guides, SAP ABAP Tutorials and Materials, SAP ABAP Certificatons

Use your coding in this method to restrict as per requirement.

What we have used here is an authorization check, so following is the code:

SAP ABAP Development, SAP ABAP Guides, SAP ABAP Tutorials and Materials, SAP ABAP Certificatons

Save it. Don’t forget to activate it as well as BADI in previous screen.

Now give the user  the Authorization object we created, with the help of BASIS Consultant:

SAP ABAP Development, SAP ABAP Guides, SAP ABAP Tutorials and Materials, SAP ABAP Certificatons

Users having upper listed object (Z_TR_REL) can only release the TR.

Otherwise will have following error while releasing the TR.

SAP ABAP Development, SAP ABAP Guides, SAP ABAP Tutorials and Materials, SAP ABAP Certificatons

JOB Done!!

2nd Method: Table Entries check method


This one is easier as we don’t have to go to every user role. We just have to enter the User name in table & that will be checked while releasing the TR.

Create a Z table with following fields & maintenance view:

SAP ABAP Development, SAP ABAP Guides, SAP ABAP Tutorials and Materials, SAP ABAP Certificatons

SAP ABAP Development, SAP ABAP Guides, SAP ABAP Tutorials and Materials, SAP ABAP Certificatons

Save & Activate the Table.

Now open SE19 & do the same procedure as mentioned (to add coding in 2nd option):

SAP ABAP Development, SAP ABAP Guides, SAP ABAP Tutorials and Materials, SAP ABAP Certificatons

Code will be different for this one as it will check the table & the username entered there will not able to release the TR.

NOTE: If you want opposite of this, do following coding in the block:

SAP ABAP Development, SAP ABAP Guides, SAP ABAP Tutorials and Materials, SAP ABAP Certificatons

Now save it. Activate it.

Make entries in table we created earlier:

SAP ABAP Development, SAP ABAP Guides, SAP ABAP Tutorials and Materials, SAP ABAP Certificatons

Now create TR from the SAP ID & Check.

1 comment: