‎2007 Oct 25 11:38 AM
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.
‎2007 Oct 25 11:41 AM
try this way.
ASSIGN dref->* TO <fs_it_tab> CASTING TYPE data.
*reward if solved*
‎2007 Oct 25 11:58 AM
Hi Sreejith,
It's giving me syntax error Generic type "DATA" not allowed.
Regards,
Rahul
‎2007 Oct 25 12:02 PM
‎2007 Oct 25 12:05 PM
It's giving again a syntax error as
"DREF" and "<FS_IT_TAB>" are type-incompatible.
Regards,
Rahul
‎2007 Oct 25 12:11 PM
‎2007 Oct 25 12:17 PM
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.
‎2007 Oct 25 1:01 PM