2007 Jun 15 8:01 PM
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.
2007 Jun 15 8:10 PM
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 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.
2007 Jun 15 8:10 PM
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
2007 Jun 15 8:18 PM
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
2007 Jun 15 8:12 PM
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.
2007 Jun 15 8:14 PM
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
2007 Jun 15 8:16 PM
It is possible when user press enter button
use at selection-screen output event.
loop at screen.
endloop.
2007 Jun 15 8:23 PM
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.
2007 Jun 18 4:08 AM
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.
2007 Jun 15 8:49 PM
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.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |