Show TOC

Assignment Between Structures ILocate this document in the navigation structure

In this example, includes are handled with group names.

Before Unicode conversion

types:

 begin of T_STRUC,

 F1 type c,

 F2 type c,

 F3 type i,

 F4 type p,

 end of T_STRUC.

data: begin of STRUC1.

 include  type T_STRUC.

data:   F5 type x.

data: end of STRUC1.

data: begin of STRUC2.

 include  type T_STRUC.

data:   F6 type p.

data: end of STRUC2.

STRUC1 = STRUC2.              ß Unicode error

In this case, only the contents of the include, that is the components F1 to F4, were to be assigned. The system accepted that the component was overwritten with an invalid value.

After Unicode conversion

The introduction of group names for the includes and the use of these group names for assignment allows you to simply change this part of the program.

types:

 begin of T_STRUC,

 F1 type c,

 F2 type c,

 F3 type i,

 F4 type p,

 end of T_STRUC.

data: begin of STRUC1.

 include type T_STRUC as PART1.

data:   F5 type x.

data: end of STRUC1.

data: begin of STRUC2.

 include type T_STRUC as PART1.

data:   F6 type p.

data: end of STRUC2.

STRUC1-PART1 = STRUC2-PART1.      ß ok