0% found this document useful (0 votes)
397 views

ABAP On Cloud - 5 - Introduction To RESTFul ABAP Programming

The document provides an introduction to RESTful ABAP programming. It discusses the key components of a RESTful ABAP application including Core Data Services (CDS) modeling in the database layer, behavior definition and implementation in the business logic layer, and service implementation via OData for consumption in UI applications. It also provides steps for creating a database table in SAP Cloud, including creating a new ABAP package and transport request.

Uploaded by

somakbiswas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
397 views

ABAP On Cloud - 5 - Introduction To RESTFul ABAP Programming

The document provides an introduction to RESTful ABAP programming. It discusses the key components of a RESTful ABAP application including Core Data Services (CDS) modeling in the database layer, behavior definition and implementation in the business logic layer, and service implementation via OData for consumption in UI applications. It also provides steps for creating a database table in SAP Cloud, including creating a new ABAP package and transport request.

Uploaded by

somakbiswas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

6/27/23, 7:31 PM ABAP on Cloud – 5 – Introduction to RESTFul ABAP Programming |

ABAP on Cloud – 5 – Introduction to RESTFul


ABAP Programming
By Ruthvik Gautham - May 7, 2020

At the very onset, we would like to thank the entire SAP Community who are
enthusiasts and avid followers of SAPYard for the continued support, feedback,
suggestions, criticism and encouragement. We try to listen to every comment you
make and improve every single day and try to contribute our part in sharing the
little knowledge we gain working in real projects which might help someone in
need.

I treat acknowledgements like below from one of our supporters, a “Badge of Honor”.

Badge of Honor

Before we jump into thee new world of ABAP Programming, let us build some analogy. Let’s
look at the different variants offered by Apple in the mobile segment. We will focus on
phones (not just phones, smart phones :P) released by Apple after 2017. Apple iPhone X,
iPhone XR, iPhone XS, iPhone XS Max, iPhone 11, iPhone 11 Pro, iPhone 11 Pro Max and
finally iPhone SE (2nd generation).

Are they all different? Probably not. Then are they all the same? Again, no.

https://www.zapyard.com/abap-on-cloud-5-introduction-to-restful-abap-programming-2/ 1/14
6/27/23, 7:31 PM ABAP on Cloud – 5 – Introduction to RESTFul ABAP Programming |

All these have been released with different variations, some in old style new look, some
improvements, some delta changes, some new defects, some old defects , some
transformations and some revolutionary.

When the mobile phone manufacturer has created a brand and has a large consumer base,
there is a need to cater to newer needs, changing technological landscapes, consumer
wants, geographical demand and budget of the target audience. And they definitely have
buyers for every segment of phone they have released.

Similarly, SAP is not immune to such changes either. SAP has to cater the needs of
world wide customers with variety of business model, system landscape and
budget. Therefore SAP has different solution in its arsenal to suit the vast business
scenarios. SAP ABAP has seen its own evolution and every passing days, it is
evolving, sometime making things easier and at times confusing too. Vanilla
ABAP, OOPs ABAP, ISU ABAP, CRM ABAP, SAP ABAP on HANA, SAP ABAP for Fiori,
SAP ABAP on Cloud, SAP ABAP on/for (? blank). Fill in the blank.

Instructor-Led Paid Training starts on 16th May 2020 9 AM EST

SAP ABAP ON CLOUD IN A NUT SHELL

ABAP RESTFul ( REpresentational State Transfer ) programming model is a newbie


in the list of ABAP style of programming focused on building end to end custom
business applications using the components like CDS (Core Data Services)
modeling in Database layer for data fetching and manipulation, Behavior
Definition and Implementation in Business layer for implementing business logic
and Service implementation via OData for consumption in Fiori Applications
internally within SAP environment or as API for external consumption; in UI Layer.

Fwwww !!! Believe me it is one sentence and not a riddle for you to solve. We shall try to
explain each in more details.

Let’s break it down for more clarity.

1. CDS (Core Data Services) modeling in Database layer


2. Behavior Definition and Implementation in Business layer
3. Service implementation via OData for consumption in Fiori Applications UI
Layer.

