Skip to Content
0
Former Member
Nov 27, 2011 at 04:27 AM

Can Data Declaration be dynamic?

103 Views

Halo ,

I am trying to build dynamic select clause for a report . I pass all the select options from the report to Class.

In class I have an attribute my_ranges (type table of ref to data).

In the method build_dynamic_clause I write

data: l_range_1 type ref to data,
         l_range_2 type ref to data,
        like that til l_range_10.

*now i read table my_ranges with index addition to this individual variables*
read table my_ranges assigning l_range_1 index 1
like that till 10th index.

*Now I use this individual range variables in select like*
select * from (l_table_name) where field1 in l_range->*
and field2 in l_range_2->* 

Like that

.

The problem is I dont know how many select options is passed from the report . Currently the report is handling only up to 10 select options . I want to make that dynamic by declaring variables (l_range_1 to l_range_n ).

Depending on the my_ranges number of entries ,EACH variables should be declared dynamically and then we can use it in dynamic select .

Is that possible?

Regards

Kallu