Defining and using naming conventions ensure consistency in the names used by all the developers on a project. This posts summarizes the naming conventions recommended by SAP for the RAP Development Objects.

General Rules

The overall object name will be split into 3 parts.

[/<namespace>/][<prefix>]_<meaningful_abbreviation>_[<suffix>].

Namespace

[/<namespace>/]

For custom object, the namespace can just be Z. Your project can also have a namespace like ZAB_ etc.

Prefix

Prefix is used to differentiate between different types of same development object. For example, Root Entity and Projection Entity can be differentiated using the prefix.

Meaningful Abbreviation

This can be any meaningful text separated by _ characters. For example, customer_name.

Suffix

Suffix can be used for additional differentiation between different types of development objects. For example, a service binding with UI service can be named with suffix _V2 for OData version 2 and _V4 for OData version 4.

With this explanation, let us understand how the RAP development objects can be named. For the examples the namespace used is ZJP_.

ABAP Dictionary Objects

Object TypePrefix SuffixExample
Database Tables – PersistentA_ZJP_A_Customer
Database Tables – DraftD_ZJP_D_Customer

CDS Objects

Object TypePrefix SuffixExample
Interface CDS Entity (Root CDS Entity)I_ZJP_I_Customer
Base CDS Entity R_ZJP_R_Customer
Projection CDS EntityC_ZJP_C_Customer
Behavior Definition – RootSame as root CDS EntityZJP_I_Customer
Behavior Definition – ProjectionSame as projection CDS EntityZJP_C_Customer
Metadata ExtensionSame as the related CDS entityZJP_C_Customer

Business Services

Object TypePrefixSuffixExample
Service DefinitionUI_
or No Prefix
ZJP_UI_Customer
ZJP_Customer
Service Binding for UI Service with OData V2UI_ _O2
ZJP_UI_Customer_O2
Service Binding for UI Service with OData V4UI__O4ZJP_UI_Customer_O4
Service Binding for Web APIAPI_ ZJP_API_Customer

Source Code Objects

Object TypePrefixSuffixExample
Behavior PoolBP_ ZJP_BP_Customer
Handler ClassLHC_ZJP_LHC_Customer
Saver ClassLSC_ZJP_LSC_Customer

The naming conventions can also be checked in the ABAP Flight Reference Scenario. This contains many reference services which can help you learn more about ABAP RAP. Check for package /DMO/FLIGHT_LEGACY.

The code can be also downloaded from github link https://github.com/SAP-samples/abap-platform-refscen-flight.

Reference : https://help.sap.com/docs/btp/sap-abap-restful-application-programming-model/naming-conventions-for-development-objects

Visit ABAP RESTful Application Programming Model to explore all articles on ABAP RAP Model.


If you like the content, please subscribe…

Join 4,016 other subscribers

Discovering ABAP YouTube Channel