ARTICLE
Access to SAP HANA Views Using External Views
Open SQL provides access to all
database tables and views whose structures are defined as repository
objects in ABAP Dictionary . An
SAP HANA View ( Attribute View ,
Analytic View , Calculation View ), on the other hand, is an
entity of the SAP HANA database and is
defined here using SAP HANA Studio . This
uses HANA-specific data types and different naming conventions to ABAP
Dictionary also apply. This means that direct access to an SAP HANA view
using Open SQL is not possible.
An external view is a special view in ABAP
Dictionary that functions as a proxy for an SAP HANA view and which can
be accessed using SAP HANA and Open SQL . External views can only
be created using ABAP Development Tools .
This maps HANA-specific data types to
types in ABAP Dictionary . The
names of the types can be modified. 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
VARCHAR Character string CHAR
NVARCHAR Unicode character string CHAR
VARBINARY Byte string RAW
BLOB Byte string RAWSTRING
CLOB Character string STRING
NCLOB Unicode character string STRING
TEXT Unicode-Zeichenfolge mit Suchfunktion STRING
External views can be displayed in the ABAP Dictionary tool in the
SAP GUI -based ABAP Workbench, but not edited. Like a regular view, an
external view can be referenced as a structured data type and all
Open SQL reads are possible.
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 statement SELECT , with individual
columns and the addition GROUP 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.
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved