‎2007 Nov 27 5:17 PM
Hi,
I have a select option field on the selection screen.s_sernr.Now when the user enters a range for that like 8576 to 8580. in my s_sernr in get IBT8576 8580
now i want to loop at the sernr and call a function and pass the sernrs i.e one at a time( so i am using loop) but the field to which i am passing is not an internal table like s_sernr so how do i move each value into this field like 8576 then 8577 and so on till 8580.
please reply.
thanks
‎2007 Nov 27 5:21 PM
Hi deepti,
1. if this sernr is like matnr, which is stored in a table,
2. then first do a select query in internal table
select matnr from
mara
into table itab
where matnr in s_sernr.
3. then loop at the table itab, and call the FM each time.
regards,
amit m.
‎2007 Nov 27 5:20 PM
hi,
you have to select the single values into an internal table before the LOOP:
SELECT sernr
INTO gt_...
FROM ...
WHERE sernr IN s_sernr.hope this helps
ec
‎2007 Nov 27 5:21 PM
Hi deepti,
1. if this sernr is like matnr, which is stored in a table,
2. then first do a select query in internal table
select matnr from
mara
into table itab
where matnr in s_sernr.
3. then loop at the table itab, and call the FM each time.
regards,
amit m.
‎2007 Nov 27 5:27 PM
select sernr
into table tb_sernr
from SNUM
where sernr in s_sernr.
loop at tb_sernr.
call your function module passing sernr
endloop.
regards,
abhishek
‎2007 Nov 27 5:33 PM
Thanks guys..it solved my problem and I awarded points to you.
‎2007 Nov 27 5:41 PM
Hi Deepti,
Try this.
TABLES <DBTAB>.
SELECT-OPTIONS S_SERNR FOR <DBTAB>-<FNAM>.
DATA ITAB LIKE TABLE OF <DBTAB>-<FNAM> WITH HEADER LINE.
SELECT <FNAM>
FROM <DBTAB>
INTO TABLE ITAB
WHERE S_SERNR IN S_SERNR.
LOOP AT ITAB.
-
( pass itab to function here )
ENDLOOP.
In this <DBTAB> - Database table what you want
<FNAM> - Field Name
ITAB is used to store all fields in your Range.
Plz Reward your Reward Points will help's me a lot Plz Reward,
Mahi.