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

How to execute code saved in string variable??

Former Member
0 Likes
585

Hello experts,

I need to execute a select which I obtain concatenating several fields into string variable.

So the select is saved in a string:

var = 'select... from ... where...'.

There is any way to execute that select? ("exec var." or similar??)

thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
478

Hi,

create the select statement in a generated subroutine and pass the values for select.

Search for " Dynamic select: in the forum...

Thanks

2 REPLIES 2
Read only

Former Member
0 Likes
479

Hi,

create the select statement in a generated subroutine and pass the values for select.

Search for " Dynamic select: in the forum...

Thanks

Read only

uwe_schieferstein
Active Contributor
0 Likes
478

Hello Illie

Would it not be possible to use a simple dynamic SELECT, e.g.:


DATA:
  ldo_data   TYPE REF TO data.

FIELD-SYMBOLS:
  <lt_itab>  TYPE TABLE.


CREATE DATA ldo_data TYPE TABLE OF (ld_tabname).
ASSIGN ldo_data->* TO <lt_itab>.

SELECT * from (ld_tabname) INTO TABLE <lt_itab>
   WHERE (ld_clause_string).

Regards

Uwe