‎2006 Mar 28 2:33 AM
hi,
How do I use the CASE statement when the variable is a range (so_mes).
so_mes is defined like a select-options.
i have the next code.
case so_mes-low.
when '01'.
move dobli-wtp01 to oejer.
when '02'.
move dobli-wtp02 to oejer.
when '03'.
move dobli-wtp03 to oejer.
when '04'.
move dobli-wtp04 to oejer.
when '05'.
move dobli-wtp05 to oejer.
when '06'.
move dobli-wtp06 to oejer.
when '07'.
move dobli-wtp07 to oejer.
when '08'.
move dobli-wtp08 to oejer.
when '09'.
move dobli-wtp09 to oejer.
when '10'.
move dobli-wtp10 to oejer.
when '11'.
move dobli-wtp11 to oejer.
when '12'.
move dobli-wtp12 to oejer.
in this case only take the low value. How can I asigned the the high value in the statement CASE?.
‎2006 Mar 28 2:40 AM
‎2006 Mar 28 2:49 AM
I would suggest doing something like this. Allow the user to enter only single values in the select-option, then you can loop at the select-option and process accordingly.
report zrich_0001.
* Type pools
type-pools: slis, sscr.
data: char2(2) type c.
select-options: so_mes for char2.
initialization.
perform initilization.
start-of-selection.
loop at so_mes.
case so_mes-low.
when '01'.
*move dobli-wtp01 to oejer.
when '02'.
*move dobli-wtp02 to oejer.
when '03'.
*move dobli-wtp03 to oejer.
when '04'.
*move dobli-wtp04 to oejer.
endcase.
endloop.
************************************************************************
* INITILIZATION
************************************************************************
form initilization.
* Restrict the select options for SO_MES
* to just a date range
data: selopt type sscr_ass,
opt_list type sscr_opt_list,
restrict type sscr_restrict.
clear opt_list.
opt_list-name = 'EQ'.
opt_list-options-eq = 'X'.
append opt_list to restrict-opt_list_tab.
clear selopt.
selopt-kind = 'S'.
selopt-name = 'SO_MES'.
selopt-sg_main = 'I'.
selopt-sg_addy = ' '.
selopt-op_main = 'EQ'.
selopt-op_addy = 'EQ'.
append selopt to restrict-ass_tab.
call function 'SELECT_OPTIONS_RESTRICT'
exporting
restriction = restrict
exceptions
too_late = 1
repeated = 2
selopt_without_options = 5
selopt_without_signs = 6
invalid_sign = 7
empty_option_list = 9
invalid_kind = 10
repeated_kind_a = 11
others = 12.
endform.
Regards,
Rich Heilman
‎2006 Mar 28 4:09 AM
your question is not clear.
Do you want to do a 'case' on only the so_mes-high? If so you can code it exactly as for the low.
Or do you want to include both low and high in a 'case'?
Although it syntax checks I don't think you can have something like:
case so_mes.
when '01'.
when '02'.
endcase.
Why not just use an 'if'?
if '01' in so_mes.
elseif '02' in so_mes.
endif.
Please give us more info if I haven't guessed what you are asking properly.
‎2006 Mar 28 4:31 AM
Hi Marisol,
Could you pls explain your question more clearly.
You can very well use so_mes-high in the same way as u have used for so_mes-low.
<b>case so_mes-high.</b>
when '01'.
move dobli-wtp01 to oejer.
when '02'.
move dobli-wtp02 to oejer.
when '03'.
move dobli-wtp03 to oejer.Regards,
Anjali