Get Example source ABAP code based on a different SAP table
General Rules for Typing The general rules for checking the typing apply strictly to:
The assignment of all data objects to field symbols>
The binding of named data objects to input>, input/output>, and output parameters> for procedures The general rules for checking the typing are:
If the assignment is made to generically typed field symbols or formal 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 by typing are inherited from the actual parameter.
In assignments to completely typed field symbols or formal parameters, the technical properties of the data type of the assigned data object must correspond exactly to the typing. In assignments to field symbols or formal parameters typed with enumerated types>, the type of the assigned data object must be exactly the same enumerated type as is used for the typing.
The result of the typing check when actual parameters are passed to formal parameters is independent of the pass by type. In a pass by value>, the check for pass by reference> is always carried out, even though this can be stricter than necessary in individual cases.
If reference variables are passed, upcasts> are possible but downcasts> are not. If actual parameters are passed to input parameters typed as reference variables, an upcast> is only possible if there is no change of content within the procedure. BEGIN_SECTION VERSION 5 OUT When a subroutine> is passed to the parameters, an upcast is not possible in any case. END_SECTION VERSION 5 OUT
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.
In assignments to generically and completely typed field symbols or formal parameters, only the technical type properties> are checked. The following properties are not checked:
Names of structure components (but the names of mesh nodes> and mesh associations> are checked).
Semantic properties of data types defined in the ABAP Dictionary (conversion routines, documentation, and so on)
Initial memory requirement> of internal tables If generally typed formal parameters or field symbols are accessed dynamically, these properties are inherited from the type of the actual parameter. In static access to generically typed formal parameters or field symbols, these properties are inherited from the typing of the formal parameter. BEGIN_SECTION VERSION 5 OUT
When assigning to field symbols or formal parameters that have a structure with the obsolete addition STRUCTURE> and that are called in ABAP_STANDARD , elementary data structures must be character-like and flat and for structures the fragment views> must match. The assigned data object must be at least as long as the structure. END_SECTION VERSION 5 OUT
Latest notes:
The constructor operators CONV >> and CAST>> are well suited to convert or cast invalid actual parameters to the type of a formal parameter.
In the case of generically typed field symbols or formal parameters, and in the case of formal parameters of function modules, the typing is only checked at the time of the assignment, that is, at runtime. In the case of completely typed field symbols and formal parameters of methods, the check is performed by the syntax check>. NON_V5_HINTS
In addition in the case of formal parameters of externally called subroutines, the typing is only checked at the time of the assignment. In the case of formal parameters of internally called subroutines, the check is performed by the syntax check>. ABAP_HINT_END