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: 

Selection-Screen field enable/disable

Former Member
0 Kudos

Hi,

I have developed a report with a selection-screen.

In the selection-screen there are five fields.

The last field should remain disabled (display only) and if the value of the 4th field is 'P',should the last field become editable.

Please advise, how to do it.

I have tried the following code:

LOOP AT SCREEN.

IF screen-group1 = 'SC2'.

screen-input = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

but this code doesnt work for the event "At selection-screen".

It works for "At selection-screen output".

Thanks in advance.

Regards,

Tejas

6 REPLIES 6

Former Member
0 Kudos

Hi Tejas,

First define your selection-screen. In the AT SELECTION-SCREEN OUTPUT event, check for the value of the third field and if is satisfies your condition, perform the below code, which you have given.

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

LOOP AT SCREEN.

IF screen-group1 = 'SC2'.

screen-input = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

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

Hope this is helpful to you. If you need further information, revert back.

Reward all the helpful answers.

Regards

Nagaraj T

Former Member
0 Kudos

Hi,

It will work in at selection-screen output. But you need to press ENTER.

Check the below code.

parameters: p_char type c,

p_num type i.

at selection-screen output.

loop at screen.

if screen-name = 'P_NUM'.

if p_char = 'P'.

screen-input = 1.

else.

screen-input = 0.

endif.

endif.

modify screen.

endloop.

Edited by: Velangini Showry Maria Kumar Bandanadham on May 14, 2008 2:51 PM

Former Member
0 Kudos

hi this is done in the at selection screen output..

check this example..

parameters:p_test1 type c,

p_test2 type c .

at selection-screen output .

loop at screen .

if p_test1 is initial.

if screen-name = 'P_TEST2'.

screen-input = 0.

screen-output = 0.

modify screen .

endif.

elseif p_test1 = 'P'.

if screen-name = 'P_TEST2'.

screen-input = 1.

modify screen .

endif.

endif.

endloop.

regards,

venkat

Former Member
0 Kudos

hi,

this a sample prog:

Selection-screen begin of block b1 WITH FRAME NO INTERVALS.
Parameters: s1 radiobutton group g1 user-command u1 default 'X',
            p_name(10) MODIF ID M1,
            p_email(20) MODIF ID M1,
            s2 radiobutton group G1.
 Selection-screen end of block b1 .
 Selection-screen begin of block b2 WITH FRAME NO INTERVALS.
Parameters: p_name1(10) MODIF ID M2,
            p_fax(10) MODIF ID M2,
            s_box as checkbox USER-COMMAND U1.
Selection-screen end of block b2.
Selection-screen begin of block b3 WITH FRAME NO INTERVALS.
Parameters: p_name2(10) modif id m3 .
Selection-screen end of block b3.


AT SELECTION-SCREEN OUTPUT.
  IF S_BOX = 'X'.
      LOOP AT SCREEN.
      IF SCREEN-GROUP1 = 'M3'.
        SCREEN-ACTIVE = '0'.
        MODIFY SCREEN.
      ELSE.
        SCREEN-ACTIVE = '1'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.

regards,

madhu

former_member181995
Active Contributor
0 Kudos

Hi Ronak,

use at selection-screen output instead of at selection-screen than it shoud work.

Amit.

Former Member
0 Kudos

Hi

If u have defined parameters , check this

PARAMETERS: p_char1 TYPE c,

p_char2 TYPE c,

p_char3 TYPE c,

p_char4 TYPE c,

p_char5 TYPE c.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF screen-name = 'P_CHAR5'.

IF p_char4 = 'P'.

screen-input = 1.

ELSE.

screen-input = 0.

ENDIF.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

Thanks .