Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Select-options

Former Member
0 Likes
612

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
588

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.

5 REPLIES 5
Read only

JozsefSzikszai
Active Contributor
0 Likes
588

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

Read only

Former Member
0 Likes
589

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.

Read only

former_member195698
Active Contributor
0 Likes
588

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

Read only

0 Likes
588

Thanks guys..it solved my problem and I awarded points to you.

Read only

Former Member
0 Likes
588

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.