How to consume a Search help in OData

In this post, we will learn how to consume a Search help in OData.

Basically, a search help is an DDIC object which will return all the possible entries in which user can select one among them for an input field. These search helps are global (only which are created in SE11) and can also be consumed in OData through mapping. 

Mapping is a process of matching the Data source parameters with respective Entity set properties. 

Now, lets consume a search help in OData.

Create a project using T-code SEGW

How to consume a Search help in OData

Enter the project name, description, package and click on yes

How to consume a Search help in OData

Right click on Data model -> Import -> Search help

How to consume a Search help in OData

Enter the Entity type name, search help name and check the options as shown above.

Note: By selecting the above two check boxes (Query & Read), we don’t need to implement logic manually. The service builder will automatically do the mapping for the GetEntity(Read) & GetEntitySet(Query) under service implementation and implement logic itself in DPC class. we can see this auto-generated code in the DPC class.

How to consume a Search help in OData

Select the parameters which you want to include in the output

How to consume a Search help in OData

Choose at least one key and click on finish. Once done, it looks like below

How to consume a Search help in OData

Note: The Service builder tool will automatically does mapping for the methods GetEntity(Read) & GetEntitySet(Query)

Save the project, generate the run time objects and register the service.

Now, it’s time to test the service

a) Fetching all possible entries

Http Method : GET

Request URI :

How to consume a Search help in OData

b) Fetch a entry based on key

Http Method : GET

Request URI :

How to consume a Search help in OData

Note: We can also import the search help while creating entity types. For that, whatever the fields which are linked with search helps will display their respective search help as like below. Further it’s our choice to import the search help or not by selecting the checkbox. Moreover, both the processes are same.

How to consume a Search help in OData

Leave a Reply