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

appending nested internal table

Former Member
0 Likes
2,402

Hi,

How to append data in nested internal table for eg

data : cht_todo type me59_s_todo.

now me59_s_todo is itself a nested structure having a table me59_t_items

me59_t_items is also a nested structure having a table messages.

No I have to append some value in this me59_t_items - message table

ie cht_todo -> items -> messages

cht_Todo contain items

items contain messages

How to append value in this message table.?

Edited by: Matt on Jun 24, 2009 11:08 AM - added tags

2 REPLIES 2
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,008

There is an exemple on how to append item to a deep structure in [Appending Table Lines|http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb36c8358411d1829f0000e829fbfe/frameset.htm]

Regards,

Raymond

Read only

matt
Active Contributor
0 Likes
1,008
TYPES: BEGIN OF inner_ty,
         a TYPE ...,
         b TYPE ...,
       END OF inner_ty,

       t_inner_ty TYPE STANDARD TABLE OF inner_ty WITH NON-UNIQUE KEY table_line,

       BEGIN OF outer_ty,
         c TYPE ...,
         inner TYPE t_inner_ty,
       END OF outer_ty.

DATA: t_itab TYPE STANDARD TABLE OF outer_ty WITH NON-UNIQUE KEY c,
       ls_wa_outer TYPE outer_ty,
       ls_wa_inner TYPE inner_ty.

* Insert entries
ls_wa_inner-a = '...'.
ls_wa_inner-b = '...'.
INSERT ls_wa_inner INTO TABLE ls_wa_outer-inner.
ls_wa_inner-a = '...'.
ls_wa_inner-b = '...'.
INSERT ls_wa_inner INTO TABLE ls_wa_outer-inner.

ls_wa_outer-c = '...'.
INSERT ls_wa_outer INTO TABLE t_itab.

* Read entries
LOOP AT t_itab INTO ls_wa_outer.
  LOOP AT ls_wa_outer-inner INTO ls_wa_inner.
...

READ TABLE t_itab INTO ls_wa_outer WITH TABLE KEY c = ...
LOOP AT ls_wa_outer-inner INTO ls_wa_inner.
...

etc.