General Rules for Typing
The general rules for checking apply strictly to the following:
- The assignment of all data objects to field symbols
The general rules for checking the typing are:
- If the assignment is made to generically typed field symbols or field parameters, the system checks whether the technical type properties of the assigned data object are a subset of the generic type. The type properties that are not defined during typing are applied to the actual parameter.
- If the assignment is made to fully typed field symbols or formal parameters, the technical properties of the data type of the assigned data object must correspond exactly to the typing.
- The result of the typing check during the passing of actual parameters to formal parameters is independent of the passing type used. In a pass by value, the check for pass by reference is always carried out, even though this is stricter than necessary in individual cases.
- If reference variables are passed, up casts are possible but down casts are not. If actual parameters are passed to input parameters typed as reference variables, an up cast is only possible if there is no change of content within the procedure.
- If memory areas are assigned to field symbols typed as reference variables, the typing of the field symbol and the static type of the memory area must be the same.
- If the assignment is made to generically and fully typed field symbols or formal parameters, only the technical type properties are checked. The following are not checked:
- Names of structure components (names of nodes and associations of meshes are possible here).
- Semantic properties of data types defined in ABAP Dictionary (conversion routines, documentation, and so on)
- Initial memory requirement of internal tables
- When assigning to field symbols or formal parameters for which a structure is defined with the obsolete
STRUCTUREaddition are called in Unicode programs, elementary data structures must be character type and flat and for structures the Unicode fragment views must match.
- In external procedure calls between Unicode programs and non-Unicode programs, and back, the typing check always takes place from the caller's view.
- In the case of generically typed field symbols or formal parameters, and in the case of formal parameters of function modules and externally called subroutines, the typing is checked first at the time of the assignment - that is, at runtime. In the case of fully typed field symbols and formal parameters of methods and internally called subroutines, the check is performed as part of the syntax check.
- In typings using
STRUCTURE, the only check made in obsolete non-Unicode programs is to verify whether the assigned data object is aligned correctly (in pass by reference), has the same length, and whether (in function modules) it is a flat structure. In the case of formal parameters of subroutines and table parameters of function modules, it is enough here if the length of the actual parameter is at least as long as the assigned structure.