Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Authority Check

Former Member
0 Likes
817

Hii ...

I have a small problem ...

how can i check wether a particular user is authorized to execute a transaction or not ...

the issue is .. i have created a Module pool program ... now i need to have a authority check to execute the transaction..

thanks and regards

chandu reddy

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
759

Hii ...

I have a small problem ...

how can i check wether a particular user is authorized to execute a transaction or not ...

the issue is .. i have created a Module pool program ... now i need to have a authority check to execute the transaction..

thanks and regards

chandu reddy

5 REPLIES 5
Read only

Former Member
0 Likes
759

Hello,

Use the authority-check command.


PARAMETERS carr TYPE spfli-carrid. 

AT SELECTION-SCREEN. 
  AUTHORITY-CHECK OBJECT 'S_CARRID' 
    ID 'CARRID' FIELD carr 
    ID 'ACTVT'  FIELD '03'. 

  IF sy-subrc <> 0. 
    MESSAGE 'No authorization' TYPE 'E'. 
  ENDIF. 

If the user has the authority object associated to his profile, the resul of sy-subrc will be 0.

Regards.

Read only

Former Member
0 Likes
759

Create the transaction in SE93 as a dialog transaction for that module pool program / screen.

To start the program, the (normal) user would need the authority for that transaction (object S_TCODE).

I think if you search for "transaction to start a module pool program" then you would probably also have found some hits....

Cheers,

Julius

Read only

Former Member
0 Likes
760
Read only

Former Member
0 Likes
759

Hey Hiiiii guys ....

Thanks for all ur responses ....issue got resolved ....

thanks and regards

chandu reddy

Read only

0 Likes
759

BTW: If you are coding an authority-check statement into your program (as mentioned by David) for object S_TCODE (as mentioned by me - at transaction start), I recommend that you do this by calling function module 'AUTHORITY_CHECK_TCODE' as you might want more than 1 transaction to be able to use this program, but no other.

Cheers,

Julius