SAP CONVERSION STRUC



Get Example source ABAP code based on a different SAP table
  



Conversion Rules for Structures
In assignments between structures, it is necessary to distinguish between flat structures and deep structures:
Deep structures can only be assigned to each other if they are compatible. Full compatibility is not required for the following deep components, and the following applies instead:
For components that have a reference type , upcasts but not downcasts are allowed.
For table-like components, it is sufficient if the line type is compatible. This means that full compatibility is not required, which also includes table categories and table keys.
For flat structures, there are conversion rules for the following assignments between incompatible data objects:
Conversion between flat structures
Conversion between flat structures and single fields
Assignments between structures and data objects that cannot be assigned to structures lead to a syntax error or the runtime error OBJECTS_MOVE_NOT_SUPPORTED.



Latest notes:

If substring access is performed on a structure and the substring is shorter than the structure, the substring is handled like an operand of type c and the corresponding conversion rules apply. If the substring corresponds exactly to the length of the structure, the substring is handled like the structure itself.
A lossless assignment can be used to apply the same assignment rule to flat structures as to deep structures.
The conversion rules for structures are designed to prevent catchable exceptions from being raised. If an assignment is allowed, it takes place.
The statement MOVE-CORRESPONDING or the conversion operator CORRESPONDING can be used to assign structures component by component.
NON_V5_HINTS
ABAP_HINT_END

ABAP_PGL
Avoid unexpected conversion results
ABAP_PGL_END