SAP DDIC VIEWS



Get Example source ABAP code based on a different SAP table
  



ABAP_DDIC - Views
A DDIC view is a grouping of columns of one or more DDIC database tables, resulting in an application-specific view. In AS ABAP, views are defined in ABAP Dictionary and can be referenced as data types in the same way as DDIC structures. Views can be used like DDIC database tables in reading AB-SQL statements and, with some limitations, also in writing AB-SQL statements. For this reason, the ABAP DDIC views are in the same namespace as all types of the ABAP Dictionary and hence in the namespace of all global types of an AS ABAP.
The name of a view must follow the naming rules for DDIC views.
The data in a view is not saved physically. It is read from the database from the involved DDIC database tables.
Views can be used to restrict data access for a DDIC database table. Access to fields is restricted with projections and access to specific rows is restricted with selections.
Views that select from multiple DDIC database tables use joins or subqueries to join these tables and to read the required fields and rows.
The views in ABAP Dictionary are usually platform-independent. With some exceptions, the views in ABAP Dictionary are, when activated, transformed into platform-dependent SQL views in the current standard AS ABAP database in the ABAP database schema . This is done using the DDL statement CREATE VIEW with the addition AS SELECT, which formulates the corresponding SELECT statement.
BEGIN_SECTION VERSION 5 OUT The definition of a view in the database can be displayed in transaction SE11 by choosing Utilities -> Database Object.
END_SECTION VERSION 5 OUT
ABAP Dictionary manages the following categories of views:
DDIC table views In DDIC table views the platform-dependent DDL statement is created from the definition of the view in the form-based ABAP Dictionary tool.
DDIC external views (obsolete) A DDIC external view makes an SAP HANA view known in ABAP programs and makes it usable like a DDIC table view. ABAP_NOTE SAP HANA XSA replaces SAP HANA XSC. The access methods designed specifically for XSC objects are not suitable for XSA objects and have become obsolete. DDIC external views represent one such access method and have been declared obsolete. See SAP Note 3116165 and SAP Note 2465027.
When a view is accessed using the AB-SQL statement SELECT, the database SELECT statement defined in the DDL statement is executed and the result set is returned as if a SELECT were executed on a DDIC database table whose structure matches the structure defined by the view.



Latest notes:

Defining views is usually not the job of an ABAP application programmer, but is part of the implementation of data models in ABAP Dictionary. Once created, views are used in ABAP programs using AB-SQL statements and must be stable enough to allow this.
The DDIC database tables a view is based on should have suitable indexes. This is important for selections using views.
ABAP Core Data Services (CDS) offers CDS views and other CDS entities for the implementation of data models and replaces data modeling with DDIC views. CDS entities are defined in a (mostly) platform-independent CDS DDL in DDL source code. CDS entities offer advanced modeling capabilities compared to DDIC views.
ABAP_HINT_END