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

How to provide authorization.

Former Member
0 Likes
871

Hi all,

In my report program by selecting a radio button and execute it,

it will take to TMG of a table.

Now what i want is, this radio button should be visible only to some set of users and for all others it should not be visible.

(or)

Only for those set of users it should take to the TMG and for others it should display the message as 'You are not authorized to view the table' or they can allowed in only display mode.

Pls provide any suggestion on this.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
815

Hi,

this is pretty simple,

see first u need an authorization object which can be attached into a user profile who has to be given access to this radio button.

If you dont have and existing one use SU21 to create a new one.

then in the

AT SELECTION-SCREEN OUTPUT.

AUTHORITY-CHECK OBJECT 'OBJECT_NAME'

ID 'AUTHORIZATION_FIELD_NAME' FIELD 'value_which_is_required_for_authorization'.

if sy-subrc ne 0. "This means hide the readio button.

loop at screen.

if screen-name = 'FIELD_NAME'.

screen-input = 0.

screen-visible = 0.

modify screen.

endif.

endloop.

endif.

reward points if this helps

Hi all,

In my report program by selecting a radio button and execute it,

it will take to TMG of a table.

Now what i want is, this radio button should be visible only to some set of users and for all others it should not be visible.

(or)

Only for those set of users it should take to the TMG and for others it should display the message as 'You are not authorized to view the table' or they can allowed in only display mode.

Pls provide any suggestion on this.

6 REPLIES 6
Read only

GauthamV
Active Contributor
0 Likes
815

hi,

use som logic like this at the position u want to display it.

if sy-uname <> 'abc'.

message 'You are not authorized to view the table' type 'E'.

endif.

Read only

bpawanchand
Active Contributor
0 Likes
815

HI

store all teh entries in a internal to whom you wanto provide authorization and then check each time whena value is entered .

hope it gave u an Idea

Regards

Pavan

Read only

Former Member
0 Likes
816

Hi,

this is pretty simple,

see first u need an authorization object which can be attached into a user profile who has to be given access to this radio button.

If you dont have and existing one use SU21 to create a new one.

then in the

AT SELECTION-SCREEN OUTPUT.

AUTHORITY-CHECK OBJECT 'OBJECT_NAME'

ID 'AUTHORIZATION_FIELD_NAME' FIELD 'value_which_is_required_for_authorization'.

if sy-subrc ne 0. "This means hide the readio button.

loop at screen.

if screen-name = 'FIELD_NAME'.

screen-input = 0.

screen-visible = 0.

modify screen.

endif.

endloop.

endif.

reward points if this helps

Read only

Former Member
0 Likes
815

In the TMG, environment->modifications->events

U can put ur code there for restricting anything..

Read only

Former Member
0 Likes
815

Hi,

try this short example:

SELECTION-SCREEN: BEGIN OF LINE.

SELECTION-SCREEN: COMMENT 06(30) T_BUT1.

PARAMETERS: P_BUT1 RADIOBUTTON GROUP PRI1.

SELECTION-SCREEN: END OF LINE.

*

SELECTION-SCREEN: BEGIN OF LINE.

SELECTION-SCREEN: COMMENT 06(30) T_BUT2.

PARAMETERS: P_BUT2 RADIOBUTTON GROUP PRI1.

SELECTION-SCREEN: END OF LINE.

*

SELECTION-SCREEN: BEGIN OF LINE.

SELECTION-SCREEN: COMMENT 06(30) T_BUT3.

PARAMETERS: P_BUT3 RADIOBUTTON GROUP PRI1 MODIF ID DS0.

SELECTION-SCREEN: END OF LINE.

*

************************************************************************

AT SELECTION-SCREEN OUTPUT.

*

LOOP AT SCREEN.

IF SCREEN-GROUP1 EQ 'DS0'.

IF P_BUT3 = ' ' AND SY-UNAME <> 'TEST01'.

SCREEN-INPUT = '0'.

SCREEN-INVISIBLE = '1'.

T_BUT3 = SPACE.

MODIFY SCREEN.

ENDIF.

ENDIF.

ENDLOOP.

*

************************************************************************

INITIALIZATION.

*

T_BUT1 = '1. Button'.

T_BUT2 = '2. Button'.

T_BUT3 = '3. Button'.

*

************************************************************************

START-OF-SELECTION.

*

BREAK-POINT.

*

END-OF-SELECTION.

Hope it helps.

regards, Dieter

Read only

Former Member
0 Likes
815

Hi

Go through the link Given Below :

http://help.sap.com/saphelp_nw70/helpdata/en/9f/dbaccb35c111d1829f0000e829fbfe/content.htm

Hope it will helpful to you.

Rewards Points if useful.

Thanks & regards

Nikunj shah