https://www.zapyard.com/abap-on-cloud-5-introduction-to-restful-abap-programming-2/ 2/14
6/27/23, 7:31 PM ABAP on Cloud – 5 – Introduction to RESTFul ABAP Programming |

Let’s compare ABAP with RESTful ABAP


R/3 is here to stay even in RESTful. Good News. – Same Style New Look

In Memory Database in RESTful – Some improvements

No SE14 (for that matter no GUI Screens and T-Codes are available) to activate and
adjust the database table and delete database table in RESTful- should we call this a gap
or new defect or is there a way around?

Data fetching and processing – Some transformations in RESTful

There are many, but above are simple to start with.

There are some Revolutionary Evolution too. We will discuss in details as and when
we reach the right time. So, for that to happen we humbly request you all to
continue reading our blogs and follow us.

CDS (Core Data Services) modeling in Database layer will get our undivided attention in
rest of this article.

Core Data Services modeling in Database layer

Note: above diagram is exclusively seen for the first time in any forum, because we have created
it. If in future it is visible elsewhere, please credit us.

Each block above represents one functionality.

Those marked in green are related to Database Layer, those in light sky blue are
related to Presentation Layer and finally light orange correspond to Business
Logic Layer.

Now, to be very precise, the sequencing is also important. The most pivotal of all artifacts is
the Root View and then on top of it the Data Access Control is created and then

https://www.zapyard.com/abap-on-cloud-5-introduction-to-restful-abap-programming-2/ 3/14
6/27/23, 7:31 PM ABAP on Cloud – 5 – Introduction to RESTFul ABAP Programming |

Metadata Extension, Behavior Definition and Behavior Implementation

1. Root View
Any CDS view built on top of a single database table is called as Basic Interface CDS.

We also have many situations where there can be combination of multiple data sources (in
turn they point to the DB tables) which are associated via certain fields with a cardinality.
These are called as Composite Views.

These concepts are taken from VDM. Click here to learn more.

Any of the above can qualify to be root view. This means we consider this CDS View as the
primary source and then built either Fiori Apps as the end product or expose the view as
an External API.

The Root View is written in DDL (Data Definition Language).

2. Data Access Control


Data Access Control is written in DCL (Data Control Language) which takes care of which
user is authorized to use the DDL and what contents can be given as output in restriction.

Click here to learn more.

Also Watch – Free Video Course on Data Access Control in Core Data Services

3. Metadata Extension
Very important topic for the ABAPers to know is how to utilize the capability of building
robust and precise UI controls, analytical controls etc.

Metadata Extension enables to separate the database layer components and other
behavioral or UI components.

Please remember Metadata Extension is built using Annotations.

Also Read – ABAP Programming Model for SAP Fiori Series

https://www.zapyard.com/abap-on-cloud-5-introduction-to-restful-abap-programming-2/ 4/14
6/27/23, 7:31 PM ABAP on Cloud – 5 – Introduction to RESTFul ABAP Programming |

4. Behavior Definition
New concept for new coders. The Behavior definition is built on top of the Root View. It is
used to just define the behavior of the root view.

Similar to class definition, it simply abstracts the elements that need to be implemented.

The different options available for implementation is Managed and Unmanaged Scenarios.
We will look into these in the coming articles how these are different.

Also other standard transactional operations like Create, Read, Update, Delete can be
controlled using Behavior Definition.

New language has been introduced called as Behavior Definition Language (BDL). Does
it mean the end of BOPF is nearing?

5. Behavior Implementation
Finally, we reach to the artifact called as Behavior Implementation. We implement the
Behavior Definition through a implementation class using ABAP OOPs.

Even though, ABAP OOPs is used to define the classes and methods it is the Entity
Manipulation Language (EML) that does the newer operations on the objects.

So, as we dig more we learn more about all of these in detail.

Steps to Create your First Database Table in Cloud


As a bonus, in this article let’s learn how to create a DB Table.

1. To Create a new package, just expand the project created in previous article. Right click
– New – ABAP Package.

2. Enter the required details and click on “Next”

