‎2007 May 29 3:33 PM
Hi experts,
It the user selects one value from dropdown list, it should generate one select-option using that name. Is it possible?
for example, (pls see my code).
If user selects 'Malek' from parameter, <b>and press 'ENTER'</b>
<b>select-option should display with that name</b> like
Malek malek-low malek-high
And if user selects some other like 'Amran'. It should generate(and append)
Malek malek-low malek-high
amran amran-low amran-high
and so on....
report c.
data: t_return like ddshretval occurs 0 with header line.
data: begin of t_names occurs 0,
name like usr01-bname,
end of t_names.
parameters : i_inspec like usr01-bname.
at selection-screen on value-request for i_inspec.
perform get_names.
form get_names.
t_names-name = 'Malek'.
append t_names.
t_names-name = 'Amran'.
append t_names.
t_names-name = 'Ow CC'.
append t_names.
t_names-name = 'titbit'.
append t_names.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'T_NAMES-NAME'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'I_INSPEC'
value_org = 'S'
tables
value_tab = t_names.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno with
sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
read table t_return index 1.
endform. "GET_NAMES
Reward guaranteed,
thanks
kaki
‎2007 May 29 3:37 PM
Use At selection-screen output,use screen internal table..
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.
when 'MTA'.
if p_new is initial.
screen-input = '0'.
screen-required = '0'.
screen-invisible = '1'.
endif.
modify screen.
endcase.
endloop.
‎2007 May 29 4:01 PM
Hi Kaki,
Plz check the code which is in bold.
<b>tables : usr01.</b>
data: t_return like ddshretval occurs 0 with header line.
data: begin of t_names occurs 0,
name like usr01-bname,
end of t_names.
parameters : i_inspec like usr01-bname.
<b>select-options: s_option for usr01-bname modif id m1.</b>
at selection-screen on value-request for i_inspec.
perform get_names.
<b>at selection-screen output.
LOOP AT SCREEN.
IF i_inspec <> ' '.
IF screen-group1 = 'M1'.
screen-active = '1'.
MODIFY SCREEN.
ENDIF.
else.
IF screen-group1 = 'M1'.
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.
s_option-low = i_inspec.
append s_option.</b>
form get_names.
t_names-name = 'Malek'.
append t_names.
t_names-name = 'Amran'.
append t_names.
t_names-name = 'Ow CC'.
append t_names.
t_names-name = 'titbit'.
append t_names.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'T_NAMES-NAME'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'I_INSPEC'
value_org = 'S'
tables
value_tab = t_names.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno with
sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
read table t_return index 1.
endformplz reward points if helpful
Thanks,
Suma.
‎2007 May 29 4:12 PM
Hi suma,
After executing your code, can you see it..!!!
In the place of <b>s_option</b> i need name of the parameter value ( for ex: Malek).
If i select parameer 2 times,
It shoud display 2 values....
Malek selection range
Amran selection range
Thanks
kaki
‎2007 May 29 4:37 PM
Hi
I believe the easier solution is to create a selection-screen with all select-options u can need, and after user selection u should decide which select-options has to be active.
Max
‎2007 May 29 4:45 PM