05-07-2008 7:58 AM
Hi,
I have field (mnt) in select-options.
Now i want to loop through this mnt field . How to do that?
05-07-2008 8:01 AM
05-07-2008 8:01 AM
Hi,
The select option field itself is a table.
loop at <s_field>.
....
...
endloop.
05-07-2008 8:02 AM
ya select-option itselfis a table but when i use this
loop at mnt
endloop.
it reads only first entry and then exits from the loop.
05-07-2008 8:06 AM
hi,
if u give only one value in the selection screen, it will process only one record.
if u give a range it will have 2 values. low and high. it will not populate with all the values between the range into the select-option field.
regards,
madhumitha
05-07-2008 8:07 AM
@madhumita, in mnt i am giving the 1 to 3.
It takes only 1. but i want to loop through 2 and 3 also.
05-07-2008 8:12 AM
hi,
s_mnt-low will have 1
s_mnt- high will have 3.
if u loop it will have only one record. it will not have all the vale between 1 and 3.
when u fetch the data it will use between operator to fetch all the data between 1 and 3.
to understand better:
try this..put a break point in loop at s_matnr.
tables: mara.
select-options: s_matnr for mara-matnr.
loop at s_matnr.
write:/ s_matnr-low.
endloop.
regards,
madhumitha
05-07-2008 8:01 AM
05-07-2008 8:02 AM
If U have values only in low .. then
loop at mnt.
use mnt-low ...
endloop.
05-07-2008 8:03 AM
Hi,
take the value of select option into an internal table and loop it.
wa_itab = s_kna1-low.
append wa_itab to it_itab.
loop at it_itab into wa_itab.
...
...
endloop.
thanks & regards
Kishore Kumar Maram
05-07-2008 12:46 PM
Hello Anurodh-
Select-option is an internal table with header line you can loop an internal table let me know the exact requirement.
Cheers,
~Srini....
05-07-2008 12:57 PM
loop the select option is littel difficut because
when ur looping iti hav to also take to consideration
that if u r select option is in range then it might hav a bplm
supoose ur using vbeln for vbak-vbeln
and ur entering the high and lower limit
i.e vbeln- high and vbeln-low then loop can have a ploblem
itz better in above example
use
+*begin of itvbeln occurs 0,*+_
vbeln type vbeln,
+*end of itvbeln.*+_
selet vbeln from vbak into corressponding field of
+*itvbeln where vbeln in vbeln.*+_
den it might solve ur pblm
it totally depend upon ur program
i might change as depending upon what ur taking as select-option
With Regards
Rohan Shetty
05-08-2008 6:42 AM
Is there any other way so that i acn transfer the data ( in MNT ) into internal table and then loop ino that table.?
05-08-2008 9:38 AM
Hi
Select-option is like a internal table
loop at selection screen .
the logic.
End loop.