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 database table in a select statement

Former Member
0 Likes
855

Please let me know, if the following statement is possible in SAP release 45B?

select * from (tabname) where x = y.

tabname is defined as data: tabname type dd08v-tabname.

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
557

hi ,

take care that table name should be defined as:

data: tabname type dd08v-tabname Value 'MARA.

select * from (tabname) into table itab where x = y.

Revert back if any issues,

Rewadr with points if helpful.

Regards,

Naveen

4 REPLIES 4
Read only

Former Member
0 Likes
557

yes it can possiable.

Read only

0 Likes
557

Hi,

This is correct syntax. without saying INTO TABLE or INTO WORKAREA it won't allow.

select *

from tabname

into table internal_tabname

where conditon.

select *

from tabname

into workarea

where conditon.

Regards,

Surya

Read only

Former Member
0 Likes
558

hi ,

take care that table name should be defined as:

data: tabname type dd08v-tabname Value 'MARA.

select * from (tabname) into table itab where x = y.

Revert back if any issues,

Rewadr with points if helpful.

Regards,

Naveen

Read only

0 Likes
557

Thank you.

I have written the table name in small letters which caused the error.