ABAP RAP

ABAP RESTful Application Programming Model

Exercises

Naming convention in the exercises

We follow the conventions from the book Clean ABAP. Because many RAP objects build on each other, use a consistent base name <Name> and clearly distinguish object types. We use a Hungarian-like notation here as it works well for the exercises. The notation refers to the SAP RAP documentation.

A good <Name>

The suffixes _R,_M,_D,_U,_C are not required in real projects; scenarios (read-only, managed, draft, unmanaged, service consumption) can be implemented on the same tables.

Your initials <I> and the exercise number

To avoid collisions, append your 2- or 3-letter initials (e.g. JB or JBR) and the exercise number to object names. Example: ZI_JBR1_USERS.

Initials are for exercises only — don't use them in productive projects.

Naming conventions — object types

Based on SAP suggestions and extended with initials and the Z namespace.

Object type Convention Description
DB table ZA_<I>_<Name> Active data
DB table ZD_<I>_<Name> Draft data
CDS View ZI_<I>_<Name> Interface View
CDS View ZR_<I>_<Name> Base/Reuse View
CDS View ZC_<I>_<Name> Projection View for the Consumption layer
MetaData Extensions Same name as CDS view; number if more than one
Behaviour Definition Same name as CDS view
Service Definition Z_<I>_<Name>
Service Binding ZUI_<I>_<Name> For UI services
Service Binding ZAPI_<I>_<Name> For API services
ABAP Class ZBP_<I>_<Name> Class for behaviour pool
Local Class LHC_ Local handler class
Local Class LSC_ Local saver class

Exercise scenario

Task management example.

Administrative activities

  • Users for the task management
  • Status management (transitions / workflows)

Usage

  • Task list
  • Project management
  • Comments per task

Exercise 1: Read access to a DB table

Show CDS view data in the browser. Relevant elements:

  • DB table ZBC_USERS (already present)
  • CDS view ZI_<I>_USERS
  • Service Definition Z_<I>_<Name>
  • Service Binding ZUI_<I>_<Name>

... (exercises continue with code examples and step-by-step instructions)