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

authorization

Former Member
0 Likes
397

I have developed a screen where I have added seven radio buttons. I want to give authorizations based on user loged in i.e. if user 'A' is log on then he should have access to certain radio buttons and if user 'B' is log on then he should have access to other set of radio buttons.

how to do this ?

Regards,

Santosh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
365

Hello,

Assign the 1st set of radio buttons to group $sel1 and modif id 001.

Assign the 2nd set of radio buttons to group $sel2 and modif id 002.

PARAMETERS: r_button1 RADIOBUTTON GROUP $sel1 MODIF ID 001.

PARAMETERS: r_button2 RADIOBUTTON GROUP $sel2 MODIF ID 002.

In At selection- screen output event make the follwoing checks.

AT SELECTION-SCREEN OUTPUT.

IF sy-uname EQ 'USER1'.

LOOP AT SCREEN.

CASE screen-group1.

WHEN '002'.

screen-output = '0'.

screen-input = '0'.

screen-active = '0'.

MODIFY SCREEN.

ENDCASE.

ENDLOOP.

elseif sy-uname EQ 'USER2'.

LOOP AT SCREEN.

CASE screen-group1.

WHEN '001'.

screen-output = '0'.

screen-input = '0'.

screen-active = '0'.

MODIFY SCREEN.

ENDCASE.

ENDLOOP.

ENDIF.

Regards,

Malathi V.

2 REPLIES 2
Read only

Former Member
0 Likes
365

Hi Santosh,

You have to use LOOP AT SCREEN Logic for this.

Just see the below code snippet & implement the same logic in your requirement.

REPORT z_sel_par.

DATA : w_flag1 TYPE i,

w_flag2 TYPE i.

TABLES: mara,sscrfields.

PARAMETERS: r1 RADIOBUTTON GROUP grp1 DEFAULT 'X',

r2 RADIOBUTTON GROUP grp1.

PARAMETERS: p_matnr LIKE mara-matnr MODIF ID sc1.

SELECT-OPTIONS:s_matnr FOR mara-matnr MODIF ID sc2.

INITIALIZATION.

LOOP AT SCREEN.

IF screen-group1 = 'SC1' OR screen-group1 = 'SC2'.

screen-active = '0'.

MODIFY SCREEN.

CONTINUE.

ENDIF.

ENDLOOP.

AT SELECTION-SCREEN OUTPUT.

IF R1 = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'SC1'.

screen-active = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

CLEAR w_flag1.

ELSEIF R2 = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'SC2'.

screen-active = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

If you execute the above program & you will see two radiobutton on the screen initially. When you select a radiobutton & hit enter you will see SELECT OPTIONS & when you select the other radiobutton & hit enter you will see PARAMETERS.

Implement the above logic in your report.

Kindly set to resolved if it helps you.

Regards

Abhii....

Read only

Former Member
0 Likes
366

Hello,

Assign the 1st set of radio buttons to group $sel1 and modif id 001.

Assign the 2nd set of radio buttons to group $sel2 and modif id 002.

PARAMETERS: r_button1 RADIOBUTTON GROUP $sel1 MODIF ID 001.

PARAMETERS: r_button2 RADIOBUTTON GROUP $sel2 MODIF ID 002.

In At selection- screen output event make the follwoing checks.

AT SELECTION-SCREEN OUTPUT.

IF sy-uname EQ 'USER1'.

LOOP AT SCREEN.

CASE screen-group1.

WHEN '002'.

screen-output = '0'.

screen-input = '0'.

screen-active = '0'.

MODIFY SCREEN.

ENDCASE.

ENDLOOP.

elseif sy-uname EQ 'USER2'.

LOOP AT SCREEN.

CASE screen-group1.

WHEN '001'.

screen-output = '0'.

screen-input = '0'.

screen-active = '0'.

MODIFY SCREEN.

ENDCASE.

ENDLOOP.

ENDIF.

Regards,

Malathi V.