‎2009 Jun 24 10:04 AM
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
‎2009 Jun 24 10:10 AM
‎2009 Jun 24 10:14 AM
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.