‎2007 Jan 09 8:45 AM
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
‎2007 Jan 09 9:27 AM
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.
‎2007 Jan 09 8:49 AM
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.
‎2007 Jan 09 9:02 AM
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
‎2007 Jan 09 9:11 AM
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.
‎2007 Jan 09 9:07 AM
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.
‎2007 Jan 09 9:27 AM
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.
‎2007 Jan 23 12:28 PM