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: 

Dynamic deep internal table field symbol

Pradeep_Reddy
Participant
0 Kudos

Hi ,

I have a dynamic deep internal table field symbol, for example

<lfs_data>

Header 1Header 2Header 3Header 4
employee idemployee noxxInternal table[]
employee idemployee noyy
Internal table[]

How to read internal table from the field symbol ? means header 4 .


I tried to loop <lfs_data>, but I am getting dump.


field symbol : <fs> type any table.

loop <lfs_data> assigning <fs>.     "getting dump here"




endloop.


Regards,

K.Pradeep.

5 REPLIES 5

0 Kudos

Can you post a fragment of your code before your LOOP.

Former Member
0 Kudos

As far as I understand your field symbol <lfs_data> has four fields, named Header1 ... Header4, whereby in field Header4 is a deep/internal table.

You can access to it this way:

LOOP AT <lfs_data>-header4 ASSIGNING FIELD-SYMBOL(<fs>).

Or in releases before NW 7.4 SP08:

FIELD-SYMBOLS <fs> LIKE LINE OF <lfs_data>-header4. " or TYPE xyz (whatever your internal table has)

LOOP AT <lfs_data>-header4 ASSIGNING <fs>.

0 Kudos

Yeah Absolutely !

pranay570708
Active Contributor
0 Kudos

Hi Pradeep,

Try below:

Field-symbols: <fs_1> type any,   "Do not specify table

                           <fs_2> type any.

loop at <lfs_data> assigning <fs_1>.

assign component <field number> of structure <fs_1> to <fs_2>.

 

Endloop.

0 Kudos

Hi Pranay,

Thanks for your solution.