Skip to content

ABAP Keyword Documentation →  ABAP Dictionary →  Classic Objects in ABAP Dictionary 

Views

A view in ABAP Dictionary is a grouping of columns in one or more database tables in accordance with an application-specific view. In AS ABAP, views are defined in ABAP Dictionary and can be referenced as data types (like flat structures). Views can be used like database tables in Open SQL read statements (and sometimes in write statements). For this reason, the ABAP Dictionary views are in the same namespace as all types and database tables in ABAP Dictionary.

The name of a view can have a maximum of 16 characters, can consist of letters, numbers, and underscores, must start with a letter can be prefixed by a namespace prefix (/.../) of a prefix namespace. It is in the namespace of the data types in ABAP Dictionary.

The data in a view is read from the database tables involved by the database and is not save physically.

  • Views for a database table can be used to restrict database access to specific fields (projection) or rows (selection).
  • Views for multiple 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 the exception of some special views, the views in ABAP Dictionary, when activated, are transformed to platform-specific SQL views in the current central AS ABAP database in the database schema SAPsid. Here, sid stands for the system ID (the name of the AS ABAP). This is done using the DDL statement CREATE VIEW with the addition AS SELECT, which formulates the corresponding SELECT statement. The definition of a view in the database can be displayed in ABAP Dictionary by choosing Utilities → Database Object.

ABAP Dictionary manages the following categories of views:

In the classic views (or views for short), the platform-dependent DDL statement is created from the definition of the view in the form-based ABAP Dictionary tool.
An external view externalizes an SAP HANA view in ABAP programs and makes it usable like a regular view in ABAP Dictionary.

When a view is accessed using the Open SQL statement SELECT, the SELECT statement defined in the DDL statement is executed and the results set is returned as if a SELECT were executed on a database table whose structure matches the structure defined by the view.

Other versions: 7.31 | 7.40 | 7.54


Notes

  • Views are usually defined in the implementation of data models in ABAP Dictionary and this is not usually the job of a regular ABAP application programmer. Once created, views are used in ABAP programs using Open SQL statements and must be stable enough to allow this.

  • When making selections using views, it is also important that suitable indexes are created for the basis tables in the view.

  • The CDS views in the ABAP Core Data Services (CDS) are added to the views specified. A CDS view is defined in a (mostly) platform-independent CDS-DDL in CDS source code. CDS views expand on the functions provided by the classic views.

Continue

Classic Views

External Views