Ansicht
Dokumentation

ABENUNICODE_LEAF_VIEW - UNICODE LEAF VIEW

ABENUNICODE_LEAF_VIEW - UNICODE LEAF VIEW

CL_GUI_FRONTEND_SERVICES - Frontend Services   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.
SAP E-Book

Structure Layout and the Unicode Fragment View

Structure layout

The data layout of a structure is determined by the data type of its components and their alignment requirements.

The alignment requirement refers to the constraint that fields of a certain type must begin at a certain address in memory. In Unicode systems, this rule applies to all numeric fields of type I and F, along with all character-type fields. If necessary, the system inserts empty bytes, known as alignment gaps, to make the components of structures comply with the alignment requirements.

Unicode fragment view of structures

The convertibility of structures in Unicode systems is determined by the structure layout. For this purpose, the structure layout is represented in the Unicode fragment view.

The Unicode fragment view splits the structure into fragments as follows:

  • Consecutive components of type X that do not have any alignment gaps between them form byte-type fragments.
  • Consecutive components of type C,N,D, and T that do not have any alignment gaps between them form character-type fragments.
  • All other components - that is, fields of type I, F, P, string, and xstring, plus references and internal tables - form separate fragments (one for each component).

Thus there are no alignment gaps within each fragment in the Unicode fragment view. In Unicode systems, the order and formation of fragments in operands is compared, to determine the convertibility of structures.

Examples

Convertible structures

DATA: BEGIN OF struc1,
        a(1) TYPE x,
        b(1) TYPE x,
        c(6) TYPE c,
      END OF struc1.

DATA: BEGIN OF struc2,
        a(2) TYPE x,
        b(2) TYPE c,
        c(4) TYPE n,
      END OF struc2.

The Unicode fragment view of both structures is:

     X(2)
     C(6)

struc1 can be assigned to struc2 in Unicode systems.

Inconvertible structures

DATA: BEGIN OF struc1,
        a    TYPE d,
        b    TYPE t,
        c    TYPE f,
        d(2) TYPE x,
        e(4) TYPE x,
        f(8) TYPE c,
      END OF struc1.

DATA: BEGIN OF struc2,
        a    TYPE d,
        b    TYPE t,
        BEGIN OF struc3,
          c    TYPE f,
          d(2) TYPE x,
        END OF struc3,
        e(4) TYPE x,
        f(8) TYPE c,
      END OF struc2.

The Unicode fragment view of the two structures is:

  struc1      struc2

   C(14)      C(14)
   F(8)       F(8)
   X(6)       X(2)
   C(8)       X(4)
              C(8)

Because of the alignment of substructure struc3, there is an alignment gap in struc2 between the components d and e, which does not occur in struc1.






Fill RESBD Structure from EBP Component Structure   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.

Length: 5211 Date: 20240419 Time: 191251     sap01-206 ( 45 ms )