Application Development 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: 

How to Deactivate and Activate the fields in the Selcetion Screen

Former Member
0 Kudos
104

hi to all,

How to Deactivate and Activate the fields in the Selcetion Screen..

Is any one having code for this.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
63

Hi Lokesh,

You can perform active and deactive the fileds in the selection screen using AT SELECTION-SCREEN OUTPUT event. Loop the screen table and modify the content of a screen field inside the loop based on requirements.

Check this code.

selection-screen begin of block b1 with frame.

parameters: p_g1 radiobutton group gp1 default 'X' user-command chk,

p_g2 radiobutton group gp1.

selection-screen end of block b1.

selection-screen begin of block b2 with frame.

parameters: p_gltrp type afko-gltrp modif id g1.

parameters: p_werks type aufk-werks modif id g1.

parameters: p_datum type afko-gltrp modif id g2.

parameters: p_uzeit type aufk-werks modif id g2.

selection-screen end of block b2.

at selection-screen output.

loop at screen.

if p_g1 = 'X' and screen-group1 = 'G2'.

screen-active = 0.

modify screen.

endif.

if p_g2 = 'X' and screen-group1 = 'G1'.

screen-active = 0.

modify screen.

endif.

endloop.

Thanks,

Vinay

4 REPLIES 4

Former Member
0 Kudos
64

Hi Lokesh,

You can perform active and deactive the fileds in the selection screen using AT SELECTION-SCREEN OUTPUT event. Loop the screen table and modify the content of a screen field inside the loop based on requirements.

Check this code.

selection-screen begin of block b1 with frame.

parameters: p_g1 radiobutton group gp1 default 'X' user-command chk,

p_g2 radiobutton group gp1.

selection-screen end of block b1.

selection-screen begin of block b2 with frame.

parameters: p_gltrp type afko-gltrp modif id g1.

parameters: p_werks type aufk-werks modif id g1.

parameters: p_datum type afko-gltrp modif id g2.

parameters: p_uzeit type aufk-werks modif id g2.

selection-screen end of block b2.

at selection-screen output.

loop at screen.

if p_g1 = 'X' and screen-group1 = 'G2'.

screen-active = 0.

modify screen.

endif.

if p_g2 = 'X' and screen-group1 = 'G1'.

screen-active = 0.

modify screen.

endif.

endloop.

Thanks,

Vinay

vallamuthu_madheswaran2
Active Contributor
0 Kudos
63

Hi,

try the below coding.

parameter: name(10) type c.

T SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF screen-name = 'NAME'.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Thanks & regards,

vallamuthu.M

Former Member
0 Kudos
63

Hi,

refer the below code.

i have taken the selection screen fields like.

----


  • S E L E C T I O N S C R E E N *

----


SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-s00.

PARAMETERS: p_test AS CHECKBOX DEFAULT c_x.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN: POSITION 1.

PARAMETERS: r_ppath RADIOBUTTON GROUP g1 DEFAULT 'X'

USER-COMMAND u1.

SELECTION-SCREEN COMMENT 3(10) text-r00. "Local file

SELECTION-SCREEN: POSITION 24.

PARAMETERS: r_dpath RADIOBUTTON GROUP g1.

SELECTION-SCREEN COMMENT 26(10) text-r01.

SELECTION-SCREEN END OF LINE.

PARAMETERS: p_ppath LIKE rlgrap-filename,

p_apath TYPE rlgrap-filename,

p_infile TYPE rlgrap-filename,

p_oufile TYPE rlgrap-filename,

p_erfile TYPE rlgrap-filename.

SELECTION-SCREEN END OF BLOCK b1.

then write the code in the below event.

AT SELECTION-SCREEN OUTPUT.

IF NOT r_ppath IS INITIAL.

LOOP AT SCREEN.

IF screen-name = c_dpath OR

screen-name = c_infile.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

IF NOT r_dpath IS INITIAL.

LOOP AT SCREEN.

IF screen-name = c_ppath.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

here i have taken 2 radio buttons, when i check the one radio button some fields should get disabled, when other some should get enabled and some should get disabled.

Reward if useful.

Thanks,

Sreeram.

Former Member
0 Kudos
63

Hi,

Try this big code.you will definitely get some idea.

Program for radio button selections at selection-screen output.

report zsample.

TABLES:lfm1.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

SELECT-OPTIONS: s_lifnr FOR lfm1-lifnr .

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.

PARAMETERS:

r_asn RADIOBUTTON GROUP rad1 USER-COMMAND uc1 DEFAULT 'X',

