Application Development 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: 

store the reference of the rows of a dynamic internal table

Former Member
0 Kudos

My requirement is: I need to store the reference of each of the rows of a dynamic internal table(structure is determined only at the runtime) into a table.

Please throw some light on this to solve this proble.

1 ACCEPTED SOLUTION

matt
Active Contributor
0 Kudos
DATA lp_data TYPE REF TO DATA.
DATA tr_reftable TYPE TABLE OF REF TO DATA.
LOOP AT <itab> ASSIGNING <ls_wa>.
  GET REFERENCE OF <ls_wa> INTO lp_data.
  INSERT lp_data INTO tr_reftable.
ENDLOOP
3 REPLIES 3

Former Member
0 Kudos

Hello,

You mean to say that u will get the structure at runtime.

We can get the table name if we get the table name it is easy?

Explain it clearly with simple example?

matt
Active Contributor
0 Kudos
DATA lp_data TYPE REF TO DATA.
DATA tr_reftable TYPE TABLE OF REF TO DATA.
LOOP AT <itab> ASSIGNING <ls_wa>.
  GET REFERENCE OF <ls_wa> INTO lp_data.
  INSERT lp_data INTO tr_reftable.
ENDLOOP

Former Member
0 Kudos

Thanks Matt.