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 Disable fields

Former Member
0 Likes
3,340

Hi,

I have a selection screen with 2 radio buttons and 4 fields.When I select the 2nd radio button the 2nd field gets disabled.If I select the first radio button the 2nd field gets enabled only when I press ENTER.Is it possible that the field gets automatically enabled when I click the first radio button. This is possible in screen but I am not able to do this if I make a selection screen.

Please help.

Thanks,

Dishant

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,549

Use addition USER-COMMAND to first radio button.

Check below example:


parameters: p_rd1 radiobutton group rad1 default 'X' user-command but,
            p_rd2 radiobutton group rad1,
            p_text1 type char128,
            p_text2 type char128.

at selection-screen output.

  loop at screen.
     if screen-name CP '*P_TEXT2*'.
        if not p_rd1 is initial.
           screen-active = 1.
        else.
           screen-active = 0.
        endif.
        modify screen.
     endif.
  endloop.

Regards

Eswar

11 REPLIES 11
Read only

Former Member
0 Likes
1,550

Use addition USER-COMMAND to first radio button.

Check below example:


parameters: p_rd1 radiobutton group rad1 default 'X' user-command but,
            p_rd2 radiobutton group rad1,
            p_text1 type char128,
            p_text2 type char128.

at selection-screen output.

  loop at screen.
     if screen-name CP '*P_TEXT2*'.
        if not p_rd1 is initial.
           screen-active = 1.
        else.
           screen-active = 0.
        endif.
        modify screen.
     endif.
  endloop.

Regards

Eswar

Read only

0 Likes
1,549

thanks

Read only

0 Likes
1,549

Hey Dis

Check the example in my earlier post.

Regards

Eswar

Read only

0 Likes
1,549

thanks

Read only

former_member156446
Active Contributor
0 Likes
1,549

Hi Dishant

looks like you placed the code in a wrong event


PARAMETERS: pa_logic RADIOBUTTON GROUP e1 USER-COMMAND inv DEFAULT 'X',
pa_equip RADIOBUTTON GROUP e1,
pa_ob RADIOBUTTON GROUP e1.

PARAMETERS: pa_zpms AS CHECKBOX MODIF ID i1.

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

PARAMETERS :
pa_pex1 TYPE rlgrap-filename MODIF ID i2, " buyers list PC
pa_uex1(200) LOWER CASE MODIF ID i2. " buyers list Unix
SELECTION-SCREEN END OF BLOCK a2.

SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-001.
PARAMETERS:
pa_pex2 TYPE rlgrap-filename MODIF ID i2, "Commercial list PC
pa_uex2(200) LOWER CASE MODIF ID i2. "Commercial list Unix

SELECTION-SCREEN END OF BLOCK a1.


*AT SELECTION-SCREEN OUTPUT.*

IF pa_equip <> 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'I1'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.

IF pa_logic <> 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'I2'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.

Read only

0 Likes
1,549

Hi,

if the parameters are mandatory then with out provide data is it possible to gray out (disable) the field

for example i have 4 fields and 2 radio buttons

first field and 3rd and 4th fields are mandatory fields

when i click on first radio button then 4th fields needs to be disable (gray out).

when i click on second radio button  3rd field needs to be disable (gray out).

.. when i click on first radio button is showing error Like fill all mandatory fields ,

how to solve this? can any one plz suggest me

Read only

Former Member
0 Likes
1,549

I hope

this will resolve your query

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.

PARAMETERS: alv-list RADIOBUTTON GROUP gp1 DEFAULT 'X' USER-COMMAND chk,

alv-grid RADIOBUTTON GROUP gp1.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.

PARAMETERS: s_matnr TYPE mara-matnr MODIF ID g1.

SELECT-OPTIONS: k_matnr FOR mara-matnr MODIF ID g2.

SELECTION-SCREEN END OF BLOCK b2.

*FILE PATH

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

PARAMETERS: p_path(128) TYPE c.

SELECTION-SCREEN END OF BLOCK b3.

PARAMETERS: p_var TYPE slis_vari.

----


  • At Selection-Screen(output)

----


AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF alv-list = 'X' AND screen-group1 = 'G1'.

screen-active = 0.

*screen-intensified = '1'.

MODIFY SCREEN.

ENDIF.

IF alv-grid = 'X' AND screen-group1 = 'G2'.

