01-08-2008 1:24 PM
hi,
This is my select-options.(i am sending part of my code )
s_rzzps for zupi5t-rzzps_posid obligatory no intervals, "WBS Element
at selection-screen.
select from_period to_period from_acct
to_acct ryear rbukrs rzzps_posid
from zfirestate_log
into corresponding fields of table t_data
where ryear eq p_ryear
and rbukrs eq p_rbukrs.
loop at s_rzzps.
IF s_rzzps-low eq t_data-rzzps_posid.
move 'YES' to s_var5.
else.
move 'NO' to s_var5.
ENDIF.
endloop.
what i am doing here is i am checking the entries which r given in the selection screen with the entries in the table zfirestate_log. it the entries r present in the table then i am rising an error message.
but with the above select -options it is defined as no intervals .
when i give multiple options its not checking with all the entries in the selec-options. its checking only the first entry in the header line of s_rzzps( since select options is a table)
with the table entreis.
But i need to check all the entries in s_rzzps .
please help me resolving this issue its required urgently.
Thanks,
Ramya.
01-08-2008 2:22 PM
Hello Ramya,
if you use select-options, the best thing to do is use the IN operator in the where clause.
Something like this should do the trick. I did not test it...
s_rzzps for zupi5t-rzzps_posid obligatory no intervals, "WBS Element
at selection-screen.
SELECT * FROM zfirestate_log
INTO CORRESPONDING FIELDS OF TABLE t_data
WHERE ryear EQ p_ryear
AND rbukrs EQ p_rbukrs
AND rzzps_posid IN s_rzzps.
IF sy-subrc EQ 0.
move 'YES' to s_var5.
ELSE.
move 'NO' to s_var5.
ENDIF.
ENDSELECT