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: 

nested structures

Former Member
0 Kudos

hi all, i m new to nested structures, i want to code using it, the output should show the year, months, days, 24 hour division for day and finally the capacity column for per hour... plz help it is very very urgent.

2 REPLIES 2

Former Member
0 Kudos

Hi,

Check the following code:

report ztx0803.

data: begin of names,

name1 like ztxkna1-name1,

name2 like ztxkna1-name2,

end of names.

data: begin of cust_info,

number(10) type n,

nm like names, "like a field string

end of cust_info.

cust_info-number = 15.

cust_info-nm-name1 = 'Jack'.

cust_info-nm-name2 = 'Gordon'.

write: / cust_info-number,

cust_info-nm-name1,

cust_info-nm-name2.

Hope this helps.

Reward if helpful.

Regards,

Sipra

Former Member
0 Kudos

Hello,

The structure of a data object can be an

elementary field, a

structure, or an

internal table.

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