Show TOC Start of Content Area

Procedure documentation Defining Entity Service Operations  Locate the document in its SAP Library structure

Use

You use the CRUD (create, read, update, and delete) and findBy operations to set queries on the attributive information of entity services. The CRUD methods cannot be modified; however, you can define findBy methods according to which data you want to query.

Prerequisites

You have created the project carpool and the following entity services:

ü       Employee

ü       Car

ü       Travel

ü       TravelLocation

Procedure

 

       1.      Go to the Operations tab page of the entity service Employee.

       2.      Choose Add… from the Operations window.

       3.      In the New Operation wizard:

                            a.      Enter findByLastName in the field Operation name,

                            b.      Enter Find by Last Name as the Description, and

                            c.      Select lastName from the attribute list table.

This graphic is explained in the accompanying text

       4.      Choose Finish.

The operation will appear in the Operations list.

This graphic is explained in the accompanying text

       5.      Repeat steps 2-4 to create findBy methods for the entity services listed in the table below.

Note

When using the findBy method, the method name should always be prefixed by findBy without any spaces.

Entity Service

Method

Description

Parameters Used

Employee

getAll

Get all

None

Car

getAll

Get all

None

TravelLocation

findByID

Find by ID

ID

Travel

getAll

Get all

None

Travel

findByDateAndCarKey

Find by date and car

startDate, Car

Travel

findByStartDateAndStartLocationAndTargetLocation

Find by start date, start and target locations

startDate, startLocation, targetLocation

       6.      In the Permissions tab page for every entity service created, deselect the Permission checks enabled and Permission on instance level boxes.

       7.      Choose  This graphic is explained in the accompanying text  with the quick info text Save All Metadata to save the project.

 

Your findBy operations are finished!

 

Step 4:

Generating Code and Building Services

End of Content Area