ABAP for Cloud – 8 – Binding & Output, Behavior Definition, and Service Definition

Every ABAP developer wants a little slice of the hot cake that is ABAP on Cloud and RESTful ABAP Programming (RAP). We have made an effort to divide the course material into manageable chunks so that even a complete beginner can grasp the new ABAP Cloud path.

Our customers’ love, support, and incredible response have inspired us to take bigger risks and share more. How the CDS behaves and what causes it to do so have been really interesting to observe. Ultimately, how do we observe it acting? The central piece of this entire series is this article. Please proceed slowly and participate in the hands-on activities with us.

The Metadata Extension issue, which we left for the last post, needs to be put on hold for the time being because a Fiori Application is required to experience its full usefulness. Seeing all the moving pieces come together in a fully functional Fiori application would be entertaining.

Behavioral Definition: What Is It?

The Behavior Definition is the next item on the list to be produced.
Take note of the behaviors that a dog exhibits.

It is evident that we have precisely identified the action that a dog is performing. One bite, one chew, one leap, etc.

Apply the same principle to our situation. The behavior of the root CDS view must be determined in accordance with the business requirement. Definitions from textbooks:

A root entity may have just one behavior definition, and it may be necessary to include information on the behavior of the child entities as well. A behavior specification, on the other hand, contains only one root entity.

A behavior description can be implemented in one behavior pool, or in multiple behavior pools, which are collections of ABAP classes. This implies that a behavior definition (a 1:n relation) can be allocated to any number of behavior pools.

FIRST STEP:

Once you perform a right-click on the Interface View, select “New Behavior Definition.”

Step 2:

Select the package and, above all, 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:

After selecting the standard Transport Request, click “Finish.”

Step Four:

The screen that follows is displayed. Remove the comment on line 5, where “lock master” is specified. Turn on the defining of the behavior.

Shortcut to remove a line’s comments: Press and hold the number seven.
Activation shortcut: Ctrl + F3

No errors

We have indicated in the above example that we will be using a Web API or our Fiori Application’s Create, Update, and Delete functions.

It is important to keep in mind that every operation in an Unmanaged Behavior Definition must be coded completely in Entity Manipulation Language, or EML.

Here, we’re keeping things straightforward and requesting that the system handle the fundamental CRUD functions.

As and when the definition of unmanaged behavior is covered, we will delve deeper into these.

That relates to the steps in creating a behavior specification. We then draft the service description.

Step Five:

Select “New Service Definition” by doing a right-click on either Root View or Interface View.

Step 6:

Enter the necessary information, such as the service definition’s name. The prefix “Z_I_EMP_DTLS_SD” in this instance refers to the main root view, while SD stands for service definition.

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:

Select the service definition that we just defined in Step 7 by right-clicking on it.
Select “New Service Binding” as your option.

Maintaining the correct service definition is crucial in this situation. Check again, then move forward.

Step Nine:

Enter “Z_I_EMP_DTLS_SB,” where SB is an acronym for “Service Binding.”

An important observation is the decrease in the Binding Type.

When we develop an external API that non-SAP applications or systems can use, keep this in mind. We’ll need to examine how the other “ODATA V2 – Web API” is being used.

Step 10:

Select the default TR by clicking “Next.”
A new screen, one that would be utilized customarily from now on, and one that is frequently used is as follows:

After selecting “Activate,” give it a few seconds.

Whoa! Completed! Excellent Work! Just one step separates us from appreciating all of this time’s hard work.

Look at the display below:

After choosing the Entity, select Preview. Recall that this is only a preview.

The BUILT-IN Preview of the Fiori App within the Eclipse IDE is one of our incredible tools. This helps us understand the behavior of the CDS root Entity and the typical Fiori Layout’s placement of the Fiori Elements.

Step 11:

Give the password and email address used to access the SCP trial account.

Click on “Log On”.

STEP 12:

Yo Beauty!! But wait.
OOPS !!! No Data ???

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.

Something is NOT RIGHT ???? Observe the <Unnamed Object>

Well we have done no mistake. Enter the details and see the magic.

Similarly, we have a great deal to learn and talk about.
Have faith and trust that we will eventually develop Just ONE Fiori App.
Continue to support, but first:

Reminder: To monitor our advancement in the article series, we will have a tracker with the article number. This will enable us to monitor our progress and better manage the situation. “Thumbs Up”?

Sl. No.ArticleLinkArtifact/Summary
1ABAP on Cloud – 1 – IntroductionClick Here 
2ABAP on Cloud – 2 – ABAP Trial Instance on CloudClick HereTrial Account 
3ABAP on Cloud – 3 – Eclipse Set-up for ABAP CloudClick HereEclipse with ADT
4ABAP on Cloud – 4 – Your First ABAP Cloud ProjectClick HereABAP Cloud ProjectABAP Cloud Package
5ABAP on Cloud – 5 – Introduction to RESTFul ABAP ProgrammingClick HereCDS and Introduction
6ABAP on Cloud – 6 – DB Creation and Root View in ABAP CloudClick HereDB Table with FieldsDomain / Data ElementRoot Interface View
7ABAP on Cloud – 7 – Insert Records through Class and Create Metadata ExtensionClick HereNew ABAP Class in CloudMetadata Extension
8ABAP on Cloud – 8 – Behavior Definition and Service Definition and Binding & OutputThis ArticleBehavior DefinitionService DefinitionService BindingService 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

And MORE and MORE…

Kindly follow our Facebook page, Instagram, Twitter, LinkedIn Group, and LinkedIn Page…

Comment Please!!

  • Related Posts

    SAP XI/PI – Invoice Attachment Transfer from ARIBA to VIM

    The documents that are connected to the invoice in the Ariba Network system should be transferred to the VIM system via PI Integration as part of the Ariba Supplier Invoice…

    Attachments for SAP XI/PI – ARIBA Invoices sent via PI to S/4HANA

    Integration with SAP systems has never been more intriguing, especially with Ariba, Workday, Concur, Successfactors, Fieldglass, Hybris, and other satellite cloud solution vendors banging on doors every day. 🙂 I…

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    You Missed

    SAP XI/PI – Invoice Attachment Transfer from ARIBA to VIM

    • By Varad
    • November 8, 2024
    • 2 views
    SAP XI/PI – Invoice Attachment Transfer from ARIBA to VIM

    11 Steps to Include a New Field in an Already-Existing SAP LSMW Batch Input Recording

    • By Varad
    • November 6, 2024
    • 2 views

    Part 23 of ABAP for SAP HANA. How Can AMDP Be Used to Access Database Schema Dynamically?

    • By Varad
    • November 4, 2024
    • 2 views

    S/4HANA VDM 1 Employing CDS Virtual Data Model for Embedded Analytics

    • By Varad
    • November 1, 2024
    • 5 views