‎2008 Aug 06 6:26 AM
Dear friends , i made a screen by which user can enter data in the table .....
i want that 'CHANGE' and 'DELETE' pushbutton only responde to only Authorized user for it and for the rest of the user it simply show a message " You are Not authorised to change the record" .
thanks ....in advance .
‎2008 Aug 06 6:58 AM
Hi,
when user clicks on push button write down the below code.
AUTHORITY-CHECK OBJECT 'XYZ'
ID 'F1' FIELD l_c_zd
ID 'F2' FIELD l_tcode
ID 'F3' FIELD p_mawerk.
after that check for sy-subrc i.e.
IF NOT sy-subrc IS INITIAL.
throw a message saying that no authorization.
ENDIF.
in the above code 'XYZ' represnets an authorization object.
create an authiorization object for the fields u want. for example F1, F2 etc.
Regards
Venkat
‎2008 Aug 06 6:33 AM
for this u need to use AUTHORITY_CHECK
u need an authorization object which will have authorization fields.
1.see for authorization to be imposed on a user, u need an authorization object. U can use existing ones in ur system or create a new one use tcode SU21. And u can take help from basis guy in this regard.
2. Once u have the authorication object goto ur program and press the PATTERN button there u will see the AUTHORITY_CHECK option select it and put ur authorization object system will generate the code. Then pass the values and perform validation using SY-SUBRC.
SY-SUBRC = 0. Successfull
SY-SUBRC = 4. Unsuccessfull
SY-SUBRC = 8. Authorization field not specified completely.
if u dont want to use any authorization field put DUMMY in front of it. Like this DUMMY not like this 'DUMMY'
regards
‎2008 Aug 06 6:35 AM
Hello Ram Shankar,
In the function code of the push button, check for the authorization.
use a funtion module to check teh username
give an error message if the user name is incorrect
Regards
Indu
‎2008 Aug 06 6:39 AM
Hi,
I hope the below link will help you.
http://help.sap.com/saphelp_nw04s/helpdata/en/80/1a6873e07211d2acb80000e829fbfe/frameset.htm
Thanks,
Khushbu.
‎2008 Aug 06 7:26 AM
M'am
Given link is helpful, but it is not clear that how to done this job. plz give me suitable answer.
Ram Shanker
‎2008 Aug 06 6:58 AM
Hi,
when user clicks on push button write down the below code.
AUTHORITY-CHECK OBJECT 'XYZ'
ID 'F1' FIELD l_c_zd
ID 'F2' FIELD l_tcode
ID 'F3' FIELD p_mawerk.
after that check for sy-subrc i.e.
IF NOT sy-subrc IS INITIAL.
throw a message saying that no authorization.
ENDIF.
in the above code 'XYZ' represnets an authorization object.
create an authiorization object for the fields u want. for example F1, F2 etc.
Regards
Venkat
‎2008 Aug 06 7:25 AM
Dear Venket
Your answer is helpful but not to clear that i want. plz give me the suitable example like how to create the Authoriztion object and etc.
Ram Shanker
‎2008 Aug 06 7:46 AM
if you want to create an authorization object double click on the object or else go to the transaction code SU21 and click on create icon and enter some name and then create it.
‎2008 Aug 06 12:00 PM