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

    Important T codes for FI GL AR AP

    Details of T Codes Accounting for Finances SPRO Put in the IMG OX02 Company Code to Create, Verify, and Delete OX03. Create Business Area Functional Areas for OKBD OB45 Establish…

    Dynamically Download Data From Any SAP Table in ABAP-740 – Part 1

    A few days ago, one of my SAP BI/BW friends requested a program that would accept any table as input and download it as a file to the local machine.…

    Leave a Reply

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

    You Missed

    Important T codes for FI GL AR AP

    • By Varad
    • December 21, 2024
    • 18 views
    Important T codes for FI GL AR AP

    Dynamically Download Data From Any SAP Table in ABAP-740 – Part 1

    • By Varad
    • December 20, 2024
    • 13 views
    Dynamically Download Data From Any SAP Table in ABAP-740 – Part 1

    Error While Setting Up Trusted System RFC

    • By Varad
    • December 19, 2024
    • 10 views
    Error While Setting Up Trusted System RFC

     Credit Management T codes in SAP

    • By Varad
    • December 18, 2024
    • 24 views
     Credit Management T codes in SAP

    Troubleshooting SAP BD22: Delete Change Pointer Not Picking Correct Processed Messages

    • By Varad
    • December 17, 2024
    • 56 views
    Troubleshooting SAP BD22: Delete Change Pointer Not Picking Correct Processed Messages

    Working with Shell Scripts in SAP ABAP Environment

    • By Varad
    • December 16, 2024
    • 34 views
    Working with Shell Scripts in SAP ABAP Environment