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

module pool programing - screen table

Former Member
0 Likes
752

i have use this fm to change screen attributes dynamically like location of screen fields ,invisible ,active etc

AND

also if i am displaying 10 fields one below each other on a screen and on click of a push button , fields 2 to 9 should become invisible and the 10th screen field should be shifted from its original location to a location below 1st screen field

how can i do this ?

do reply

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
726

Hi,

The probleam can be solved by creating double parameters.

For Example.

it has 5 parameters for me if i click radio button 2 the parameter 1 has to be disable and instead of that parameter 5 has to come.

in this the parameter names are different but you can give your selection name for output.

SELECTION-SCREEN BEGIN OF BLOCK r1.

PARAMETERS:

p_r1 RADIOBUTTON GROUP r1 USER-COMMAND change,

p_r2 RADIOBUTTON GROUP r1.

SELECTION-SCREEN END OF BLOCK r1.

PARAMETERS:

p_test1(10) TYPE c,

p_test2(10) TYPE c,

p_test3(10) TYPE c,

p_test4(10) TYPE c,

p_test5(10) TYPE c.

PARAMETERS:

P_TEST52(10) TYPE C MODIF ID P2,

P_TEST22(10) TYPE C MODIF ID P2,

P_TEST32(10) TYPE C MODIF ID P2,

P_TEST42(10) TYPE C MODIF ID P2.

AT SELECTION-SCREEN OUTPUT.

IF p_r2 EQ 'X'.

LOOP AT SCREEN.

IF screen-group1 EQ 'P2'.

screen-invisible = 0.

SCREEN-ACTIVE = 1.

ELSE.

screen-invisible = 1.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ELSE.

LOOP AT SCREEN.

IF screen-group1 EQ 'P2'.

screen-invisible = 1.

SCREEN-ACTIVE = 0.

ELSE.

screen-invisible = 0.

SCREEN-ACTIVE = 1.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

6 REPLIES 6
Read only

Former Member
0 Likes
726
case sy-ucomm.
  when 'PUSH'.
    loop at screen.
          if screen-name eq 'FIELD2' or
            screen-name eq 'FIELD9' or
            screen-invisible = 1.
            modify screen.
          endif.
    endloop.
endcase.
Read only

0 Likes
726

THANKS CHANDRASHEKHAR FOR YOUR REPLY.

BUT...

my screen fields from number 2 to number 9 are getting invisible but the 10 th field remains in its original position

can you give me more details this time

do reply

Read only

0 Likes
726

If your reqirement is to make 2nd and 9th invisible then you can do what Jayanthi had answered.

But if the fields u want to make invisible are not constant then it will be a problem in adjusting them.

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
726

Hi,

One easy way is desing 11 fields and make 2nd field invisible before display.Once the button is clicked,make the 2nd field visible and from 3rd to 11th invisible.

Read only

Former Member
0 Likes
727

Hi,

The probleam can be solved by creating double parameters.

For Example.

it has 5 parameters for me if i click radio button 2 the parameter 1 has to be disable and instead of that parameter 5 has to come.

in this the parameter names are different but you can give your selection name for output.

SELECTION-SCREEN BEGIN OF BLOCK r1.

PARAMETERS:

p_r1 RADIOBUTTON GROUP r1 USER-COMMAND change,

p_r2 RADIOBUTTON GROUP r1.

SELECTION-SCREEN END OF BLOCK r1.

PARAMETERS:

p_test1(10) TYPE c,

p_test2(10) TYPE c,

p_test3(10) TYPE c,

p_test4(10) TYPE c,

p_test5(10) TYPE c.

PARAMETERS:

P_TEST52(10) TYPE C MODIF ID P2,

P_TEST22(10) TYPE C MODIF ID P2,

P_TEST32(10) TYPE C MODIF ID P2,

P_TEST42(10) TYPE C MODIF ID P2.

AT SELECTION-SCREEN OUTPUT.

IF p_r2 EQ 'X'.

LOOP AT SCREEN.

IF screen-group1 EQ 'P2'.

screen-invisible = 0.

SCREEN-ACTIVE = 1.

ELSE.

screen-invisible = 1.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ELSE.

LOOP AT SCREEN.

IF screen-group1 EQ 'P2'.

screen-invisible = 1.

SCREEN-ACTIVE = 0.

ELSE.

screen-invisible = 0.

SCREEN-ACTIVE = 1.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

Read only

Former Member
0 Likes
726

thx