cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Select query on Dynamic Internal table

Snehal_EWM
Explorer
0 Kudos
217

Hi All,

I am writing select query on dynamically created internal table using method cl_salv_table_create=>create_dynamic_table.  All the below fields are of CHAR90 type.

Where clause of select statement is formulated using FM 'RH_DYNAMIC_WHERE_BUILD'. It always gives dump - value HU01 is not allowed when dynamic  SELECT statement is executed. I tried keeping 'Dist Channel' first and yet same dump.  Can someone help me to know what is the issue

 

Sales OrgDist ChannelDivision
Z001HU0101
Z001HU0102
View Entire Topic
Nadeem_Mohammed
Explorer

Ensure that all fields involved in the dynamic table and the WHERE clause have consistent data types and lengths. Since you're using CHAR90 for all fields, double-check that there are no type mismatches. 

The function module RH_DYNAMIC_WHERE_BUILD might not be constructing the WHERE clause correctly. You can manually construct the WHERE clause to see if that resolves the issue.

Any special characters or spaces in the values are properly escaped. In your case, 'Dist Channel' contains spaces or special characters, they need to be handled appropriately.