2014 Feb 07 7:20 PM
How to give runtime Authorization
Requirement is like that ..
We are design some application in SAP but this application consider 4 different Tcodes but now main problem is that number of user use this application is 20 so when user go inside the application there related tcode get authorized to use .only when it enter in application
Please Help me out !!!!!!!!!!
2014 Feb 07 7:29 PM
Hi Alok,
Based on sy-uname and sy-tcode values you can code your own error messages based on whether you want to give authorization or not.
Regards,
Harsh Bansal
2014 Feb 07 7:51 PM
Hi,
Create a ztable and maintain all the users who need authorizations in the table,now in the program use a select single statement to check whether,the user id exists or not and based on sy-subrc throw error.
Regards,
2014 Feb 07 8:15 PM
Hi Alok,
Requesting you to check below link.
<link farm removed>
Thanks & Regards,
Abhijit
Message was edited by: Suhas Saha
2014 Feb 08 2:32 AM
Sir ,
They all are login in SAP by same one id , for my application I give new login inside SAP system
Sap user id - Store1
application user id - emp1( very up to 20 person in same department )
according to emp1 I want to give authorization .
2014 Feb 08 2:52 AM
Hi Alok,
In this case, develop new screen before going to application.
Catch the employee number or any unique number and maintain the authorization in ztable based on the unique number. Now check the authorization based on the number.
Then only you can achieve the same.
Arivazhagan S
2014 Feb 08 3:02 AM
2014 Feb 08 3:37 AM
Hi Alok,
Suppose, if you want to check for ME51N(PR Creation).
Create new screen to enter the emp number and password and create TCode like ZME51N.
Valid the emp number with HR tables and also validate the authorization of TCode using ZTable.
Then Export and import the Emp number thro user exit or BAdi and store into EBAN table and field name is Tracking number for reference.
Arivazhagan S
2014 Feb 08 4:41 AM
Alok,
Say your main application tcode is A and you have another tcodes b c d which is called inside A and can be called directly as well
you can achieve this by
1. setting a memory and pass the entry t code to the application and store it eg: so while u enter in the application the value will be say A
,2. Now u enter in your application. For each t codes at the begining, Import the memory and check whether the tcode value is A if yes proceed else throw an error message
3. If some one enters the tcode directly, the memory value will be empty, so your check fails and he gets an error and cannot proceed
Further you can validate the user id if you wish to restrict the users in the application entry point
2014 Feb 08 9:51 AM
Hi Alok,
I think u have to create new screen for this.
Thanks to Arivazhagan S.
I tried with your solution, and yes its working fine. Nice one.
Regards
Arnab