ABAP Keyword Documentation → ABAP - Dictionary → Classic Objects in ABAP Dictionary → Views
External Views
An external view is a special view in ABAP Dictionary that
defines an
SAP HANA View in
SAP HANA XSC 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
ABAP 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. The SAP HANA view must exist in the SAP HANA Repository.
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 built-in 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 |
BIGINT | 8-byte integer | INT8 |
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 ABAP SQL if an SAP HANA database is being accessed in which the associated SAP HANA view exists. If not, the non-handleable 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 connection using ABAP SQL, only through a secondary connection to an SAP HANA database. Conversely, when an SAP HANA view in an SAP HANA database is accessed through a secondary 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
Notes
- 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 ABAP SQL as when using the HAND 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.
- Access to SAP HANA views in SAP HANA XS:
- SAP HANA views in SAP HANA XSC are stored in the SAP HANA Repository and external views can be used for access to these views from ABAP.
- SAP HANA views in SAP HANA XSA, the successor to SAP HANA XSC, are usually HDI objects for which no external views can be created. For access from ABAP, other methods must be used such as AMDP or ADBC.