Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
AbhishekSharma
Active Contributor
6,973
Hello,

In this beginner blog post we are going to see how to add Determination Functionality in ABAP Restful Application Programming Model.

 

Ref : https://help.sap.com/docs/BTP/923180ddb98240829d935862025004d6/6edb0438d3e14d18b3c403c406fbe209.html

 



 

Determination in ABAP Restful Application Programming Model is used to determine something at runtime, when Trigger condition matches.

Determination is always invoked by Business Object Framework. Determination always defined inside the Behavior Definition of BO and it belongs to the Entity for which the Behavior Definition is created.

Determination can calculate the data or value based on certain condition (Determination Conditions). OR we can also say to understand : Determination can be used to determine value of one field based on some other field.

EX: College Course Duration : Course duration can be determine based on Course Name.

 

Determination is Invoked when Trigger Time matches. This Trigger time can be on save, on modify

on save : Determination will be triggered at the time of saving data i.e. when data getting to Persistent Layer.

on modify: The determination is triggered during a modify operation.

 

Trigger Fields : Determination cal also be triggered by the fields which are assigned to Entity of Business Object.

 

Step by Step Guide


 

Step 1


Define Determination in Behavior Definition.

 

Syntax :


Determination <method name> <Trigger Time> {field : <Trigger Field>}

Creating Determination with method name as updateCourseDuration which will be trigger on on save , and Trigger field would be Course. Since we want to update Course Duration field based on Course selected by user

 


 

Step 2


Determination is defined. Now Follow below steps to create method Implementation.


 


 

Method is created.

 


 

Step 3


Now we are going to write some code which will check if which course is selected by User. Based on Selected Course by User we are going to assign course duration.

 


step 1 : We are reading Entity and getting Course field values

step 2 : We are checking the Course field value. If Computers, then we are updating courseDuration field with 5.

step 3 : We are checking the Course field value. If Electronics, then we are updating courseDuration field with 3

Finally choose Activate All option to activate Determination changes in Behavior Definition.

 

Step 4


Run Application using Service Bindings

 


Choose the Course from F4 help, and click on Save button.

So once Course is changed to Computers the Course Duration field value got updated.

 


 

We can define multiple Determination for multiple Entities. If multiple Determination are defined then we can not know the order of which determination will be triggering first if they are getting triggered on same condition.

 

Thanks-

Abhishek
5 Comments
Labels in this area