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

nested structures

Former Member
0 Likes
473

hi... can anybody provide ne with a code sample that use nested structures

3 REPLIES 3
Read only

Former Member
0 Likes
447

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

Read only

Former Member
0 Likes
447

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

Read only

GuyF
Active Participant
0 Likes
447

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.