Category: ABAP RAP

  • Introduction to ABAP CDS Views

    Preface – This post is part of the SAP ABAP RAP series.

    Introduction

    SAP ABAP CDS View is used for defining and consuming semantic data models on standard tables or dictionary views. The abbreviation for CDS is Core Data Services. Although SE11 dictionary view and CDS views both create database views at the backend, the ABAP CDS view supersedes the dictionary view in so many ways.

    Difference between dictionary view and CDS View

    Dictionary View CDS View
    Can be created from SAP GUI or Eclipse. Can only be created from Eclipse or SAP HANA Studio.
    Cannot define Annotations. Annotations are provided to enrich metadata.
    Aggregation is not possible. Can provide Aggregation function.
    Grouping is not possible. Grouping can be provided.
    Join can be used. Join and Union both can be used
      Case Expressions can be used.
      Input parameters can be allowed for filtering data and column calculations
      Operators can be used.

    CDS view Types

    There are three different VDM view types:

    • Basic view
    • Composite view
    • Consumption view

    CDS view Types

    Figure 1: CDS view types

    1.      Basic View

    VDM Basic views are created on the top of DDIC tables or views. It is the only view that interacts directly with the database.

    Annotation: @VDM.Viewtype : #BASIC

    Properties for Basic View:

    1. Basic views can directly access the database tables and other basic views.
    2. They have an association with other basic views.
    3. Free of redundancies.
    4. They expose all business data.

     

    2.      Composite view

    The composite view is created on top of the VDM Basic view. It interacts with Basic views for the result set and does not interact with the database directly.

    Annotation: @VDM.Viewtype : #COMPOSITE

    Properties of Composite View:

    1. They can access other Composite views but not database tables.
    2. They can have an association with other composite views and basic views.
    3. Redundancies might be possible.
    4. They should be reusable.

     

    3.      Consumption view

    The consumption views are built on top of Interface views. By the name Consumption, we can assume that this view is meant to be consumed by SAP UI5 through OData, Analytical queries, Transactional service models.

    Annotation: @VDM.Viewtype : #CONSUMPTION

    How to create CDS views in ADT?

    To create a CDS view follow the below steps:

    1. Navigate to New ABAP Repository.
      New ABAP Repository
    2. Select Data Definition.
      Select Data Definition
    3. Provide Package, Name, Description of CDS view.
    4. Now from the given options, select Define View.
      Define View
    5. Define data source name, SQL view name, required annotations and other properties.
      Define data source name
    6. Define data selection Query.
      Define data selection Query
    7. Save and activate.

    How to view the data from CDS Views?

    1. In the DDL source object, navigate to your CDS view.
    2. Right-click and select OPEN DATA PREVIEW. Also, you can open the CDS view and press F8 to view the data.
    3. The output will show you the retrieved data from CDS View.

    Tutorial Video

    You can watch the video below to learn implementation:

    [embedyt] https://www.youtube.com/watch?v=CwWbauSyD4s[/embedyt]
  • SAP ABAP RESTful Application Programming Unmanaged Implementation

    Preface – This post is part of the SAP ABAP RAP series.

    Introduction

    In this section, we will explain the concept of unmanaged implementation and the development tasks required for enabling transactional processing in business objects integrating existing business logic.

    In an unmanaged implementation, it is required to implement all the business operations (Create, Update, Delete) in specified behavior definition before implementing it manually. In the managed scenario, on the other hand, the behavior definition is itself capable to obtain a ready-to run business objects.  We do not need to explicitly implement the CUD operations.

    Architectural Overview

    The underlying scenario reuses the existing business logic which manages business data.

    SAP ABAP RESTful Application Programming Unmanaged Implementation

    Architectural Overview: Integration of Existing Application Logic

    Development Process Overview

    The development of RAP based business services by integrating the transactional behavior of existing business objects requires to perform following steps:

    1. Defining CDS Data Model and Business Object Structure

    The structure of a business object consists of a tree of entities where each entity is linked using associations. The root entity represents the top node of a business object and hence it is a very important part of the business object structure. The root entity is indicated in the source code of the CDS data definition using the keyword ROOT.

    1. Defining and implementing transactional behavior of the business object

    The operations provided by the business object is defined in the Behavior Definition.  It contains all the entities of root and their supported business operations like Create, Update, Delete, Actions with dedicated input and output.

    The class pool referring to behavior definition contains the implementation of all the operations. The implementation is roughly divided into two phases: Interaction and save phase.

    1. Exposing relevant application artifacts for OData service enablement

    The behavior relevant to specific UI services is projected in Projection Behavior Definition. The relevant artifacts must be exposed to OData.  The projection is implemented into two artifacts: service definition and service binding.

    Service definition exposes the relevant data model and behavior and service binding implements specific protocol and service to be offered to the customer.

    1. Testing OData/UI services

    It provides the option to PUBLISH the service. Once you publish it, it can be consumed by the OData client.  To test the application within the ABAP development environment you can use the feature PREVIEW provided by the service binding editor.

     

  • SAP ABAP RESTful Application Programming Managed Scenario

    Preface – This post is part of the SAP ABAP RAP series.

    Introduction

    Let us consider we have been given a green field and asked us to develop a villa from scratch with our own customization. So, what steps will be involved in it? We need to design the floor-plan of the villa, the sections we want to include in the house like pool area, a garden, a jogging track etc. And we will proceed with selecting materials, selecting vendors, enforcing conciliation and orders and many more steps. Similarly, the RAP’s managed scenario provides the greenfield development for our business object.

    In the managed scenario, the implementations of behavioral elements like Create/Update/Delete are managed by the RAP framework itself. However, to implement complex logic like validations, determination or some sort of actions (Submit, Approval, Reject etc) on the business entity, you need to add the ABAP logic for it in implementing classes.

    How to implement managed scenario?

    Pre-requisite: Create CDS views.

    Steps:

    1. Right-click on root CDS view and select NEW BEHAVIOUR DEFINITION.
    2. Add package details, description.
    3. Select implementation type MANAGED. This is most important part of creating the managed implementation.
    4. Click on Next and then click on Finish.

    Points to consider

    1. It is available only on S/4 HANA Cloud.
    2. The framework will handle the CRUD operations by itself.
    3. It is more like BOPF where we are responsible to define what tables should be updated at the end.
    4. You can implement DETERMINATIONS, VALIDATIONS, and ACTIONS by adding logic in implementing class.
    5. The managed scenario does not support LATE NUMBERING. Late numbering refers to the late number assignment of primary key fields. The final value is assigned just before the data is saved to the database. We will learn more about in unmanaged scenario of RAP.
    6. We implement EARLY NUMBERING in the managed scenario. Using early numbering will draw the UUID automatically during the CREATE request by RAP runtime.
      Early numbering is only possible with the key field of type raw(16) (UUID) of the business object.
    1. The early numbering should be defined at BEHAVIOUR DEFINITION level.
    2. Actions: Instance factory actions are not supported.
  • Introduction to Behavior Definition

    Preface – This post is part of the SAP ABAP RAP series.

    Introduction

    In the previous lesson, we discussed creating CDS views. Now, the next artifact to create after CDS View is Behavior Definition. But first, we will understand what is a general understanding of behavior definition from a simple visual.

    Carefully observe the dog clips.

    Introduction to Behavior Definition

    We can clearly see the actions performed by a dog by just observing the clipart. These actions can also be termed as the behavior of a dog which it performs as per the situation. Similarly, for our business objects, we need to decide and define how the CDS view should behave according to requirements.

    Definition

    A behavior definition is an ABAP repository that represents the behavior of business objects in the context of SAP ABAP RAP.

    Properties

    1. The root entity can have at most one Behavior definition defined to it.
    2. The behavior definition specifies the child entities of the root.
    3. The implementation of behavior definition is performed in Behavior Implementation Class.

    How to create a Behavior Definition?

    To create the behavior definition, follow the below steps:

    1. Right-click on Interface view and select New Behavior Definition.

    How to create a Behavior Definition

    1. Provide Description, Package details and Implementation type. The most important part while creating the behavior definition is a selection of the Implementation type. This implementation type will define the scenarios you are working on: Managed or Unmanaged Scenario.
      Here, we have selected the Managed Scenario.

    Managed Scenario

    1. Select Transport Request.
    2. And now our behavior definition is created.

    behavior definition CDS

    Here we have defined the simple operations CREATE, UPDATE, DELETE. We would be making use of these operations in our application.

    As we are working on Managed scenario here, we don’t have to write explicit EML’s (Entity Manipulation Language) to perform these operations. This will be handled by the system. But when an Unmanaged scenario comes into the picture, we need to explicitly handle the business logic in Behavior Implementation.

    We will dig deep into it in later articles.

    1. Save and activate.
  • Introduction to Behavior Implementation

    Preface – This post is part of the SAP ABAP RAP series.

    Introduction

    Once we provided the behavior of our business object in Behavior Definition, we also need to add logic to it. The logic part is done in the class, here we call it Behavior Implementation class.  A behavior definition can have one or many implementation classes (a 1: n relationship).

    So, the next inline artifact to create is Behavior Implementation. The transactional behavior of business objects can be implemented in one or more global classes.

    Let’s say you want to create a record in the database. You enter the data in UI and click create button. The moment you press the create button, UI data will be pushed to buffer and, from buffer it will be committed to database or rollback with proper validations. (For details on Business Object Runtime click here ).

    Definition

    The Behavior Implementation is an ABAP class that implements the business object’s behavior.

    How to create Behavior Implementation?

    Follow the below steps to create Behavior Implementation:

    1. Once Behavior Definition is created. Right-click on Behavior Definition and select New Behavior Implementation.
    2. Provide the package details: name, description, package details. Click Finish.

    Introduction to Behavior Implementation

     

    1. The new Behavior Implementation is created and is added to the corresponding folder in Project Explorer.
    2. The two local classes will be automatically generated: lcl_handler and lcl_saver.

    lcl_handler: This local class will be called in the Interaction phase. It contains the methods, actions, determinations which we have defined in our Behavior Definition of the business object.

    lcl_saver: This class will be called in the Save sequence phase. It contains the methods for our save sequence. There are some set of pre-defined methods which will be called to persist our data to the database.

    The local class implementation will be different for the managed and unmanaged transactional scenarios. We will learn this in our next articles.

    How to create Behavior Implementation

    1. Write business logic in respective classes.
    2. Save and activate the class.
  • Difference between SAP BOPF and SAP RAP

    Preface – This post is part of the SAP ABAP RAP series.

    Introduction

    SAP has introduced various programming models helping the organizations via development of efficient applications that meets their business needs. Over time, with changing requirements and technologies, these programming models have evolved from DYNPRO and list programming models for SAP GUI based applications to WEB DYNPRO model for web-based applications and thereafter to SAP ABAP programming model for SAP Fiori.

    While SAP ABAP programming model for SAP Fiori is a key advantage in terms of evolving landscape, flexibility and efficient modelling for SAP Fiori, SAP HANA; lacks certain criteria like simplicity and typed access to business entities which seems to be the basic need for application development. Here RAP, a new programming model by SAP, fills the gap.

    SAP ABAP RAP provides the intrinsic approach to build SAP Fiori based applications that are optimized for S/4 HANA and can run over on-premise as well as on the cloud.

    Every year, more than 1 million custom objects are created by various industries using SAP ABAP technology. All these custom objects starts as a fresh requirement and needs the same monotonous approach of development. SAP hence came up with a new framework in SAP ABAP which focuses upon the individual business logic, rather than expending efforts on the development of application infrastructure. This framework in known as Business Object Processing Framework or SAP BOPF.

    What is SAP BOPF?

    SAP BOPF is an Object Oriented ABAP based framework that provides a set of generic services and functionalities that helps to standardize, modularize and speed up the development process. A BOPF is capable of managing the entire life cycle of business objects as well as covers all the aspects of the business application development.

    SAP BOPF Basic Architecture

    In simple words, BOPF replaces the work of SE24 class builder with all the custom CRUD operation. It acts as the transaction/application layer in SAP architecture. With the help of ABAP CDS (Core Data Services) it can be exposed directly over HTTPS and used via UI5 Applications.

    SAP BOPF Architecture

    What is SAP ABAP RAP?

    SAP ABAP RESTful Application Programming Model (RAP) was introduced by SAP Cloud Platform ABAP environment and is available with 1808 release and higher.

    The RESTful Application Programming model is built on the top of the semantic data model (CDS) and the transactional services are exposed in behaviour definition and implementation in implementing behaviour class. It also allows adapting the existing applications to be modelled which is intended to be used over a long time.  You can start from scratch (greenfield implementation) or you can reuse existing business logic (brownfield implementation).

    What is SAP RAP

    One can develop the following end-to-end scenarios:

    • SAP Fiori service
    • Service consumption
    • Web APIs

     

    Difference between SAP BOPF and SAP RAP

    Comparison SAP BOPF SAP RAP
    Type of Service Only on Premise Service. Both on Premise and Cloud Services.
    Technology SAP on Premise Stack (HANA DB, ABAP CDS, SEGW). SAP CDS and SAP ABAP (or ABAP on Cloud).
    Data Base The data base can be only on Premise. The data base can be either SAP conventional S4HANA or HANA Database (on cloud).
    Application Layer Application layer can be only ABAP. Application layer is ABAP and ABAP on Cloud.
    Frontend UI development is not supported, APIs are also not generated directly, relies on CDS. Only APIs are generated, UI development is not part of RAP architecture.
    Deployment It can be deployed only on Premise using Transport Request. But the UI application consuming the services generated by SAP RAP can be deployed over either Neo or Cloud Foundry or even ABAP Repository. The RAP is hosted via ABAP on cloud, which can be also only deployed over cloud foundry. But the UI application consuming the services generated by SAP RAP can be deployed over either Neo or Cloud Foundry.
    ABAP Reports Support BOPF is solely used for Fiori Elements based development. The services generated by SAP RAP can be used directly in ABAP Reports via Entity Manipulation Language (EML).
    OData Support SAP BOPF only supports OData V2. You can create both OData V2 and V4 services.
    Development IDE BOPF is developed using ABAP Wizard and SAP on Premise GUI. The CDS linked with BOPF is developed using HANA Studio/Eclipse. SAP RAP can be developed using HANA Studio/Eclipse in case of on-premise as well as ABAP on cloud.
    CDS Annotation The Parent and Child relationship in BOPF is defined at the bottom part of the ABAP CDS where we declare the Associations. The annotations of ABAP CDS are not required anymore as the RAP does not need to create the BOPF like framework in the background with the help of these Annotations.

     

    References

    Read more about SAP BOPF on its official documentation: https://help.sap.com/doc/cfa481e73ceb433894f4eed7f685ff79/1511%20002/en-US/frameset.htm?frameset.htm

    Learn about SAP BOPF on GoCoding tutorials: https://gocoding.org/sap-bopf-business-object-processing-framework/

    Read more about SAP RAP on its official documentation: https://help.sap.com/viewer/923180ddb98240829d935862025004d6/Cloud/en-US/289477a81eec4d4e84c0302fb6835035.html

    Learn about SAP RAP on GoCoding tutorials: https://gocoding.org/sap-abap-rap/

  • Difference between ABAP on Cloud & Restful ABAP Programming Model (RAP)

    Preface – This post is part of the SAP ABAP RAP series.

    Introduction

    SAP has introduced various programming models helping the organizations via development of efficient applications that meets their business needs. Over time, with changing requirements and technologies, these programming models have evolved from DYNPRO and list programming models for SAP GUI based applications to WEB DYNPRO model for web-based applications and thereafter to SAP ABAP programming model for SAP Fiori.

    While SAP ABAP programming model for SAP Fiori is a key advantage in terms of evolving landscape, flexibility and efficient modelling for SAP Fiori, SAP HANA; lacks certain criteria like simplicity and typed access to business entities which seems to be the basic need for application development. Here RAP, a new programming model by SAP, fills the gap.

    SAP ABAP RAP provides the intrinsic approach to build SAP Fiori based applications that are optimized for S/4 HANA and can run over on-premise as well as on the cloud.

    What is ABAP on Cloud?

    SAP now provides an option to create an instance of ABAP on cloud foundry. This instance is known as ABAP environment. This instance lets you to create extensions for ABAP based products so that you can extend your existing ABAP based code to cloud. The IDE used for writing ABAP on cloud is eclipse of SAP HANA Studio.
    You can perform following activities using ABAP on cloud:

    • Expose OData services
    • Perform RFC calls via Cloud Connector in SAP Cloud platform
    • Consume External services
    • Create ABAP cloud project with ADT that can be connected to ABAP system
    • Use Software Component Lifecycle Management in place of git
    • Deploy your application in the ABAP Environment

    What is SAP RAP?

    SAP ABAP RESTful Application Programming Model (RAP) was introduced by SAP Cloud Platform ABAP environment and is available with 1808 release and higher.

    The RESTful Application Programming model is built on the top of the semantic data model (CDS) and the transactional services are exposed in behaviour definition and implementation in implementing behaviour class. It also allows adapting the existing applications to be modelled which is intended to be used over a long time.  You can start from scratch (greenfield implementation) or you can reuse existing business logic (brownfield implementation).

    One can develop the following end-to-end scenarios:

    • SAP Fiori service
    • Service consumption
    • Web APIs

    Difference between ABAP on Cloud and SAP RAP

    ABAP on Cloud SAP RAP
    ABAP on Cloud is PaaS (Platform as a Service) which provides option to extend ABAP code in cloud. SAP RAP is a model based Architecture that is used to create services in on-premise and cloud.
    ABAP on Cloud is used by SAP RAP for Cloud Services. SAP RAP utilizes ABAP on Cloud to create cloud based services.
    ABAP on Cloud is a PaaS. SAP RAP is a framework.
    It supports only Cloud. It supports both Cloud and On Premise.

     

    References

    Read more about SAP ABAP on Cloud via its official documentation: https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/11d62652aa2b4600a0fa136de0789648.html

    Read more about SAP RAP on its official documentation: https://help.sap.com/viewer/923180ddb98240829d935862025004d6/Cloud/en-US/289477a81eec4d4e84c0302fb6835035.html

    Learn about SAP RAP on GoCoding tutorials: https://gocoding.org/sap-abap-rap/

  • Difference between SAP CAP and SAP RAP

    Preface – This post is part of the SAP ABAP RAP series.

    Introduction

    SAP has introduced various programming models helping the organizations via development of efficient applications that meets their business needs. Over time, with changing requirements and technologies, these programming models have evolved from DYNPRO and list programming models for SAP GUI based applications to WEB DYNPRO model for web-based applications and thereafter to SAP ABAP programming model for SAP Fiori.

    While SAP ABAP programming model for SAP Fiori is a key advantage in terms of evolving landscape, flexibility and efficient modelling for SAP Fiori, SAP HANA; lacks certain criteria like simplicity and typed access to business entities which seems to be the basic need for application development. Here RAP, a new programming model by SAP, fills the gap.

    SAP ABAP RAP provides the intrinsic approach to build SAP Fiori based applications that are optimized for S/4 HANA and can run over on-premise as well as on the cloud.

    We have been writing codes in different languages (such as ABAP, CDS, UI5/FIori and OData) at different platform (SAP NetWeaver, SAP Editor, HANA Studio, and SAP Web IDE) to achieve CRUD operation on business data. These all have their own limitation such as source independent development, platform independent development, etc. To remove dependency on multiple platforms and to combine SAP and open-source tools at a single platform, SAP came with Cloud Application Programming Model.

    What is SAP CAP?

    SAP Cloud Application Programming Model, also known as SAP CAP is a frameworks of tools, languages and libraries (both open source and SAP tools and technologies) designed efficiently with SAP best practices to help developers to minimize coding efforts, develop reusable peace of codes in form of micro services and to focus on designing and implementing business/enterprise specific logics.

    SAP CAP Architecture

    What is SAP ABAP RAP?

    SAP ABAP RESTful Application Programming Model (RAP) was introduced by SAP Cloud Platform ABAP environment and is available with 1808 release and higher.

    The RESTful Application Programming model is built on the top of the semantic data model (CDS) and the transactional services are exposed in behaviour definition and implementation in implementing behaviour class. It also allows adapting the existing applications to be modelled which is intended to be used over a long time.  You can start from scratch (greenfield implementation) or you can reuse existing business logic (brownfield implementation).

    One can develop the following end-to-end scenarios:

    • SAP Fiori service
    • Service consumption
    • Web APIs

    What is SAP RAP

    Difference between SAP CAP and SAP RAP

    Comparison SAP CAP SAP RAP
    Type of Service Only Cloud Service. Both on Premise and Cloud Services.
    Technology Open Source + SAP Stack (HANA DB, CAP CDS, SAP UI5). SAP CDS and SAP ABAP (or ABAP on Cloud).
    Data Base The data base can be only HANA Database (on cloud). The data base can be either SAP conventional S4HANA or HANA Database (on cloud).
    Application Layer Application layer can be Node.js or Java. Application layer is ABAP.
    Frontend UI development is supported. Only APIs are generated, UI development is not part of RAP architecture.
    Deployment It can be deployed only on Cloud Foundry as a single package (MTA.yaml that consists Database + Micro services + UI) or two package (UI is separated in this case). The RAP is hosted via ABAP on cloud, which can be also only deployed over cloud foundry. But the UI application consuming the services generated by SAP RAP can be deployed over either Neo or Cloud Foundry.
    ABAP Reports Support The services generated by CAP can be used by ABAP reports via external HTTP request calls. The services generated by SAP RAP can be used directly in ABAP Reports via Entity Manipulation Language (EML).
    OData Support SAP CAP only supports OData V4. But it can utilize plugins to downgrade the services to OData V2. You can create both OData V2 and V4 services.
    Development IDE SAP CAP can be developed using SAP Business Application Studio (BAS) or Visual Studio. SAP RAP can be developed using HANA Studio/Eclipse in case of on-premise as well as ABAP on cloud.

     

    References

    Read more about SAP CAP on its official documentation: https://cap.cloud.sap/docs/

    Learn about SAP CAP on GoCoding tutorials: https://gocoding.org/sap-cloud-application-programming/

    Read more about SAP RAP on its official documentation: https://help.sap.com/viewer/923180ddb98240829d935862025004d6/Cloud/en-US/289477a81eec4d4e84c0302fb6835035.html

    Learn about SAP RAP on GoCoding tutorials: https://gocoding.org/sap-abap-rap/

  • Difference between SAP ABAP and SAP RAP

    Preface – This post is part of the SAP ABAP RAP series.

    Introduction

    SAP has introduced various programming models helping the organizations via development of efficient applications that meets their business needs. Over time, with changing requirements and technologies, these programming models have evolved from DYNPRO and list programming models for SAP GUI based applications to WEB DYNPRO model for web-based applications and thereafter to SAP ABAP programming model for SAP Fiori.

    While SAP ABAP programming model for SAP Fiori is a key advantage in terms of evolving landscape, flexibility and efficient modelling for SAP Fiori, SAP HANA; lacks certain criteria like simplicity and typed access to business entities which seems to be the basic need for application development. Here RAP, a new programming model by SAP, fills the gap.

    SAP ABAP RAP provides the intrinsic approach to build SAP Fiori based applications that are optimized for S/4 HANA and can run over on-premise as well as on the cloud.

    What is SAP ABAP?

    APAP stands for Advanced Business Application Programming. It is a 4th Generation (because it is domain specific language) programming language developed by SAP.
    ABAP is the programming interface of Application Server ABAP (AS ABAP) in SAP NetWeaver. A prerequisite to use the ABAP programming language is to install an Application Server ABAP.
    The components of an Application Server ABAP can be organized in the layers (presentation, application, and database) of three-tier client-server architecture in accordance with their tasks.

    What is SAP ABAP RAP?

    SAP ABAP RESTful Application Programming Model (RAP) was introduced by SAP Cloud Platform ABAP environment and is available with 1808 release and higher.

    The RESTful Application Programming model is built on the top of the semantic data model (CDS) and the transactional services are exposed in behaviour definition and implementation in implementing behaviour class. It also allows adapting the existing applications to be modelled which is intended to be used over a long time.  You can start from scratch (greenfield implementation) or you can reuse existing business logic (brownfield implementation).

    One can develop the following end-to-end scenarios:

    • SAP Fiori service
    • Service consumption
    • Web APIs

    Difference between SAP ABAP and SAP RAP

    SAP ABAP SAP RAP
    SAP ABAP is an existing on-premise coding language for SAP Systems. It is now also available in cloud as “ABAP on Cloud”. SAP RAP is a programming model that defines an architecture for efficient end to end development of SAP HANA optimized OData services.
    It was basically made for on-premise (R/3 and HANA) applications. It is basically made for S4 HANA and ABAP on cloud services.
    It is available for all the versions of S4HANA. It is only available for S4HANA 1909 and later.
    ABAP based classical approach (reports, FM, class and OData) cannot use Entity Manipulation Language (EML). SAP RAP was designed to use Entity Manipulation Language (EML).
    Business objects are supported via BOPF approach. Business objects are part of Behavior Definition Language of SAP RAP. It is an integral part of all the RAP services.
    OData is created via SEGW. OData is created via CDS only.
    ABAP is already stable. SAP RAP is still evolving.

     

    References

    Read more about SAP ABAP on its official documentation: https://help.sap.com/viewer/7bfe8cdcfbb040dcb6702dada8c3e2f0/7.5.9/en-US/2ff82a005ddd4f369b74bfda71f297c0.html

    Learn about SAP ABAP on GoCoding tutorials: https://gocoding.org/abap-beginner/

    Read more about SAP RAP on its official documentation: https://help.sap.com/viewer/923180ddb98240829d935862025004d6/Cloud/en-US/289477a81eec4d4e84c0302fb6835035.html

    Learn about SAP RAP on GoCoding tutorials: https://gocoding.org/sap-abap-rap/

  • Business objects in SAP RAP

    Preface – This post is part of the SAP ABAP RAP series.

    Introduction

    A Business Objects in enterprise development represents a real-time artifact such as SalesOrder, Info Record. It contains several nodes such as Item, Bidders and transactional operations like create, update, delete of business data as well as application-specific operations like submit, reject.

    Category of Business Objects

    Business objects are categorized by:

    • Structure
    • Behaviour
    • Runtime implementations

     

    1.      Structure

    A business object is tree-structured, where a top node is represented as root and sub-nodes are represented as child nodes. The nodes are connected with a special kind of associations and compositions. Each node element is modelled with a CDS entity.

    Composition tree reflects the Structure of Business Object

    Figure 1: Composition tree reflects the Structure of Business Object

    2.      Behaviour of Business Objects

    The behaviour definition refers to the root entity of the CDS data model. The relationship is [0..1] i.e. one CDS root entity can have at most one behaviour definition, and one behaviour definition can refer to exactly one root entity.

    The supported operations of business objects are defined in behaviour definitions. These operations include:

    • Standard operations like CREATE, UPDATE, DELETE
    • Business Object specific operations with dedicated input/ output structures. These types of operations are called actions. Examples: SUBMIT, REJECT, CANCEL, PUBLISH.

    Behaviour definitions also include the information about the lock, numbering type (late numbering/ early numbering), read-only/mandatory fields of CDS entities.

    Relationship between CDS Entities and Business Object Behaviour

    Figure 2: Relationship between CDS Entities and Business Object Behaviour

    3.      Business Object runtime implementation

    In SAP ABAP RAP, saving the data to the database is performed in two phases: INTERACTION phase and SAVE phase.

    In the INTERACTION phase, the consumer calls the supported operations (like CUD) to change the data or to read the data. These changes are stored in internal TRANSACTIONAL buffers which represents the state of instance data. Once the changes are stored in buffers, the SAVE sequence phase is performed to save the changes from the transactional buffer to the database.

    The SAVE sequence consists of sequence of methods (finalise(), check_before_save(), adjust_numbers(), save(), cleanup(), cleanup_finalise()) which are executed to persist the changes. In the next section we will dig deep into runtime implementations.

    BO's Runtime Implementation

    Figure 3: BO’s Runtime Implementation