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-option parameter passed to function module

Former Member
0 Likes
1,298

hi,

I have passed the select-option parameter as a table to my function module,

suppose i have passed it as date(it contains field date-high and date-low)

In my function module while i am looping the table and selecting the data according to date_low,it is going to select only the data according to date_low.

since the table contains only one row.

loop at date.

select the data according to date_low.

,...

date_low = date_low +1.

modify date_low.

endloop.

how can i select all the data from date_low and date_high?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,008

Hi,

Do like this.

while date-low LE date-high.

select the data according to date_low.

,...

date-low = date-low +1.

endwhile.

Regards,

Jagadish

8 REPLIES 8
Read only

Former Member
0 Likes
1,009

Hi,

Do like this.

while date-low LE date-high.

select the data according to date_low.

,...

date-low = date-low +1.

endwhile.

Regards,

Jagadish

Read only

Former Member
0 Likes
1,008

explain reason. why you are looping by internal table?

where will you use that range of values between date-low and date-high?

Read only

0 Likes
1,008

Hi Mart,

I am using it for RFC,that's why i have used as select-option statement and passed

it as itab,for range also i have to pass it as itab.I can pass the itab,but the problem is

I am not able to loop it,it is going to select only date_low

Read only

0 Likes
1,008

In your FM declare a range and populate your low and high

date , use this range in select ..

ranges : r_date for sy-datum.

r_date-sign = 'I' .

r_date-option = 'BT'.

r_date-low = date_low.

r_date-high = date_high.

append r_date.

select * from <table> into ...

where date in r_date.

Read only

former_member195383
Active Contributor
0 Likes
1,008

loop at date.

date-high = date-high+1.

date-low = date-low+1.

modify date index sy-tabix.

endloop.

Read only

0 Likes
1,008

Hi

Instead of looping at select option table u can specify date table with select query itself

like

Select * from table into internal_table

where xyz_date in date.

Rizwan

Read only

Former Member
0 Likes
1,008

Don't pass the date range as separate tables, rather pass it as range table and select the data as using select option.

Read only

Former Member
0 Likes
1,008

Hi,

there is issue design of ur FM .

You have to put 2 table parametrs or 2 import paremeters in the FM ,after that with in the Function module fill the internal table of type ranges (say itab).

After filling the ranges internal table, this can be used in ur select stament just as select option ( select ...where podat in itab)

revrt back if any issues.

regards,

Naveen