‎2007 Aug 20 8:54 AM
hi... can anybody provide ne with a code sample that use nested structures
‎2007 Aug 20 9:12 AM
Hi,
Below code give u the example of nested structure.
REPORT Structure.
TYPES: BEGIN OF name,
title(5) TYPE c,
first_name(10) TYPE c,
last_name(10) TYPE c,
END OF name.
TYPES: BEGIN OF mylist,
client TYPE name,
number TYPE i,
END OF mylist.
DATA list TYPE mylist.
list-client-title = 'Lord'.
list-client-first_name = 'Howard'.
list-client-last_name = 'Mac Duff'.
list-number = 1.
WRITE list-client-title.
WRITE list-client-first_name.
WRITE list-client-last_name.
WRITE / 'Number'.
WRITE list-number.
Reward if helpfull.
Anees
‎2007 Aug 20 9:25 AM
Hello,
The structure of a data object can be an
<b>elementary field, a
structure, or an
internal table.</b>
Structures and internal tables are complex data obejcts. Since it is possible to combine structures and internal tables in any way, we can can also make a general distinction between different types of structures, internal tables, and data structures.
A structure can be:
A <b>simple structure</b> (as opposed to complex structures). A simple structure is a structure with elementary components.
A <b>nested structure</b>. A nested structure is a structure containing one or more further structures.
A <b>deep structure</b>. Deep structures are structures that contain an internal table as a component, either directly or indirectly).
Here is the sample program with nested structures
REPORT structure1.
TYPES: BEGIN OF name,
title(5) TYPE c,
first_name(10) TYPE c,
last_name(10) TYPE c,
END OF name.
TYPES: BEGIN OF mylist,
client TYPE name,
number TYPE i,
END OF mylist.
DATA list TYPE mylist.
list-client-title = 'Lord'.
list-client-first_name = 'Howard'.
list-client-last_name = 'Mac Duff'.
list-number = 1.
WRITE list-client-title.
WRITE list-client-first_name.
WRITE list-client-last_name.
WRITE / 'Number'.
WRITE list-number.
reward if helpful,
Regards,
LIJO JOHN
‎2007 Aug 20 9:35 AM
Why would you want to use nested structures? That's a quagmire you won't get out of. Unless you have a very specific NEED for it, don't bother with them.