Skip to Content
0
Former Member
Jan 08, 2008 at 11:09 AM

dynamic where clause in loop

93 Views

Hi,

I know dynamic clause works for SELECT.....

e.g.

I built where_clause using concatenate... based on when key fields are available. So sometime where_clause has: A = X-1 and B = X-2. and another time where_clause can have A = X-1 and C = X-5 and D = X-6.....

SELECT * from db into table int_tab where (where_clause)

However I use the same way to build this dynamic where_clause, then used on the loop at statement :

LOOP AT int_tab into int_line

where (where_clause)

I got syntax error : Statement Concluding with ".... (where_clause)" ended unexpectedly.

Any idea to make where clause dynamicly for LOOP?

Thanks.