Application Development and Automation 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: 
Read only

Concatenate problem for Dynamic SQL statements

Former Member
0 Likes
368

Hi Experts ,

I am building Dynamic SQL statements depending on the values which the user enters into the select option parameters .This dynamic query is passed to cl_sql_connection object for querying from another databasse

So i wrote dynamic values for one select option spointof for the database field ppointofdelivery.

loop at spointof.

CONCATENATE ' pointofdelivery between ''' spointof-low''''

' AND ''' spointof-high''''

INTO where_clause .

endloop.

The whereclause has value pointofdelivery between '123' and '124'.(if the user has entered 123 and 124 as values)

This works fine . But my problem is I have to pass the fieldnames and operator dynamically into where_clause depending on User input.

when i am writing code like the below

field_name = ' pointofdelivery '.

operator = '='.

CONCATENATE field_name operator '''spointof-low''' INTO where_clause .

the where_clause contains value

pointofdelivery = ' spointof-low '

and not pointofdelivery = ' 123 ' as expected .

Do you know why this is haapening as it is not taking the value.

Thanks

Arshad

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
324

Hi,

there are lot of function modules..available...to build a where clause based on the select-options..

check the FM FREE_SELECTIONS_RANGE_2_WHERE

Thanks

Naren

1 REPLY 1
Read only

Former Member
0 Likes
325

Hi,

there are lot of function modules..available...to build a where clause based on the select-options..

check the FM FREE_SELECTIONS_RANGE_2_WHERE

Thanks

Naren