Application Development 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: 

Dyanamic Where with IN Clause

Former Member
0 Kudos

Hi,

I have written the following query

SELECT (list) FROM (t_condtables-tabname)

INTO CORRESPONDING FIELDS OF TABLE <dyn_table>

FOR ALL ENTRIES IN itab_kschl

WHERE kschl = itab_kschl-kschl AND

(lt_table).

when I passing the dyanamic where clause as folows

lt_table means ( KAPPL = ' V ' and vkorg in s_vkorg and kschl in s_kschl )

I am getting the error in "IN" clause , Please suggest how to pass "IN" clause in the above senario as the sap understand IN clause as Fieldname in (o1,o2,o3) like but I have to pass as select option (Select options I have already declared)

thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

You cannot pass variables in the dynamic IN class. They have to be values.

Change like:

SELECT (list) FROM (t_condtables-tabname)

INTO CORRESPONDING FIELDS OF TABLE <dyn_table>

FOR ALL ENTRIES IN itab_kschl

WHERE kschl = itab_kschl-kschl AND

(lt_table) and

and vkorg in s_vkorg and kschl in s_kschl .

where (lt_table) = ( KAPPL = 'V' ).

Regards

Subramanian

2 REPLIES 2

Former Member
0 Kudos

Hi,

You cannot pass variables in the dynamic IN class. They have to be values.

Change like:

SELECT (list) FROM (t_condtables-tabname)

INTO CORRESPONDING FIELDS OF TABLE <dyn_table>

FOR ALL ENTRIES IN itab_kschl

WHERE kschl = itab_kschl-kschl AND

(lt_table) and

and vkorg in s_vkorg and kschl in s_kschl .

where (lt_table) = ( KAPPL = 'V' ).

Regards

Subramanian

Former Member
0 Kudos

Hi Bobby,

Try and use the following code.

SELECT (list) FROM (t_condtables-tabname)

INTO CORRESPONDING FIELDS OF TABLE <dyn_table>

FOR ALL ENTRIES IN itab_kschl

WHERE kschl = itab_kschl-kschl

AND KAPPL = ' V '

AND vkorg IN s_vkorg

AND kschl in s_kschl.

Regards,

Subhrangsu