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

Dynamic select statement

RKSK
Participant
0 Likes
737

Hi Friends,

could we have dynamic internal table in for all entries of select statement

i.e.

i am looking for select like

here gt_table is vbak and it could be any

select vbeln

from vbap

into gt_vbap

for all entries in * (gt_table)*

where ( string clause).

hope every thing is clear .

Thank you

kat

4 REPLIES 4
Read only

Former Member
0 Likes
705

Hi,

if you imply gt_table is a table whoose structure is dynamic. then yes you can pass teh table in for all entries.

You can cretae a dynamic internal table using field symbols.

If you are saying can you pass a variable in for all entries <variable table>. Then i doubt if that is possible.

Read only

Venkat_Sesha
Product and Topic Expert
Product and Topic Expert
0 Likes
705

Just Use this in the declaration part. lv_table TYPE ddobjname,

ref_table_des ?=

cl_abap_typedescr=>describe_by_name( lv_table ).

Assign the structure at runtime

Select will be as follows.

SELECT SINGLE *

FROM (lv_table)

INTO CORRESPONDING FIELDS OF <dy_wa2>

WHERE (tb_where).

Everything here is Dynamic. Hope this helps

Read only

RKSK
Participant
0 Likes
705

HI Friends,

Is there any one who could answer my query??

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
705

Hello Rachit,

Similar question has been discussed in the forum:

BR,

Suhas