‎2008 Jan 29 1:32 PM
hii
My selection screen is as follow
p_bukrs
s_field2
when user put data in the selection screen i must do a check in the field select option.
i must check if the field S_FIELD2 is maintain for the p_bukrs in the database check table ITAB_CHECK
i have done in the start-of-selection
select data from ITAB_CHECK into INTERNAL_ITAB
LOOP at INTERNAL_ITAB
how do i do the check in the s_field2 with the field INTERNAL_ITAB-FIELD2
ENDLOOP
please helppppp
Edited by: Alvaro Tejada Galindo on Jan 29, 2008 10:43 AM
‎2008 Jan 29 1:35 PM
TRY THIS
select data from itab into <workarea> where
field in s_field.
if sy-subrc <> 0.
message e001.
endif.
s_field is your select option
try doing this
<REMOVED BY MODERATOR>
thanx n keep rockin
vivek
Edited by: Alvaro Tejada Galindo on Jan 29, 2008 10:44 AM
‎2008 Jan 29 1:35 PM
TRY THIS
select data from itab into <workarea> where
field in s_field.
if sy-subrc <> 0.
message e001.
endif.
s_field is your select option
try doing this
<REMOVED BY MODERATOR>
thanx n keep rockin
vivek
Edited by: Alvaro Tejada Galindo on Jan 29, 2008 10:44 AM
‎2008 Jan 29 1:39 PM
no i can't do select where in s_field2 since i need to retrive the data from by p_bukrs only for later minipulation
‎2008 Jan 29 1:54 PM
Write like this ....
select data from ITAB_CHECK into INTERNAL_ITAB
LOOP at INTERNAL_ITAB
if INTERNAL_ITAB-FIELD2 in s_field2.
write logic ...
else.
*write logic
endif.
ENDLOOP
‎2008 Jan 30 7:58 AM
but i am selecting
SELECT * FROM ITAB
WHERE bukrs EQ p_bukrs
and if i do a loop on itab
and compare loop-field2 NE select options
then there may be field in the itab that isn't on the selection screen
and this would give unnecessary message error
‎2008 Jan 30 9:27 AM
If you are only giving single values in select-optins(not range) try the following code.
Loop at s_field2 .
if s_field2-sign eq 'I'.
read table INTERNAL_ITAB into wa with key INTERNAL_ITAB-FIELD2 = s_field2-low.
if sy-subrc ne 0.
Error Message.
endif.
endif.
endloop.
‎2008 Oct 06 6:57 AM