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: 

How to execute a string which contains query in ABAP?

former_member579349
Participant
0 Kudos

I have string variable and i am creating my query dynamically and storing it in string.

Now I want to execute it but my query is a string.

So I am not sure how to execute it.Could you please help me ?

Thanks!

1 ACCEPTED SOLUTION

srikanthnalluri
Active Participant

Try ADBC, refer the demo program - DEMO_ADBC_QUERY

You can pass you query to CL_SQL_STATEMENT, other way is to use the sub routine query. Refer this - Link

4 REPLIES 4

srikanthnalluri
Active Participant

Try ADBC, refer the demo program - DEMO_ADBC_QUERY

You can pass you query to CL_SQL_STATEMENT, other way is to use the sub routine query. Refer this - Link

TMSingh_SAP
Participant

Hi pratish,

Hard to explain..what you need...and what you have done....For a query to get answered you need to give details but befor that check SDN also ..there may be similar queries also..

First show what u r doing or trying to achieve

and the where is the problem coming...

Mohan

0 Kudos

Eg. DATA : STR TYPE STRING VALUE " SELECT QUERY WHICH HAS BEEN DYNAMICALLY CREATED".

is there any way to execute STR?

0 Kudos

It is doable, Use Sub routine pool generated program. I have updated my answer.