Start of Content Area

Type Checks and Type Compatibility  Locate the document in its SAP Library structure

For historical reasons, the types of field symbols and parameters in subroutines or function modules can be defined with the STRUCTURE addition.

The following extra rules are checked in a UP after defining the type with STRUCTURE when assigning data objects, i.e. for the DEFAULT addition in the FIELD-SYMBOLS statement, for ASSIGN and when passing actual parameters.

      1. If wa or the line type of itab_b is a flat or deep structure, the length of s must be the same for the Unicode fragment views of wa or of itab_b and s.
      2. If wa is a single field, only the character-types C, N, D or T are allowed and the structure s must have character-type only.

BEGIN OF struc1,
  a(1)
TYPE X,
  b(1)
TYPE X,
  c(1)
TYPE C,
END OF struc1.

BEGIN OF struc2,
  a(1) TYPE X.
  INCUDE struc3.
END OF struc2.

BEGIN OF struc3,
  b(1) TYPE X,
c(1) TYPE C,
END OF struc3.

Since the type compatibility can differ in a UP and an NUP, the type compatibility rules of the calling program are valid in an NUS for checking the parameters. This means that if an NUP calls a UP, the type compatibility is defined as in the NUP. Conversely, the Unicode check is activated if a UP calls an NUP.

Note Use the categories used in the Dictionary when using these types with Structure Enhancements.

End of Content Area