screen-active = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

reward if helpful

kushagra

Read only

0 Likes
1,549

Hi,

if the parameters are mandatory then with out provide data is it possible to gray out (disable) the field

for example i have 4 fields and 2 radio buttons

first field and 3rd and 4th fields are mandatory fields

when i click on first radio button then 4th fields needs to be disable (gray out).

when i click on second radio button  3rd field needs to be disable (gray out).

.. when i click on first radio button is showing error Like fill all mandatory fields ,

how to solve this? can any one plz suggest me

Geeta

Read only

Former Member
0 Likes
1,549

TRY THIS,

AT SELECTION-SCREEN OUTPUT.

if P_report = 'X'.

loop at screen.

if screen-group1 = 'PTH'.

screen-active = 0.

screen-input = 0.

screen-invisible = 1.

screen-required = 0.

modify screen.

clear screen.

endif.

endloop.

ELSEif P_DOwn = 'X' or P_dw_rp = 'X'.

loop at screen.

if screen-group1 = 'PTH'.

screen-active = 1.

screen-input = 1.

screen-output = 1.

screen-invisible = 0.

*screen-required = 1.

modify screen.

clear screen.

endif.

endloop.

endif.

THANKS,

GAURAV J

Read only

Former Member
0 Likes
1,549

find the below code it may help to your requirement

Report YTEST_DATA.

TABLES:

sscrfields, " Screen Fields

bhdgd. "#EC NEEDED " Common data area

constants:

c_true type c value 'X'.

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

SELECTION-SCREEN: BEGIN OF LINE.

  • Presentation server

PARAMETERS:

pa_pre RADIOBUTTON GROUP rad " Presentation Server

USER-COMMAND app1 DEFAULT 'X'.

SELECTION-SCREEN: COMMENT 8(16) text-004 FOR FIELD pa_pre.

SELECTION-SCREEN:POSITION 31.

  • Presentation Server File

PARAMETERS:

pa_pfile TYPE dynfnam MODIF ID pre. " File on Local drive

SELECTION-SCREEN: END OF LINE.

SELECTION-SCREEN: BEGIN OF LINE.

  • Application server

PARAMETERS:

pa_app RADIOBUTTON GROUP rad. " Application Server

SELECTION-SCREEN: COMMENT 8(22) text-005 FOR FIELD pa_app.

  • SELECTION-SCREEN: END OF LINE.

  • Application Server file

PARAMETERS:

pa_afile LIKE rlgrap-filename

MODIF ID app LOWER CASE. " File Name on Appl.Server

SELECTION-SCREEN: END OF LINE.

SELECTION-SCREEN: END OF block b1.

************************************************************************

  • At Selection-Screen Output

************************************************************************

AT SELECTION-SCREEN OUTPUT.

PERFORM validate_screen.

&----


*& Form validate_screen

&----


  • This routine is used for screen validations

----


  • No interface parameters are required

----


FORM validate_screen .

LOOP AT SCREEN.

IF pa_pre EQ c_true .

CLEAR pa_afile.

IF screen-name EQ 'PA_PFILE'.

screen-input = 1.

ENDIF. " IF screen-name EQ 'PA_PFILE'.

IF screen-name EQ 'PA_AFILE'.

screen-input = 0.

ENDIF. " IF screen-name EQ 'PA_AFILE'

MODIFY SCREEN.

ELSE.

CLEAR pa_pfile.

IF screen-name EQ 'PA_PFILE'.

screen-input = 0.

ENDIF. " IF screen-name EQ 'PA_PFILE'

IF screen-name EQ 'PA_AFILE'.

screen-input = 1.

ENDIF. " IF screen-name EQ 'PA_AFILE'

MODIFY SCREEN.

ENDIF. " IF pa_pre EQ c_true

ENDLOOP. " LOOP AT SCREEN

ENDFORM. " Validate_screen

Read only

Former Member
0 Likes
1,549

Hi,

if the parameters are mandatory then with out provide data is it possible to gray out (disable) the field

for example i have 4 fields and 2 radio buttons

first field and 3rd and 4th fields are mandatory fields

when i click on first radio button then 4th fields needs to be disable (gray out).

when i click on second radio button  3rd field needs to be disable (gray out).

.. when i click on first radio button is showing error Like fill all mandatory fields ,

how to solve this? can any one plz suggest me