Skip to Content
0
Former Member
Sep 15, 2005 at 09:40 PM

Dynamic select statement

23 Views

Hi,

i have an internal table itab_number_date with fields

number and date. i need to fetch values based on this table.

i need to use validation based on number and date (to include date only IF DATE IS GREATER THAN CURRENT DATE ).

such as

if itab_number_date-date > currentdate.

select ..... field1 = itab_number_date-number and

date = int_number_date-date.

else.

select ...field1 = itab_number_date-number.

endif.

Is there any way to dynamically build a select statement with array fetch by using 'for all entries in internal table' , (TO INCLUDE DATE VALIDATION ONLY IF DATE IS GREATER THAN CURRENT DATE ) rather than doing that in a loop with an if condition?.

your help would be appreciated.

Thanks,

ravi.