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

Dis-abling input field in Selection screen????

Former Member
0 Likes
1,471

Hi Experts,

I hv a selection screen with,

input_fld_1 has the LIST BOX with A, B, C, D, E, F

input_fld_2

input_fld_3 has the LIST BOX

So, my requirement is,

If the user selects/enters A, B, C, D in input_fld_1, the nexe moment/second (here, prog. shuld not ask the user to press any button)

the input_fld_3 shuld b automatically dis-abled!

So, Is it possible? If so How?

thanq.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,440

Hi,

What you need to do is attach a user command to your first list box.

Parameters : p_list1 type <whaterver> user-command <>.

this will trigger the at selection screen event whenever the user enters anything in the first list box.

AT SELECTION-SCREEN.

Loop at screen.

if p_list1 eq 'A' or p_list1 = 'B' or ......

if screen-name = p_list3.

screen-invisible = '1'.

screen-active = '0'.

modify screen.

endif.

endif.

endloop.

do this & it shud work...

Kindly reward points to all helpful answers

Regards,

gaurav

Hi,

What you need to do is attach a user command to your first list box.

Parameters : p_list1 type <whaterver> user-command <>.

this will trigger the at selection screen event whenever the user enters anything in the first list box.

AT SELECTION-SCREEN.

Loop at screen.

if p_list1 eq 'A' or p_list1 = 'B' or ......

if screen-name = p_list3.

screen-invisible = '1'.

screen-active = '0'.

modify screen.

endif.

endif.

endloop.

do this & it shud work...

Kindly reward points to all helpful answers

Regards,

gaurav

8 REPLIES 8
Read only

Former Member
0 Likes
1,441

Hi,

What you need to do is attach a user command to your first list box.

Parameters : p_list1 type <whaterver> user-command <>.

this will trigger the at selection screen event whenever the user enters anything in the first list box.

AT SELECTION-SCREEN.

Loop at screen.

if p_list1 eq 'A' or p_list1 = 'B' or ......

if screen-name = p_list3.

screen-invisible = '1'.

screen-active = '0'.

modify screen.

endif.

endif.

endloop.

do this & it shud work...

Kindly reward points to all helpful answers

Regards,

gaurav

Read only

0 Likes
1,440

Hi

Gaurav has correctly told that User-command needs to be assigned to the parameter.

The code mentioned should be in AT SELECTION-SCREEN OUTPUT.

and screen-input = '0' should set if you want to make it input disabled.

To make it invisible, screen-active = '0' would do.

Regards

Navneet

Read only

Former Member
0 Likes
1,440

Instead, you can check in the AT SELECTION-SCREEN event for the value of input_fld_1, and handle the input accordingly so that the user is aware that the other field will not be relevant (warning message?)

AT SELECTION-SCREEN.

if input_fld_1 eq 'A' or

input_fld_1 eq 'B' or

input_fld_1 eq 'C' or

input_fld_1 eq 'D.

if input_fld_3 ne initial.

input_fld_3 = space.

MESSAGE 'Input field 3 is not relevant and will be ignored.' TYPE 'W'.

endif.

endif.

Read only

0 Likes
1,440

Hi Daniel ...

What you say is true that without a user command this is not possible ...

hence while declaring the parameters / select options we need to add the addition USER-COMMAND .

This will trigger teh user command when something is entered in the box, without the user having to press enter button.

Regards,

gaurav

Read only

Former Member
0 Likes
1,440

It is possible when user press enter button

use at selection-screen output event.

loop at screen.

endloop.

Read only

Former Member
0 Likes
1,440

See the example code :

PARAMETERS: p_vdatu LIKE sy-datum OBLIGATORY modif id bel .

select-options : s_vdatu for sy-datum obligatory modif id rel.

select-options : s_arbpl for RC68A-arbpl modif id arb.

select-options : s_mtart for mara-mtart modif id mta.

  • User Dynamic Selection

at selection-screen output.

select single * from t000md.

loop at screen.

case screen-group1.

when 'REL'.

if not p_old is initial.

screen-input = '0'.

screen-required = '0'.

screen-invisible = '1'.

endif.

modify screen.

when 'BEL'.

if not p_new is initial.

screen-input = '0'.

screen-required = '0'.

screen-invisible = '1'.

endif.

modify screen.

when 'ARB'.

if p_new is initial.

screen-input = '0'.

screen-required = '0'.

screen-invisible = '1'.

endif.

modify screen.

endloop.

Read only

0 Likes
1,440

ThanQ Sheshu,

Some way, UR right!

But, at the same time, Prashanth suggestons is working well i.e. no need of ENTER pressing. but as u sadi, it shuld b in AT SELECECTION SCREEN OUTPUT.

But, now, my requirement changed to make it to SELECT-OPTIONS input filed, I dont know, How to get it done? Am opning a new thread, if u hv any clue, pls. respond.

thanq.

Read only

Former Member
0 Likes
1,440

hi,

for changing the screen fields dynamically, we provide logic under

<b> AT SELECTION-SCREEN OUTPUT.</b>

each and every screen fields attributes are stored in SCREEN table.

for modifying screen fields we can also use MODIFY SCREEN statement.

AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.
       **here write the logic as per your needs.
       if p_list1 eq 'A' and p_list1 = 'B' and  p_list1 = 'C' and p_list1 = 'D'. 
                     if screen-name = p_list3.
                     screen-invisible = '1'.     "  field is suppresed
                     modify screen.             " it modifies the fields before displaying
                 endif.

       endif.
ENDLOOP.

regards,

Ashokreddy.