Creating External Views

Prerequisites

  • The ABAP system runs on a SAP HANA database.
  • The corresponding HANA view has been activated in the HANA Repository of the AS ABAP system.

Context

To access modeled HANA views in ABAP, you have to create the corresponding ABAP repository objects. Such an object is called an external view and stored in the ABAP Dictionary.

Procedure

  1. In your ABAP project, select the relevant package node in the Project Explorer.
  2. Open the context menu and choose Start of the navigation pathNew Next navigation step ABAP Repository Object Next navigation step Dictionary Next navigation step Dictionary ViewEnd of the navigation path to launch the view creation wizard.
  3. In addition to the Project and Package, enter a Name and a Description for the view to be created.
  4. Select the option External View.
  5. Enter the name of the appropriate HANA View that has already been created in the HANA Repository of the AS ABAP system in question. Then choose Next.

    Figure: First wizard page when creating an external view from a HANA view

  6. Assign a transport request.
  7. Choose Finish

Results

In the selected package, the back-end system creates an inactive version of a Dictionary view for the corresponding HANA view.

As a result of this creation procedure, the editor with the new external view will be opened. The view definition already includes a default mapping of field names and types from the HANA view and the field names and data types to be used in ABAP Dictionary.

For example, if HANA names are of excess length (longer than 30 characters), these will be truncated when the view is created. In this case, the ABAP name can be changed subsequently in the editor.

In the Project Explorer, the new view is added to the Dictionary folder of the corresponding package node.

Troubleshooting

Consider that the creation procedure may fail under certain circumstances. This is the case, for example, if the data types defined in the underlying HANA view cannot be mapped onto compatible ABAP Dictionary types. In such a case, the creation procedure will be cancelled and the wizard page displays a short error text. Detailed error information is displayed in the ABAP Log. Read the message in the ABAP Log to identify the causing error(s).

Figure: Cancelled creation procedure evokes a notification and a message in the ABAP Log view