11-19-2007 1:19 PM
Hi all.
I have defined a select-options with no intervals. I want to loop through all the values that are input in select-options. Can i use loop at or do i need to fetch the vaues in an itab first?
thanks,
HM
11-19-2007 1:21 PM
11-19-2007 1:21 PM
11-19-2007 1:26 PM
HI Hitesh,
A sample example for looping at selct-options.
tables MARA.
select-option : mat for mara-matnr.
DATA: BEGIN OF ITAB OCCURS 0,
MATNR TYPE MARA-MATNR,
END OF ITAB.
START-OF-SELECTION.
LOOP AT MAT.
MOVE MAT-LOW TO ITAB-MANTR.
APPEND ITAB.
ENDLOOP.
Please reward if usefull.
Thanks,
Gokul.
11-19-2007 1:29 PM
11-19-2007 1:37 PM
11-19-2007 1:54 PM
Hi,
Yes you can use it, below is the sample code :
tables : bsis.
data : count type i.
data : begin of itab occurs 0,
buzei like bsis-buzei,
end of itab.
select-OPTIONS : num for bsis-buzei.
start-of-SELECTION.
count = 1.
do num-high times.
if count = 1.
count = num-low.
move : count to itab-buzei.
append itab.
clear itab.
count = count + 1.
else.
move : count to itab-buzei.
append itab.
clear itab.
count = count + 1.
endif.
if count GT num-high.
exit.
ENDIF.
enddo.
Thanks,
Sriram Ponna.
11-19-2007 1:57 PM
Hi Hitesh
It may not be a good programming practice to Loop at select-options(it will give you the results).
Get all the relevant entries in an itab from the check table or so then loop.
Regards
Arun