https://www.zapyard.com/abap-on-cloud-5-introduction-to-restful-abap-programming-2/ 5/14
6/27/23, 7:31 PM ABAP on Cloud – 5 – Introduction to RESTFul ABAP Programming |

*Remember: All the packages are in the public domain and is visible to developers
across the globe.

3. Click on “Next” and below screen appears where click on “Create a New Request” and
provide a new to the Transport Request.

https://www.zapyard.com/abap-on-cloud-5-introduction-to-restful-abap-programming-2/ 6/14
6/27/23, 7:31 PM ABAP on Cloud – 5 – Introduction to RESTFul ABAP Programming |

4. On left side of the ABAP Perspective, scroll down to find the project just created.

5. Right Click on the project to create a new object.

https://www.zapyard.com/abap-on-cloud-5-introduction-to-restful-abap-programming-2/ 7/14
6/27/23, 7:31 PM ABAP on Cloud – 5 – Introduction to RESTFul ABAP Programming |

6. In the ABAP repository object, navigate to the “Dictionary”.

7. Expand the dictionary to find “Database Table”

https://www.zapyard.com/abap-on-cloud-5-introduction-to-restful-abap-programming-2/ 8/14
6/27/23, 7:31 PM ABAP on Cloud – 5 – Introduction to RESTFul ABAP Programming |

8. Click on Next and provide the Name of the database table. Click on Next.

9. Click on Finish with default Transport Request.

https://www.zapyard.com/abap-on-cloud-5-introduction-to-restful-abap-programming-2/ 9/14
6/27/23, 7:31 PM ABAP on Cloud – 5 – Introduction to RESTFul ABAP Programming |

10. Sample database table is as follows. You may play around and design you own db table.

So, finally you were able to create your first object using ABAP on Cloud. For experience
ABAPers it will not be wrong to say, it is the same old wine in a new bottle. But, let us not
conclude too early. You never know, what surprises the Cloud might hold for the age old
ABAP Developers.

We know, the above steps for creating the database table does not help you to understand
much of ABAP on Cloud. Also, we did not speak about the annotations (everything after “@”
are annotations). We will explain you in details each and every line written in the above
snippet to create your first database table in Cloud. Hope, you are not already missing your
SAP GUI based SE11 database creation process. How easy it was.

Team SAPYard is trying to break the concepts into layman’s terms on every new
topics SAP is coming with. We try to provide the concepts from the eyes of the
high school teacher and not through the mind of a multi PhD Professor (read
SAP Experts). We believe, unless we know the simple concepts, we cannot
research or assimilate the complex findings. That is the reason, we are very

https://www.zapyard.com/abap-on-cloud-5-introduction-to-restful-abap-programming-2/ 10/14
6/27/23, 7:31 PM ABAP on Cloud – 5 – Introduction to RESTFul ABAP Programming |

elaborate and do not mind leaving extra digital footprint in the internet world. If
our extra paragraph helps someone learn something, it is worth writing it.

FEEDBACK PLEASE!!
Please follow our LinkedIn Page , LinkedIn Group , Facebook Page , Twitter
and Instagram .

Save our number +1-646-727-9273 and send us a Whatsapp message


‘LEARN’ to be part of our Learning Community.

https://www.zapyard.com/abap-on-cloud-5-introduction-to-restful-abap-programming-2/ 11/14
6/27/23, 7:31 PM ABAP on Cloud – 5 – Introduction to RESTFul ABAP Programming |

All ABAP on Cloud Tutorials


ABAP on Cloud – 1 – Introduction

ABAP on Cloud – 2 – ABAP Trial Instance on Cloud

ABAP on Cloud – 3 – Eclipse Set-up for ABAP Cloud

ABAP on Cloud – 4 – Your First ABAP Cloud Project

ABAP on Cloud – 5 – Introduction to RESTFul ABAP Programming

ABAP on Cloud – 6 – DB Creation and Root View in ABAP Cloud

ABAP on Cloud – 7 – Insert Records through Class and Create Metadata Extension

ABAP on Cloud – 8 – Behavior Definition and Service Definition and Binding & Output

