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

dynamic radiobutton

Former Member
0 Likes
1,237

hello frnds

i have a selection screen on it i have document number. Now the requirement is that besides document number....radiobuttons shuld b added which would b according to USERID, as per the authorisations on his user id user would b able to view the operations he can perform ( each radiobutton denotes a operation of radiobutton).

kindly suggest how to create dynamic radiobutton?

regds

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,199

Hi,

when declaring radiobuttons give user-command addition also...

and then in the event at selection-screen output... write the code for authorization check and based on the check make certain fields visible...

Regards,

Siddarth

5 REPLIES 5
Read only

Former Member
0 Likes
1,200

Hi,

when declaring radiobuttons give user-command addition also...

and then in the event at selection-screen output... write the code for authorization check and based on the check make certain fields visible...

Regards,

Siddarth

Read only

Former Member
0 Likes
1,199

Hi,

at selection-screen output.
if w_flag = 1.
loop at screen.
if screen-group1 CS 'RAD' "----------> Radio button group
screen-active = 1.
modify screen.
endif.
endloop.
endif.

at selection-screen.
if userid = sy-uname.
w_flag = 1.
endif.

thanks

sarves

Read only

awin_prabhu
Active Contributor
0 Likes
1,199

Hi friend,

Use LOOP at Screen in At selection-screen output event.

In parameters, mention all possible radio buttons and group them accordingly to users. (i.e) For every user assign an unique radio button group.

Ex:

At selection-screen output.

LOOP AT SCREEN.

IF sy-name = 'SSI5BAN'.

if IF screen-group1 NE 'INV'. <--- 'INV' is specific to user 'SSI1BAN'

and all other radio button groups are disabled

screen-active = 0.

MODIFY SCREEN.

ENDIF.

ENDIF.

ENDLOOP.

Hope helps u.

Thanks..

Edited by: Sap Fan on Mar 9, 2009 10:50 AM

Read only

former_member203501
Active Contributor
0 Likes
1,199

do like this...

REPORT yztest.

TABLES: mara.

SELECT-OPTIONS: s_matnr FOR mara-matnr.

PARAMETERS:p_rad1 RADIOBUTTON GROUP aaa,

p_rad2 RADIOBUTTON GROUP aaa.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF sy-uname = 'E0000DZ'.

IF screen-name = 'P_RAD1'.

screen-active = 0.

MODIFY SCREEN.

ENDIF.

elseif sy-uname = 'E0000O4'.

IF screen-name = 'P_RAD2'.

screen-active = 0.

MODIFY SCREEN.

ENDIF.

ENDIF.

ENDLOOP.

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,199

Hi,

Create all radiobuttons on screen i.e., for all users.

Now based on the username i.e., current user running the application hide the radiobuttons depending on the authorisation.


parameters : p_rb1 radiobutton group gp1 modif id a1,
             p_rb2 radiobutton group gp1 modif id a2,
             p_rb3 radiobutton group gp1 modif id a3.

AT SELECTION-SCREEN OUTPUT.
  IF sy-uname = '<user_name1>'.
    LOOP AT SCREEN.
      IF screen-group1 = 'A1'.
        screen-invisible = 0. "display
        screen-active = 1.
      ELSEIF screen-group1 = 'A2'.
        screen-invisible = 0. "display
        screen-active = 1.
      ELSEIF screen-group1 = 'A3'.
        screen-invisible = 1. "hide
        screen-active = 0.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
  ELSEIF sy-uname = '<user_name2>'.
    LOOP AT SCREEN.
      IF screen-group1 = 'A1'.
        screen-invisible = 0. "display
        screen-active = 1.
      ELSEIF screen-group1 = 'A2'.
        screen-invisible = 1. "hide
        screen-active = 0.
      ELSEIF screen-group1 = 'A3'.
        screen-invisible = 0. "display
        screen-active = 1.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
  ENDIF.

Hope this helps you.

Regards,

Tarun