ABAP on Cloud along with RESTful ABAP Programming (RAP) is one hot cake and every ABAP Developer wants to get its small piece and flavor. We have tried to break down the course in logical units so that it is not that overwhelming and even the newbie can understand the new path of ABAP Cloud.
Love, support and amazing response from our patrons has pushed us to venture more and share more. What has been very intriguing is how the CDS behaves and what makes it do so? Finally, how do we see it behave? This article is the heart of this whole series. Do go through it gradually and do the hands on along with us.
What we must do now is to keep the Metadata Extension topic aside, which we left in the last article since its impact and the real value is felt in when a Fiori Application is running. It would be fun to visualize numerous moving parts when a Fiori Application is fully operational.
What is Behavioral Definition?
The next artifact in line to be created is the Behavior Definition.
Observe the patterns of a dog behaves.
We closely see that we have clearly defined what action is being performed by a dog. One chew, one jump, biting, etc.
Apply same in our case. We need to decide how the root CDS view should behave according to the business requirement. Textbook definitions :
A business object behavior definition (behavior definition for short) is an ABAP repository object (a source text artifact) that represents the behavior of the business object in the context of ABAP RAP.
The transactional behavior of a CDS entity is modeled using Behavior Definition Language (BDL).
A root entity can have at most one behavior definition, in which the behavior of the child entities may need to be specified too. Conversely, a behavior definition has precisely one root entity.
The implementation of a behavior definition can be made in both a single ABAP class (a behavior pool) or spread across any number of ABAP classes (behavior pools). This means that any number of behavior pools can be assigned to a behavior definition (a 1:n relation).
STEP 1:
Right click on the Interface View and Click on “New Behavior Definition”.
STEP 2:
Choose the package and MOST IMPORTANTLY the “Implementation Type”.
Observe that we have taken into consideration the Managed Scenario for the ease of demonstration. In the upcoming articles how and when to utilize the Unmanaged Scenario, pros and cons of both shall be discussed in detail.
STEP 3:
Choose the default Transport Request and Click on “Finish”.
STEP 4:
Following screen is seen. Un-comment line number 5, where we specify in this case “lock master”. Activate the behavior definition.
Shortcut to uncomment a line : Ctrl + 7
Shortcut to activate : Ctrl + F3
We see below effect and no errors.
In the above example we have defined that we would be making use of the Create / Update / Delete operations in our Fiori Application or through a Web API.
WHAT should be remembered is that when we create an Unmanaged Behavior Definition, each of the operation shall be exclusively coded using EML – Entity Manipulation Language.
Here, we are keeping it simple and asking system to bother on how to manage the basic CRUD operations.
We shall dig into these further as and when Unmanaged Behavior Definition is discussed.
That is about behavior definition creation steps. Next, we create the service definition.
STEP 5:
Right Click on Root View or Interface View and click on “New Service Definition”.
STEP 6:
Fill in the required details like name of the service definition. In this case it is “Z_I_EMP_DTLS_SD”, where SD – Service Definition and the rest prefix is the main root view.
STEP 7:
Complete the creation of service by selecting the default TR and then “Next” and finally “Finish” with default template of exposing the root view.
STEP 8:
Right click on the service definition just now we created in Step 7, which is under service definition.
Choose the option “New Service Binding”.
Important thing here to keep the right service definition. Double check and then proceed.
STEP 9:
Provide the name “Z_I_EMP_DTLS_SB” , where SB stands for Service Binding.
Point to be noted and observed is the drop down in the Binding Type.
Remember this point when we shall come back and observe the usage of the other “ODATA V2 – Web API” when we shall create an External API to be consumed by the Non-SAP applications or systems.
STEP 10:
Click on “Next” and choose the default TR.
A new screen, a screen that one would be conventionally used hereon and that screen which often gets used is as below:
Click on “Activate” and wait for few seconds.
WOW !!! Done !!! Well Done !!! One Step away from seeing the hard work done from all this while.
Observe the screen below:
Select the Entity and then click on Preview. Remember it is JUST Preview.
We have an amazing tool which is the BUILT-IN Preview of Fiori App inside Eclipse IDE. This enables us to know how the behavior of the CDS Root Entity is and how the Fiori Elements are placed in the standard Fiori Layout.
STEP 11:
Provide the email ID and password that is being used in the SCP Trial Account.
Click on “Log On”.
STEP 12:
Yo Beauty!! But wait.
OOPS !!! No Data ???
Click on “GO”. Give the Green Signal for seeing the results. DO it !
Amazing we are seeing the contents of the table.
STEP 13:
Let’s try other CRUD Operation – Create in this Article 🙂 & Update and Delete in Next Article.
Create:
Click on Create Button.
Well we have done no mistake. Enter the details and see the magic.
Recall in Metadata Extension, what we have mentioned. Click Here.
Likewise we have many things to know and discuss.
Keep faith and confidence that we shall one day create an Fiori App 🙂 Just ONE 🙂
Keep supporting, but before that:
Reminder:
We shall have a tracker along with article number to understand our progress in the article series. This will help us manage the things better and track where we stand. Thumbs Up ?
Sl. No. | Article | Link | Artifact/Summary |
1 | ABAP on Cloud – 1 – Introduction | Click Here | |
2 | ABAP on Cloud – 2 – ABAP Trial Instance on Cloud | Click Here | Trial Account |
3 | ABAP on Cloud – 3 – Eclipse Set-up for ABAP Cloud | Click Here | Eclipse with ADT |
4 | ABAP on Cloud – 4 – Your First ABAP Cloud Project | Click Here | ABAP Cloud Project ABAP Cloud Package |
5 | ABAP on Cloud – 5 – Introduction to RESTFul ABAP Programming | Click Here | CDS and Introduction |
6 | ABAP on Cloud – 6 – DB Creation and Root View in ABAP Cloud | Click Here | DB Table with Fields Domain / Data Element Root Interface View |
7 | ABAP on Cloud – 7 – Insert Records through Class and Create Metadata Extension | Click Here | New ABAP Class in Cloud Metadata Extension |
8 | ABAP on Cloud – 8 – Behavior Definition and Service Definition and Binding & Output | This Article | Behavior Definition Service Definition Service Binding Service Preview |
PENDING | Explanation of CDS Types | ||
PENDING | Explanation of Metadata Extension | ||
PENDING | How to Create a Fiori App | ||
PENDING | Extending Fiori App | ||
PENDING | Unmanaged Behavior Definition |
Comment 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.
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
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
Hi Ruthvik,
These articles are really good! It has helped me a lot.
Please help me out with the below issue.
I’m unable to find the New Service Definition option when I right click on root view.
I’m using eclipse 2020-06 with latest version of ADT.
I have also searched the Other ABAP repository search, but unable to find the option to create New Service Definition.
Thanks,
Divya
Hi Divya,
Thanks for your kind words.
The issue is mainly because of the ADT.
When you configure ADT which is not compatible with 2020/06 Version of Eclipse, the Service Definition will definitely not present.
So, in plug-ins link have :
ADT – ABAP – https://tools.hana.ondemand.com/latest
This makes sure, you have the latest and best.
Happy Coding!
Thanks,
Ruthvik.
Hi,
I have tried the the above article but in service binding i am get the error “The message content is not acceptable” and further it is not proceeding . Could you help if you have faced similar issues.
Thanks,
Basuvaraj.P
Hi Basuvaraj,
Thanks for writing in your question.
Please drop a detailed mail with screen shots of the error and all your artifacts to mail@sayard.com and mailsapyard@gmail.com.
We will check and let you know.
Thanks,
Ruthvik.
Amazing Article. It really helped me a lot in understanding the SCP concepts.
I have followed all the steps explained in this and previous articles. I am able to preview initial fiori screen. When I click on ‘GO’ button it is fetching and displaying the data from my root view. However, when I try to navigate to any record(display one record) by clicking on it, I am getting error “The requested data is not found”. I am getting the same error when I try to create any new record. Could you please help, what could be the issue.
Thanks in advance 🙂
Hi Niharika,
Thanks for your appreciation!!!
You need to do two things to get the “page when clicking on navigation enabled row”.
The page that loads is known as Object Page.
STEP ONE: Please check your Metadata Extension. The code should contain the Identification Reference along with fields that are to be displayed on UI is chosen .
STEP TWO: Please check your Metadata Extension. The Facet must be in place.
Also, just in case you have the UI elements in Root View itself, then check above two things in Root View CDS.
For detailed description read the Article 9 :
https://sapyard.com/abap-on-cloud-9-experimenting-with-metadata-extension-and-crud-operations/
Thanks,
Ruthvik.