ABAP on Cloud – 9 – Experimenting with Metadata Extension and CRUD Operations

ABAP on Cloud – 10 – First Fiori Project on Cloud – 1

ABAP on Cloud – 11 – First Fiori Project on Cloud – 2

ABAP on Cloud – 12 – First Fiori Project on Cloud – 3

ABAP on Cloud – 13 – First Fiori Project on Cloud – 4

ABAP on Cloud – 14 – Advanced Topics – 1 – On Screen Validation for Managed Scenario

ABAP on Cloud – 15 – Advanced Topics – 2 – On Screen Validation for Managed Scenario

ABAP on Cloud – 17 – ABAP Service & ABAP Instance in Trial SAP Cloud Platform

ABAP on Cloud – 18 – Business Application Studio – 1

ABAP on Cloud – 19 – Business Application Studio – 2

How to Create SM30 Like Table Maintenance T-Code in SAP RAP – Part 1

SAP BTP. Part 9. Handling the Business Logic in RAP – Part 1

How to Create SM30 Like Table Maintenance T-Code in SAP RAP – Part 2 – Validations
and Action via RAP

Table Maintenance Generator from SAP RAP – Part 3 – FIORI UI App

https://www.zapyard.com/abap-on-cloud-5-introduction-to-restful-abap-programming-2/ 12/14
6/27/23, 7:31 PM ABAP on Cloud – 5 – Introduction to RESTFul ABAP Programming |

Also, Check ABAP Programming for SAP Fiori Tutorials


ABAP Programming Model for SAP Fiori – 1 – Overview

ABAP Programming Model for SAP Fiori – 2 – CDS – Introduction

ABAP Programming Model for SAP Fiori – 4 – OData Service Creation

ABAP Programming Model for SAP Fiori – 5 – OData Service Generation

ABAP Programming Model for SAP Fiori – 3 – CDS Views Creation

ABAP Programming Model for SAP Fiori – 6 – Generating Read-Only Application in Fiori
using Fiori Elements

ABAP Programming Model for SAP Fiori – 7 – BOPF – Introduction

ABAP Programming Model for SAP Fiori – 8 – Developing Transactional Application –


CRUD Operations using BOPF

ABAP Programming Model for SAP Fiori – 9 – Use of Determinations in BOPF

ABAP Programming Model for SAP Fiori – 10 – Use of Actions in BOPF

ABAP Programming Model for SAP Fiori – 11 – Enabling Draft Functionality for
Transactional Apps

ABAP Programming Model for SAP Fiori – 12 – Scenario of Transactional App with Draft
Enabled Functionality

ABAP Programming Model for SAP Fiori – 13 – How to Preview and Download PDF in Fiori
Apps

ABAP Programming Model for SAP Fiori – 14 : Dynamic handling of CUD Operations &
Fields in the Transaction App

ABAP Programming Model for SAP Fiori – 15 : Automatic Popup Confirmation for Custom
Actions using ABAP Programming Model in S/4HANA

ABAP Programming Model for SAP Fiori – 16 : Automatic Dialogue with Parameters for
Custom Actions using ABAP Programming Model in S/4HANA

Single Popup Instead Multiple Popup for BAPI Return and Custom Messages

How to Create SM30 Like Table Maintenance T-Code in SAP RAP – Part 1

How to Create SM30 Like Table Maintenance T-Code in SAP RAP – Part 2 – Validations
and Action via RAP

Table Maintenance Generator from SAP RAP – Part 3 – FIORI UI App

Ruthvik Gautham

https://www.zapyard.com/abap-on-cloud-5-introduction-to-restful-abap-programming-2/ 13/14
6/27/23, 7:31 PM ABAP on Cloud – 5 – Introduction to RESTFul ABAP Programming |
https://sapyard.com/

New Technology Enthusiast and avid technical writer!!! Experience in working with clients from Retail,
Manufacturing, Mining, Pharma as ABAP Developer.

 

https://www.zapyard.com/abap-on-cloud-5-introduction-to-restful-abap-programming-2/ 14/14

You might also like