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

Selecting data using filed symbol...!

Former Member
0 Likes
812

Hi SDN,

I am using select query in dynamically created table but it's giving me dump AS

You attempted to assign a field to a typed field symbol,

but the field does not have the required type.

DATA : dref TYPE REF TO data.

PARAMETERS : pa_tab TYPE string. "Get Table name from user

CREATE DATA dref TYPE (pa_tab).

FIELD-SYMBOLS : <fs_it_tab> TYPE ANY TABLE.

ASSIGN dref->* TO <fs_it_tab>.

SELECT * FROM (pa_tab) INTO TABLE <fs_it_tab> UP TO 10 ROWS.

7 REPLIES 7
Read only

Former Member
0 Likes
794

try this way.

ASSIGN dref->* TO <fs_it_tab> CASTING TYPE data.

*reward if solved*

Read only

0 Likes
794

Hi Sreejith,

It's giving me syntax error Generic type "DATA" not allowed.

Regards,

Rahul

Read only

0 Likes
794

ASSIGN dref->* TO <fs_it_tab> CASTING like dref.

Read only

0 Likes
794

It's giving again a syntax error as

"DREF" and "<FS_IT_TAB>" are type-incompatible.

Regards,

Rahul

Read only

0 Likes
794

try this..

ASSIGN dref TO <fs_it_tab> casting like dref.

Read only

varma_narayana
Active Contributor
0 Likes
794

Hi Rahul...

This is the code for u. Try it...

DATA : REF_TAB TYPE REF TO DATA.

FIELD-SYMBOLS: <FTAB> TYPE TABLE.

PARAMETERS: P_TABLE TYPE DD02L-TABNAME VALUE 'EKPO'.

CREATE DATA REF_TAB TYPE TABLE OF (L_TABLE).

ASSIGN REF_TAB->* TO <FTAB>.

SELECT * FROM (P_TABLE) INTO TABLE <FTAB>.

DESCRIBE TABLE <FTAB>.

WRITE:/ SY-TFILL.

Note: One more point. We cannot declare PARAMETER with STRING data type.

REWARD IF HELPFU.

Read only

0 Likes
794

Thanks a lot...!