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

Dereferencing a DATA type variable….

Former Member
0 Likes
993

Hello Experts!

I have a situation here in the below coding .

I need the content of "fmtab" dynamic table which is there inside lt_table.

types:
BEGIN OF ty_s_tabs,
name 
TYPE tabname,
fmtab
TYPE REF TO data,
END OF ty_s_tabs .

types:
ty_t_tabs
TYPE STANDARD TABLE OF ty_s_tabs .

DATA : lt_table                     TYPE ty_t_tabs.

DATA : ls_table                     TYPE ty_s_tabs.

DATA : lt_table_o                 TYPE REF TO data.
DATA : lt_table_o1                 TYPE REF TO data.

FIELD-SYMBOLS : <lt_table> TYPE any, [Here I have tried with “type any table” also]

READ TABLE lt_table   INTO ls_table  WITH KEY  name = ls_field-structure. [validation is picking one record successfully ]


assign   ls_table-fmtab->* to <lt_table>  .                        [ Not Working]

         

                              Or

         lt_table_o = ls_table-fmtab.               

         assign   lt_table_o->* to <lt_table>  .                            [ Not Working]

Something wrong I am doing here.Do any body have any idea on this to make this correct .

4 REPLIES 4
Read only

Former Member
0 Likes
766

Hi Swarup,

have you tried the following:

Assign <lt_table> on the read instruction. (or rename it ls_table then)

Read only

0 Likes
766

Hello Markus,

Sorry I didn't get your point!!

Can you explain in bit detail .

Here lt_table is a getting filled at run-time with hardcoding .

In lt_table we have a field fmtab which is of type data carrying table structure .

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
766

What exactly should FMTAB contain? Shouldn't it contain the contents of the table GT_TSKLST?

If yes, then (from the screenshot of the debugger) i think that FMTAB is not populated correctly.

Read only

0 Likes
766

Hello Suhas,

You are correct.

its the hard coded data and from bugger what we found that it is carrying the name of the structure .

Id you double click on this you can see the content of the GT_TSKLST.

At this current situation is that possible to access the content of GT_TSKLST?

What you say.