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

Selection screen dynamic enable and disable

Former Member
0 Likes
1,391

HI all,

I have one requirement like

on selection of redio button my selection screen hould be enable and disable

Like if i select rediobutton tfile then my selection screen block B2 should enable and Block B3 hould be disable

If redio button selscr is selected then my block B3 should be enable and Block B2 should disable

my selection screen code is below

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

PARAMETERS: tfile RADIOBUTTON GROUP g1 DEFAULT 'X'.

PARAMETERS: selscr RADIOBUTTON GROUP g1.

SELECTION-SCREEN END OF BLOCK b1.

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

SELECT-OPTIONS : s_matnr FOR marc-matnr,

s_fkdat FOR vbrk-fkdat OBLIGATORY.

SELECTION-SCREEN END OF BLOCK b2.

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

PARAMETERS : filename TYPE rlgrap-filename.

SELECTION-SCREEN END OF BLOCK b3.

How to do that.

Help me here its urgent tnx in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,042

Hi Lalit,

Check the below code.

TABLES: marc, vbrk.

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

PARAMETERS: tfile RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND rusr.

PARAMETERS: selscr RADIOBUTTON GROUP g1.

SELECTION-SCREEN END OF BLOCK b1.

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

SELECT-OPTIONS : s_matnr FOR marc-matnr MODIF ID abc,

s_fkdat FOR vbrk-fkdat MODIF ID abc.

SELECTION-SCREEN END OF BLOCK b2.

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

PARAMETERS : filename TYPE rlgrap-filename MODIF ID def.

SELECTION-SCREEN END OF BLOCK b3.

AT SELECTION-SCREEN OUTPUT.

*Note: To disable the fields use the below one.

LOOP AT SCREEN.

IF screen-group1 = 'DEF'. "Name field

IF selscr = 'X'.

screen-input = 1.

ELSE.

screen-input = 0.

ENDIF.

MODIFY SCREEN.

ENDIF.

IF screen-group1 = 'ABC'. "Name field

IF selscr = 'X'.

screen-input = 0.

ELSE.

screen-input = 1.

ENDIF.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

*Note: To hide the screen use the below one.

  • LOOP AT SCREEN.

  • IF screen-group1 = 'DEF'. "Name field

  • IF selscr = 'X'.

  • screen-active = 1.

  • ELSE.

  • screen-active = 0.

  • ENDIF.

  • MODIFY SCREEN.

  • ENDIF.

  • IF screen-group1 = 'ABC'. "Name field

  • IF tfile = 'X'.

  • screen-active = 1.

  • ELSE.

  • screen-active = 0.

  • ENDIF.

  • MODIFY SCREEN.

  • ENDIF.

  • ENDLOOP.

4 REPLIES 4
Read only

Former Member
0 Likes
1,042

hi lalit

AT SELECTION-SCREEN OUTPUT

LOOP AT SCREEN

IF R1 EQ 'X' AND GROUP ID 'S2'

SCREEN-INPUT = 0.

MODIFY SCREEN .

ELSE

IF R2 EQ 'X' AND GROUP ID 'S1'

SCREEN-INPUT = 0

MODIFY SCREEN.

ENDLOOP

Read only

Former Member
0 Likes
1,043

Hi Lalit,

Check the below code.

TABLES: marc, vbrk.

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

PARAMETERS: tfile RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND rusr.

PARAMETERS: selscr RADIOBUTTON GROUP g1.

SELECTION-SCREEN END OF BLOCK b1.

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

SELECT-OPTIONS : s_matnr FOR marc-matnr MODIF ID abc,

s_fkdat FOR vbrk-fkdat MODIF ID abc.

SELECTION-SCREEN END OF BLOCK b2.

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

PARAMETERS : filename TYPE rlgrap-filename MODIF ID def.

SELECTION-SCREEN END OF BLOCK b3.

AT SELECTION-SCREEN OUTPUT.

*Note: To disable the fields use the below one.

LOOP AT SCREEN.

IF screen-group1 = 'DEF'. "Name field

IF selscr = 'X'.

screen-input = 1.

ELSE.

screen-input = 0.

ENDIF.

MODIFY SCREEN.

ENDIF.

IF screen-group1 = 'ABC'. "Name field

IF selscr = 'X'.

screen-input = 0.

ELSE.

screen-input = 1.

ENDIF.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

*Note: To hide the screen use the below one.

  • LOOP AT SCREEN.

  • IF screen-group1 = 'DEF'. "Name field

  • IF selscr = 'X'.

  • screen-active = 1.

  • ELSE.

  • screen-active = 0.

  • ENDIF.

  • MODIFY SCREEN.

  • ENDIF.

  • IF screen-group1 = 'ABC'. "Name field

  • IF tfile = 'X'.

  • screen-active = 1.

  • ELSE.

  • screen-active = 0.

  • ENDIF.

  • MODIFY SCREEN.

  • ENDIF.

  • ENDLOOP.

Read only

0 Likes
1,042

Thank you very much dear i got my result with your help wat i want. Your help is really great for me. thank you again.

Read only

0 Likes
1,042

Hi Lalit,

But ... You have forgotten giving me the points.