ARTICLE
rel_exp - Comparing Structures
It is possible to compare structures to structures and to elementary
fields.
The system compares compatible structures on a
component-by-component basis, resolving nested structures recursively.
Two structures are equal if the contents of their components are equal.
If two structures are not equal, the first unequal component pair
determines the result of the comparison.
It is possible to compare incompatible structures and structures with
elementary fields provided that the structures concerned are
flat .
In non-Unicode programs , the
system converts the structures involved to elementary fields of type
c before starting the comparison. The comparison is then carried
out in the same way as for elementary fields.
In Unicode programs, comparing two flat incompatible structures requires
that the Unicode fragment views
match for the length of the shorter structure. Before starting the
comparison, the system fills the shorter structure up to the length of
the longer structure. In this process, the system fills all
character-like components with spaces and all other components with a
type-related initial value . The
comparison is then performed on a section-by-section basis according to
the Unicode fragment view.
Comparing a flat structure to an elementary field in a Unicode program
is subject to the following rules:
If a flat structure is character-like, it is handled like an elementary
field of type c during comparison.
If a flat structure is not purely character-like, the elementry field
must be of type c and the first Unicode fragment of the structure
must be character-like and at least as long as the elementary field. If
the elementary field is shorter than the structure, the system extends
it to the length of the structure before starting the comparison and the
n handles it implicitly like a structure. The character-like parts of
the extension are filled with spaces and all other components are filled
with the type-related initial value.
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved