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

code for selection screen

Former Member
0 Likes
779

hi experts

my requirement is like

User 1 : Normal User.

User 2: Super user.

for User1 selection screen is Name

City

for User2 selection screen is Name

city

address

pincode.

write a selection screen program for above requirement.

i can select user1 or user2, both users should be in one selection screen only

if i select user1 immediately user2 and user2 selectionfields should be display in disable mode

and vise versa.

regds

venky

4 REPLIES 4
Read only

naimesh_patel
Active Contributor
0 Likes
746

Hello,

PARAMETERS: P_USER(10),

P_CITY(10) MODIF ID GP2,

P_ADD(10) MODIF ID GP1,

P_PIN(6) MODIF ID GP1.

At selection-screen output.

loop at screen.

IF P_USER = 'USER2'.

if screen-group = 'GP1'.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDIF.

endloop.

You have to trigger any event,e.g. press ENTER

Regards,

Naimesh

Read only

Former Member
0 Likes
746

Hi,

Write in INITIALIZATION the following code:

if sy-uname = 'user1'.

d_group = 'USR1'.

else.

d_group = 'USR2'.

endif.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = d_group.

  • enable group

screen-enabled = '0'.

screen-output = '1'.

else.

screen-enabled = '1'.

screen-output = '0'.

  • disable group

endif.

ENDLOOP.

You must also define a GROUP in the selection screen that should be diferent for user1 and user2.

Hope it helps.

Regards,

Mireia

Read only

Former Member
0 Likes
746

Hi,



REPORT  ZTESTS                                  .


PARAMETERS: NORMAL RADIOBUTTON GROUP G1 USER-COMMAND ABC DEFAULT 'X',
            SUPER  RADIOBUTTON GROUP G1.


PARAMETERS: CITY1 LIKE ADRC-CITY1,
            CITY2 LIKE ADRC-CITY1,
            ADRNR LIKE ADRC-ADDRNUMBER,
            PSTLZ LIKE ADRC-POST_CODE1.


AT SELECTION-SCREEN OUTPUT.

  IF NORMAL = 'X'.
    LOOP AT SCREEN.
      IF SCREEN-NAME = 'CITY2'.
        SCREEN-INPUT = 0.
      ENDIF.
      .
      IF SCREEN-NAME = 'ADRNR'.
        SCREEN-INPUT = 0.
      ENDIF.

      IF SCREEN-NAME = 'PSTLZ'.
        SCREEN-INPUT = 0.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.


  ELSE.

    LOOP AT SCREEN.

      IF SCREEN-NAME = 'CITY1'.
      SCREEN-INPUT = 0.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.


  ENDIF.

Regards

vijay

Read only

hymavathi_oruganti
Active Contributor
0 Likes
746

DATA: USER1(10), USER2(10).

select-options: name(10) modif id grp1,

city(10) modif id grp1,

addres(30) modif id grp2,

pin(10) modif id grp2.

INITIALIZATION.

USER1 = 'Normal User' ("give the excat user name")

USER2 = 'SUPER'.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SY-UNAME = USER1.

IF SCREEN-GROUP1 = 'GRP1'.

SCREEN-ACTIVE = 1.

ELSE.

SCREEN-ACTIVE = 0.

ENDIF.

ENDIF.

MODIFY SCREEN.

ENDLOOP.