ABAP Keyword Documentation → ABAP Dictionary → Classic Objects in ABAP Dictionary → Views
External Views
An external view is a special view in ABAP Dictionary, which defines an
SAP HANA View in ABAP programs.
The structure type defined using the view fields of an external view can be referenced in ABAP programs using TYPE
. An external view can be specified as a source in
Open SQL read statements
External views can only be created using the ABAP Development Tools (ADT) and only if the current database is an SAP HANA database. When an external view is activated, an alias with the name of the view is created on the SAP HANA database that points to the SAP HANA view. The names of the view fields of the external view can be defined differently from the names of the view fields of the SAP HANA view. The runtime object of the external view accesses the alias on the SAP HANA database. This performs a mapping of HANA-specific data types to the predefined types in ABAP Dictionary. The following table lists the currently supported HANA-specific data types and indicates which ABAP Dictionary types they are mapped to by default.
HANA Type | Meaning | Type in ABAP Dictionary |
---|---|---|
SMALLINT | 2-byte integer | INT2 |
INTEGER | 4-byte integer | INT4 |
DECIMAL | Packed number | DEC |
SMALLDECIMAL | Packed number | DEC |
FLOAT | Binary floating point number | FLTP |
NVARCHAR | Unicode character string | CHAR |
VARBINARY | Byte string | RAW |
BLOB | Byte string | RAWSTRING |
NCLOB | Unicode character string | STRING |
External views can be displayed in the ABAP Dictionary tool in the SAP GUI-based ABAP Workbench, but not edited.
An external view can only be read using Open SQL if an SAP HANA database is being accessed in which the associated SAP HANA view exists. If not, the unhandleable exception DBSQL_TABLE_UNKNOWN is raised. External views can exist actively and be used as data types in a system whose standard database is not an SAP HANA database. Views of this type cannot, however, be accessed through the standard database connection using Open SQL, only through a secondary database connection to an SAP HANA database. Conversely, when an SAP HANA view in an SAP HANA database is accessed through a secondary database connection in the current system, only an identically named database table or a structure suitable for any view in ABAP Dictionary can exist actively in ABAP Dictionary.
Other versions:
7.31 | 7.40 | 7.54
Note
The following restrictions currently apply to the use of external views in ABAP programs:
- The structure of analytic views do not allow them to be read using SELECT
*. The same basic rules apply to the statement
SELECT
in Open SQL as when using the HANA-SQL statementSELECT
, with individual columns and the additionGROUP BY
needing to be specified. If SELECT * is used, a runtime error occurs.
- Calculation views with parameters can be access only if a default value is defined for each parameter. If not, reads are canceled and produce a runtime error.