‎2007 Aug 09 1:09 PM
Hi all,
I have created custom transaction, in that depending on authorization i am calling two different FMs.For that i have created two users both are having acces for the transaction.But one is having display and other change authorization. In the program i am writing following code:
<b>AUTHORITY-CHECK OBJECT 'S_TCODE'
ID 'TCD' FIELD 'ZG'.
ID 'ACTVT' FIELD '02'.
IF sy-subrc = 0.
Displaying 1st FM
else.
Displaying 2nd FM
endif.</b>
TCD value is maintained at table level but ACTVT is not maintained.
Is this a right code.
Regards,
Nilesh
‎2007 Aug 09 1:17 PM
Hi,
there is no ACTVT in this object.
It's used like this.
AUTHORITY-CHECK OBJECT 'S_TCODE'
ID 'TCD' FIELD '__________'.
Look via SU21 and Class AAAB or via doubleclick on S_TCODE in abap.
Regards, Dieter
‎2007 Aug 09 1:18 PM
Hi Nilesh i think u shud use the Tcode SU24.
Here are the steps:
1. Go to transaction SU24.
2. In the t-code give ZTCODE & press execute button.
3. Then press the Change 'Check Indicator'
4. There you can maintain the ACTVT for ur T-Code against the TCD value.
Please award points if u find this helpful.
Suhas
‎2007 Aug 09 1:43 PM
Thank you Suhas for your reply.
I checked SU24 but no values are maintained for ACTVT. but there is another object S_TABU_DIS related with ACTVT , then what should be the nature of my code :
AUTHORITY-CHECK OBJECT 'S_TCODE'
ID 'TCD' FIELD c_tcode.
ID 'ACTVT' FIELD '02'.
IF sy-subrc = 0.
end if.
Is this right.
Regards
Nilesh
‎2007 Aug 09 1:54 PM
The authorisation object S_TCODE does not work in the way you are trying to use it. S_TCODE is checked automatically when any transaction is called and has a simple yes or no result, either user can or cannot run the transaction.
If your transaction has a display and change option you will need to create a new authorisation object (transaction SU21) with field ACTVT and code this check into your program. Then give each user the relevant value in their authorisation role.
Alternatively you could create two transactions, one change and one display, then you can use S_TCODE.
Regards,
Nick