r_ers RADIOBUTTON GROUP rad1 ,

r_830 RADIOBUTTON GROUP rad1,

r_850 RADIOBUTTON GROUP rad1,

r_862 RADIOBUTTON GROUP rad1,

r_810 RADIOBUTTON GROUP rad1,

r_820 RADIOBUTTON GROUP rad1,

r_824 RADIOBUTTON GROUP rad1.

SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.

SELECT-OPTIONS: s_bstae FOR lfm1-bstae MODIF ID sd1.

PARAMETERS:

p_ekorg TYPE lfm1-ekorg MODIF ID md1,

p_evcode TYPE edp21-evcode MODIF ID md2,

p_kappl TYPE nach-kappl MODIF ID md3,

p_parvw TYPE nach-parvw MODIF ID md4,

p_kschl TYPE nach-kschl MODIF ID md5,

p_vakey TYPE nach-vakey MODIF ID md6,

p_werks TYPE werks_d MODIF ID md7,

p_bukrs TYPE lfb1-bukrs MODIF ID md8.

SELECTION-SCREEN END OF BLOCK b3.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF r_asn EQ 'X'

AND ( screen-group1 = 'MD3' OR screen-group1 = 'MD4'

OR screen-group1 = 'MD5' OR screen-group1 = 'MD6'

OR screen-group1 = 'MD7' OR screen-group1 = 'MD8' ) .

screen-active = '0'.

screen-invisible = '1'.

screen-input = '0'.

screen-output = '0'.

ELSEIF r_ers EQ 'X'

AND ( screen-group1 = 'SD1' OR screen-group1 = 'MD1'

OR screen-group1 = 'MD2' OR screen-group1 = 'MD3'

OR screen-group1 = 'MD4' OR screen-group1 = 'MD5'

OR screen-group1 = 'MD6' OR screen-group1 = 'MD7'

OR screen-group1 = 'MD8' ) .

screen-active = '0'.

screen-invisible = '1'.

screen-input = '0'.

screen-output = '0'.

ELSEIF r_830 EQ 'X'

AND ( screen-group1 = 'SD1' OR screen-group1 = 'MD1'

OR screen-group1 = 'MD2' OR screen-group1 = 'MD6'

OR screen-group1 = 'MD7' OR screen-group1 = 'MD8' ) .

screen-active = '0'.

screen-invisible = '1'.

screen-input = '0'.

screen-output = '0'.

ELSEIF r_850 EQ 'X'

AND ( screen-group1 = 'SD1' OR screen-group1 = 'MD1'

OR screen-group1 = 'MD2' OR screen-group1 = 'MD6'

OR screen-group1 = 'MD7' OR screen-group1 = 'MD8' ) .

screen-active = '0'.

screen-invisible = '1'.

screen-input = '0'.

screen-output = '0'.

ELSEIF r_862 EQ 'X'

AND ( screen-group1 = 'SD1' OR screen-group1 = 'MD1'

OR screen-group1 = 'MD2' OR screen-group1 = 'MD8' ) .

screen-active = '0'.

screen-invisible = '1'.

screen-input = '0'.

screen-output = '0'.

ELSEIF r_810 EQ 'X'

AND ( screen-group1 = 'MD3' OR screen-group1 = 'MD4'

OR screen-group1 = 'MD5' OR screen-group1 = 'MD6'

OR screen-group1 = 'MD7' OR screen-group1 = 'MD8' ) .

screen-active = '0'.

screen-invisible = '1'.

screen-input = '0'.

screen-output = '0'.

ELSEIF r_820 EQ 'X'

AND ( screen-group1 = 'SD1' OR screen-group1 = 'MD1'

OR screen-group1 = 'MD2' OR screen-group1 = 'MD3'

OR screen-group1 = 'MD4' OR screen-group1 = 'MD5'

OR screen-group1 = 'MD6' OR screen-group1 = 'MD7' ).

screen-active = '0'.

screen-invisible = '1'.

screen-input = '0'.

screen-output = '0'.

ELSEIF r_824 EQ 'X'

AND ( screen-group1 = 'SD1' OR screen-group1 = 'MD1'

OR screen-group1 = 'MD2' OR screen-group1 = 'MD3'

OR screen-group1 = 'MD4' OR screen-group1 = 'MD5'

OR screen-group1 = 'MD6' OR screen-group1 = 'MD7'

OR screen-group1 = 'MD8' ) .

screen-active = '0'.

screen-invisible = '1'.

screen-input = '0'.

screen-output = '0'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

Regds

Sivaparvathi

Please reward points if helpful...