Creating Entity Sets (OData Service)

Creating Entity Sets (OData Service)

Using FAB Workbench Entity Set Designer

 

The Entity Set Designer allows you to define Entity Sets and corresponding Service Model from within the FAB Workbench

 Start a new Form or use Existing Form

Design Entity Set(s)

Let’s say we want an Entity called Plant and an Entity Set called Plants.

In the Fields section of the workbench, press the

 button (Entity Sets)

Design the Entity and Entity Sets as follows:

 

(tip: use Data Element Finder to help find the appropriate Data Element to use)

(tip: use Wizard to generate the entity name and set based on a list of fields from available table/structure)
 

Create Model Provider and Data Provider Classes

The following are one-off steps required to prepare the Model and Service for use.

Model Provider

Create a sub-class of /IQX/CL_FAB_MODEL_PROVIDER by entering a class name under Model Class and click on 

. This will create and activate the class and will automatically assign the form name in the method SET_FORM_NAME.

Data Provider

Create a sub-class of /IQX/CL_FAB_DATA_PROVIDER by entering a class name unde Data Class and click on 

. This will create and activate the class and will automatically assign the form name in the method SET_FORM_NAME.

Create Model and Service

Maintain Model

Enter the Model Name and Version and click on 

 to open the Maintan Model screen

Set the Model Provider Class to the one just created.

Press Save

You may also Check Model

Maintain Service

Enter the Service Name and Version and click on 

 to open the Maintan Service screen

Set the Data Provider Class to the one created above.

Save

Assign Model to Service

Press Assign Model

Enter the Model Name created above (eg ZIQX_MY_DEMO_MODEL)

Save

Activate and Maintain Service

Press 

 from the Entity Set designer to open up the Activate and Maintain Services screen

Press Add Service 

 

Choose the appropriate System Alias (eg LOCAL) and enter Service created above (eg ZIQZ_MY_DEMO_SERVICE)

 

Press Get Services 

 

The Service should be located

 

 

Select Service and press Add Selected Service 

 Assign Package and press Tick 

Press Back

 

Locate the Service and ensure the SICF Node is activated and System Alias is assigned

 

Take note of the SICF Node path (choose ICF Node->Configure (ICF) )

Here it is: /sap/opu/odata/sap/ziqz_my_demo_service

 

Clear the Cache

Press 

 from the Entity Set designer to clear the cache of the service. Additionaly, the transaction /IWFND/CACHE_CLEANUP can be used to clear the cache further

Utilize Model in FAB Form

 

Now that the one-off set up has been completed, the Service can be prepared for use in the Form.

Add a Model Node to the Form

Set the SICF Node to the one created above: (eg : /sap/opu/odata/sap/ziqz_my_demo_service)

Set the Gateway Service (use F4 help)

Give the model an identifier (eg demo)

Provide the Data Provider Class (optional) – [use F4 help]

 

Implement the Service Logic

Implement GET_ENTITY_SET

 

Tip: press the

 button in the Entity Set Designer to navigate to the method GET_ENTITY_SET of the Data Provider Class implementation