Generic ABAP Types


Generic ABAP Types
The following table shows the predefined generic ABAP types. A generic data type is an incomplete type specification that includes several complete type specifications. The generic types can be used for the typing of field symbols and formal parameters. The only generic type that can be used for typing of data references is the predefined type data. The predefined generic type for object references is object. When a data object is assigned to generically typed field symbols using the statement ASSIGN, or to a formal parameter in procedure calls, the system checks whether its concrete data type is a of the generic type, or is compatible with it.



The genric types clike, csequence, numeric,simple, and xsequence are available as of release 6.10.

Notes
The generic type any currently has the same effect in typing as the generic type data. When declaring references, any cannot yest be specified after REF TO. Generic data references (REF TO data) or generic object references (REF TO object) are possible. The generic type object can currently only be specified after REF TO.
Except for the built-in generic types illustrated in the table above, there are at the moment no self-defined generic types in ABAP with only one exception: A table type defined with TYPES - TABLE OF or defined in the ABAP Dictionary without completely specifying the table key, is also generic.



猜你喜欢

转载自caoxuhuan.iteye.com/blog/919149