Understanding RESTful Application Programming
Components
The ABAP RESTful Application Programming Model defines the architecture for end-to-end
development of OData services (such as SAP Fiori apps) in the ABAP environment. It supports the
development of all types of Fiori applications and the publishing of Web APIs. It is based on
technologies and frameworks such as Core Data Services (CDS) for defining semantically rich data
models and a service model infrastructure for creating OData services with bindings to an OData
protocol and ABAP-based application services for custom logic and SAPUI5-based user interfaces.
In this unit, you will create a Sustainable Grocery Application using an ABAP RESTful Application.
The required objects for an ABAP RESTful Application include:
Database Tables
Core Data Service (CDS) Entities
Core Data Service (CDS) Behavior Definitions
Core Data Service (CDS) Metadata Extensions
A Service Definition
A Service Binding
Developing a RAP application consists of the following main steps:
Provide the Database Tables
Developing a RESTful Application starts with providing the database tables. Depending on the
development scenario, these can be existing tables, legacy tables, or tables created specifically for this
application.
Define the Data Model.
The data model of the Business Object is defined with Core Data Service (CDS) Views. Depending on
whether it is a simple or a composite Business Object, one or more CDS Views are required. In the
case of a composite Business Object, this is also the place where you define the entity hierarchy.
Define and Implement the Behavior (Transactional apps only)
The behavior of a RESTful Application Business Object is defined in a repository object called Core
Data Service (CDS) Behavior Definition. Usually, the behavior of a RESTful Application
Programming Business Object also requires some additional logic implemented in a certain type of
global ABAP class called a Behavior Pool. For a non-transactional application, for example, a list
report, the behavior definition or implementation can be omitted.
Project the RESTful Application Programming Business Object and provide service-specific
Metadata
The RESTful Application Programming Business Object projection consists of a data model
projection and, if a behavior has been defined, a behavior projection. To define a projection, you
create one or more Core Data Service (CDS) projection views, which is a type of CDS View, and a
Behavior Projection, which is a type of behavior definition. For User Interface (UI) services, the
projection view(s) should be enriched with UI-specific metadata. To support the future extensibility of
the application, we recommend placing the service-specific annotations in metadata extensions.
Define the Service
In RESTful Applications, a service is defined by creating a Service Definition. The service definition
references the projection views and specifies what should be exposed, that is, what is visible to the
service consumer.
Bind the Service and Test the Service
A service binding is needed to specify how the service should be consumed (UI or Web API) and via
which protocol (OData V2 or OData V4). For UI services, a Preview is available.
Creation of the Sustainable Grocery Application
To create the RESTful Application Program, the following object needs to be created or generated:
A Database Table
A database table will permanently store the data in the database. We will create a simple database
table to store information on your purchased groceries.
Additional Objects
A number of objects required by the RESTful Application Program will be generated through
the Generate ABAP Repository Objects... feature of ABAP Development Tools (ADT).
Behavior
The behavior of a RESTful Application Program Business Object is defined in a repository object
called a Core Data Service (CDS) Behavior Definition. Usually, the behavior also requires additional
logic, which is implemented in a certain type of global ABAP class called a Behavior Pool. For a non-
transactional application, for example, a list report, the behavior definition or implementation can be
omitted. The behavior we will add is an action to check if the grocery items selected have expired.
This will set the expired flag in the database table.
Metadata Extension
The metadata extension file allows customization of the user interface.
Create a Database Table
Database Table for Sustainable Grocery App
A database table is required to store our grocery data. We will create a database table to use in our
Sustainable Grocery Application.
Note
In this exercise, XX refers to your number.
Steps
1. Create a database table named ZXX_GROCERY.
a. Right-click on your package ZS4D100_XX in the Project Explorer and
choose New→Other ABAP Repository Object. Type table in the filter and
choose Database Table. Press Next.
b. Enter ZXX_GROCERY as the name and Groceries as the description. Press Next to
continue.
c. Choose your existing transport request and press Finish.
2. Adjust the ZXX_GROCERY file by copying the template code and replacing all occurrences
of XX with your number.
a. Replace the generated code in ZXX_GROCERY with the following code:
@[Link] : 'Groceries'
@[Link] : #NOT_EXTENSIBLE
@[Link] : #TRANSPARENT
@[Link] : #A
@[Link] : #RESTRICTED
define table zXX_grocery {
key client : [Link] not null;
key id : sysuuid_x16 not null;
product : [Link](40);
category : [Link](40);
brand : [Link](40);
@[Link] : 'zXX_grocery.currency'
price : [Link](10,2);
currency : [Link];
quantity : abap.int2;
purchasedate : [Link];
expirationdate : [Link];
expired : abap_boolean;
rating : [Link];
note : [Link](255);
createdby : abp_creation_user;
createdat : tzntstmpl;
lastchangedby : abp_lastchange_user;
lastchangedat : abp_lastchange_tstmpl;
locallastchanged : abp_locinst_lastchange_tstmpl;
}
a. Copy the code in the exercise by pressing Copy To Clipboard.
b. In Eclipse select Edit→Select All.
c. Select Edit→Delete.
d. Select Edit→Paste.
e. Select Edit→Find/Replace.
f. Enter XX in the Find field and your number in the Replace with field.
g. Press Replace All.
h. Press Close.
i. Press Activate (Ctrl-F3).
Generating Additional Objects
Generating Additional Objects
We have just defined a database table to hold our data, but the app we will create needs more objects
than just this table. We can generate these objects using a wizard in ABAP Development Tools (ADT).
The generated objects contain all the information necessary to provide a working app with create,
read, update, and delete capabilities. Later on, we will also adjust and extend some of these objects to
change the appearance of the user interface and to implement a check for expired groceries.
To start the object generator, right-click the table name in the Project Explorer and choose Generate
ABAP Repository Objects. The wizard starts, and you must enter a package to which all of the new
objects will be assigned. You then select the generator, for this example, we use the ABAP RESTful
Application Programming Model UI Service.
To start the object generator, right-click the table name in the Project Explorer and choose Generate
ABAP Repository Objects.... The wizard starts and you must enter a package to which all of the new
objects will be assigned. You then select the generator; for this example, we are using the ABAP
RESTful Application Programming Model UI Service.
In the RESTful Application Programming Model, you do not access database tables directly. Instead,
you use a Core Data Service (CDS) view entity to define the data model. At this stage, in the
generator, you enter the name of a data definition. Since you are working in the customer namespace,
the name must begin with Z or Y.
You also have to enter an alias name used inside the generated application to identify the entity that
the data definition represents.
With the data mode view that you create, you can read data from the database. However, our app
should also be able to create, modify, and delete data. In order to make this possible, you must define
a behavior definition. This is linked to the data mode view and specifies which of the create, update,
and delete actions are allowed.
As well as specifying which of the create, update, and delete actions should be available, the behavior
definition can also contain the following kinds of definitions:
Draft enabling
Automatic numbering
Validations: These are checks that are carried out when the user enters data in the app
Determinations: A determination performs a calculation to fill fields in the data record.
The generator creates the behavior definition and switches on automatic numbering for the UUID
field. If you need to use validations and determinations, you must add them by hand.
The behavior definition declares which validations and determinations exist. However, they also need
an ABAP implementation. The implementations are methods, so you therefore need an
implementation class. The naming convention for this class is to use the prefix Z or Y for the
customer namespace, followed by BP_R. BP stands for behavior pool and R stands for restricted.
The behavior definition also defines the draft enabling for the entity. Based on the definition of the
data model view, the generator creates a corresponding table that will contain the draft data. You
therefore need to specify the name of the draft table at this point. The naming convention is that for a
basic table Z<table>, the draft table should be called Z<table>_D.
The data model and its behavior definition are a reusable implementation of a particular business
entity. The next step in the object generation is to specify the name of the service projection. The
projection contains a view with precisely the fields required for a particular app, a behavior definition
specifying which of the defined behaviors should be available in the app, and a metadata extension.
The metadata extension contains Core Data Service (CDS) annotations that define how the UI of the
app should look.
The naming convention for the projection layer is ZC_<name>. The projection view, behavior
projection, and metadata extension will all have the same name.
In order to expose the app, you need to create a service definition and a service binding. the service
definition specifies the projection view to be exposed in this service, the service binding specifies the
protocol to be used. In our example define an OData UI service based on version 4 of the OData
protocol.
The naming convention for the service definition is Z<name>. The naming convention for the service
binding is ZUI_<name>_O4. This indicates that the binding is for a Fiori Elements app and that it
uses version 4 of the OData protocol.
At the end of the wizard, the system displays a list of all the objects it will generate. You can check
your entries against the naming conventions, look out for typing errors, and, if necessary, go back and
change any that are incorrect.
Generate Additional Objects
We need to generate the additional objects needed for the RESTful Application Program Sustainable
Grocery App.
Note
In this exercise XX refers to your number.
Steps
1. Generate the additional objects for the RESTful Application Program Sustainable Grocery
App.
a. In the Project Explorer right-click on your database table ZXX_GROCERY and
choose Generate ABAP Repository Objects....
b. Choose ABAP RESTful Application Programming Model→OData UI Service.
Press Next.
c. Enter your package name (ZS4D100_XX) and Press Next.
d. Select Business Object→Data Model. Check Data Definition
Name is ZR_XX_GROCERY and enter the CDS Alias Name: Grocery.
e. Select Business Object→Behavior and check the default generated names for
the Implementation Class is ZBP_R_XX_GROCERY and Draft Table
Name is ZXX_GROCERY_D.
f. Select Service Projection and check the default name is ZC_XX_GROCERY.
g. Select Business Service→Service Definition. Check the default name
is ZUI_XX_GROCERY_O4.
h. Select Business Service→Service Binding. Check the default name
is ZUI_XX_GROCERY_O4 and the binding type is OData V4 - UI.
i. Press Next.
j. View the Preview Generator Output and press Finish to generate the objects.
Modifying Generated Objects
Several objects need to be modified to customize our application
In the data definition file, ZC_XX_GROCERY annotations can be added to enable the
search capabilities of the application. Annotations begin with an @ symbol. Here, we are
adding annotations to allow the search capabilities of specific fields in the application.
The annotation is placed before the field name.
In the Behavior Definition ZR_XX_GROCERY, the fields CreatedBy and CreatedAt will
be read-only. We are also creating an instance action CheckExpirationDate.
In the Behavior Definition ZR_XX_GROCERY, you can have Eclipse generate the
method checkExpirationDate by clicking on the warning in the margin of
the action statement. You then double-click on the Add method ... statement to have the
method generated in the local classes of the implementation
class ZBP_R_XX_GROCERY.
In the behavior definition ZR_XX_GROCERY , the use action checkExpirationDate; is
added to enable the action. .
In the implementation class ZBP_R_XX_GROCERY under the tab Local Types will be
the method for the action checkExpirationDate. Here, code is needed to check
the expirationDate of a selected grocery item and set the flag expired to true or false.
The required code is contained in the exercise.
The metadata extension allows for the adjustment of the user
interface. @[Link] refers to the initial list, while @[Link] refers to the
detail list on a second screen. In this example, the ID is hidden from the application
display. The position is left to right from low to high values. Importance:
#HIGH indicates the field should be displayed on all device sizes, while importance:
#MEDIUM has the field listed on large (desktop) screens and medium (tablet) screens but
not on small (smartphone) screens.
To publish the service, open the service binding ZUI_XX_GROCERY_O4, select the
service, and press the Publish button.
To test the application, choose Grocery under Entity Set and Association of the service
binding ZUI_XX_GROCERY_04. Press Preview... to launch the application.
Once in the Sustainable Grocery App, you can press Go to populate the grocery list from
existing data. You can also use the Search field to search for grocery items.
Press Create to add a new grocery item. Press Delete to remove a grocery item. Select
items with a check box and press Check for expiration to check the Expiration Date and
set the Expired flag.
If you click on a grocery item, you will be taken to a detail page for that item. From the
detail page, you can press Edit to change the item values, press Delete to remove the item,
and press Check for expiration to set the expired flag.
Enable Search Capabilities
Enable Search Capabilities of Sustainable Grocery App
You need to turn on the search capabilities of the Sustainable Grocery App. The search
capabilities are enabled in the Data Definition file ZC_XX_GROCERY.
Objects to adjust:
Object Type Object Name Description of Change
Data Definition ZC_XX_GROCERY Enable search capabilities
Steps
1. Enable the search capabilities in the Data Definition file ZC_XX_GROCERY for
fields Product, Category, Brand, ExpirationDate, Expired , and Rating. Replace the
code in the data definition file by copying and pasting the solution code below.
a. Double-click on the data definition file ZC_XX_GROCERY in the Project
Explorer to open the file.
b. Replace the code in the data definition file by copying the following code:
@[Link]: #CHECK
@[Link]: true
@Search: { searchable: true }
@[Link]: 'Projection View for ZR_XX_GROCERY'
define root view entity ZC_XX_GROCERY
provider contract transactional_query
as projection on ZR_XX_GROCERY
key ID,
@[Link]: true
Product,
@[Link]: true
Category,
@[Link]: true
Brand,
Price,
Currency,
Quantity,
PurchaseDate,
@[Link]: true
ExpirationDate,
@[Link]: true
Expired,
@[Link]: true
Rating,
Note,
CreatedBy,
CreatedAt,
LastChangedBy,
LocalLastChanged
c. In the data definition file ZC_XX_GROCERY, press Ctrl-A to select all the
contents and then press the Delete key. Press Ctrl-V→ to paste the contents
previously copied.
d. Press Ctrl-F. Enter XX in the Find field and your number in the Replace
with field. Press Replace All. Press Close.
e. Press Activate (Ctrl+F3).
Modify Behavior
Modify Behavior of Sustainable Grocery App
The behavior of the Sustainable Grocery App needs to be modified. Some fields should be
read-only and an action needs to be added to check the product's expiration date.
Object Type Object Name Description of Change
Behavior Specify, any read-only fields, create an action to
ZR_XX_GROCERY
Definition check item expiration and generate the action method
Behavior
ZC_XX_GROCERY Enable action to check expiration date
Definition
Steps
1. In the behavior definition file ZR_XX_GROCERY create the
action checkExpirationDate and make fields CreatedBy, and CreatedAt read-only.
a. Double-click on the behavior definition file ZR_XX_GROCERY in the Project
Explorer to open the file.
b. Replace the code in the behavior definition file by copying the following code:
managed implementation in class ZBP_R_XX_GROCERY unique;
strict ( 2 );
with draft;
define behavior for ZR_XX_GROCERY alias Grocery
persistent table zXX_grocery
draft table ZXX_GROCERY_D
etag master LocalLastChanged
lock master total etag LastChangeDat
authorization master( global )
field ( readonly )
ID,
field ( numbering : managed )
ID;
create;
update;
delete;
draft action Edit;
draft action Activate optimized;
draft action Discard;
draft action Resume;
draft determine action Prepare;
mapping for ZXX_GROCERY
ID = id;
Product = product;
Category = category;
Brand = brand;
Price = price;
Currency = currency;
Quantity = quantity;
PurchaseDate = purchasedate;
ExpirationDate = expirationdate;
Expired = expired;
Rating = rating;
Note = note;
CreatedBy = createdby;
CreatedAt = createdat;
LastChangedBy = lastchangedby;
LastChangeDat = lastchangedat;
LocalLastChanged = locallastchanged;
c. In the behavior definition file ZR_XX_GROCERY, press Ctrl-A to select all the
contents and then press the Delete key. Press Ctrl-V to paste the contents
previously copied.
d. Press Ctrl-F. Enter XX in the Find field and your number in the Replace
with field. Press Replace All. Press Close.
e. Press Activate (Ctrl+F3).
2. Generate the action method checkExpirationDate.
a. In the behavior definition file ZR_XX_GROCERY, find the line that defines the
action checkExpiratonDate. It will have a warning that the implementation is
missing. Click on the warning in the margin to see a pop-up that states: Add
method for action checkExpirationDate.... Double-click this line to generate
the method in the implementation class ZBP_R_XX_GROCERY.
b. The implementation class ZBP_R_XX_GROCERY will open in the editor.
Press Activate (Ctrl-F3).
3. To enable the action, add a use action checkExpirationDate; statement to behavior
definition file ZC_XX_GROCERY.
a. Double-click on the behavior definition file ZC_XX_GROCERY in the Project
Explorer to open the file.
b. Replace the code in the behavior definition file by copying the following code:
projection;
strict ( 2 );
use draft;
define behavior for ZC_XX_GROCERY alias Grocery
use etag
use create;
use update;
use delete;
use action Edit;
use action Activate;
use action Discard;
use action Resume;
use action Prepare;
}
c. In the behavior definition file ZR_XX_GROCERY, press Ctrl-A to select all the
contents and then press the Delete key. Press Ctrl-V to paste the contents
previously copied.
d. Press Ctrl-F. Enter XX in the Find field and your number in the Replace
with field. Press Replace All. Press Close.
e. Press Activate (Ctrl+F3).
Check Product Expiration
Implement ABAP Code for Check Product Expiration Date
In the Sustainable Grocery App an action has been defined to check the expiration date of a
product. You need to add ABAP code to check the expiration date and if the expiration date
is in the past, the flag Expired needs to be set.
Object Type Object Name Description of Change
Implementation Add action code to check for selected item
ZBP_R_XX_GROCERY
Class expiration
Steps
1. Implement the local method checkExpirationDate in the implementation
class ZBP_R_XX_GROCERY.
a. Double-click on the class file ZBP_R_XX_GROCERY in the Project Explorer
to open the file.
b. Click on the Local Types tab bottom of the editor window.
c. Replace the code in the behavior definition file by copying the following code:
CLASS lhc_grocery DEFINITION INHERITING FROM cl_abap_behavior_handler.
PRIVATE SECTION.
METHODS:
get_global_authorizations FOR GLOBAL AUTHORIZATION
IMPORTING
REQUEST requested_authorizations FOR Grocery
RESULT result,
checkExpirationDate FOR MODIFY
IMPORTING keys FOR ACTION Grocery~checkExpirationDate RESULT result.
ENDCLASS.
CLASS lhc_grocery IMPLEMENTATION.
METHOD get_global_authorizations.
ENDMETHOD.
METHOD checkExpirationDate.
DATA: lt_groceries TYPE TABLE FOR READ RESULT zr_xx_grocery,
ls_grocery TYPE STRUCTURE FOR READ RESULT zr_xx_grocery,
lv_expiration TYPE d,
lv_current_date TYPE d,
lv_expired TYPE abap_boolean,
lt_update_groceries TYPE TABLE FOR UPDATE zr_xx_grocery.
READ ENTITIES OF zr_xx_grocery
IN LOCAL MODE ENTITY Grocery
ALL FIELDS WITH CORRESPONDING #( keys )
RESULT lt_groceries.
LOOP AT lt_groceries INTO ls_grocery.
lv_expiration = ls_grocery-Expirationdate.
lv_current_date = cl_abap_context_info=>get_system_date( ).
IF lv_expiration < lv_current_date.
lv_expired = abap_true.
ELSE.
lv_expired = abap_false.
ENDIF.
APPEND VALUE #( id = ls_grocery-Id expired = lv_expired )
TO lt_update_groceries.
MODIFY ENTITIES OF zr_xx_grocery IN LOCAL MODE
ENTITY Grocery
UPDATE FIELDS ( expired )
WITH lt_update_groceries.
ENDLOOP.
result = VALUE #( FOR groceries IN lt_groceries
( id = groceries-id %param = groceries ) ).
ENDMETHOD.
ENDCLASS.
d. In the class file ZBP_XX_GROCERY, press Ctrl-A to select all the contents
and then press the Delete key. Press Ctrl-V to paste the contents previously
copied.
e. Press Ctrl-F. Enter XX in the Find field and your number in the Replace
with field. Press Replace All. Press Close.
f. Press Activate (Ctrl+F3).
Enhance User Interface
Customize the User Interface of the Sustainable Grocery App
The user interface of the Sustainable Grocery App needs to be customized to specify which
data to display and in what way.
Objects to adjust:
Object Type Object Name Description of Change
Specify user interface information such as which data
Metadata
ZC_XX_GROCERY to display, how to display the data and enable the
Extension
action functionality
Steps
1. Customize the user interface (UI) by adding @UI annotations to the metadata
extension file ZC_XX_GROCERY. @[Link] refers to the initial list,
while @[Link] refers to the detail list on a second screen. The annotations
are placed before the field name. Here are some sample @UI commands:
@[Link]: true
Hides the field from display
@[Link]
Order the fields from left to right with lower numbers to the right and higher numbers to the
left
@[Link]
Which devices should display item:
#HIGH - all screen sizes (desktops, tablets, and smartphones)
#MEDIUM - large (desktops) and medium (tablet) screens
#LOW - large screens (Desktops)
@[Link]
Label of field
a. Double-click on the metadata extension file ZC_XX_GROCERY in the Project
Explorer to open the file.
b. Replace the code in the behavior definition file by copying the following code:
@[Link]: #CORE
@UI: {
headerInfo: {
typeName: 'Sustainable Grocery App',
typeNamePlural: 'Sustainable Groceries App'
}
}
annotate view ZC_XX_GROCERY with
@[Link]: [ {
id: 'idIdentification',
type: #IDENTIFICATION_REFERENCE,
label: 'Sustainable Groceries App',
position: 10
}]
@UI: { lineItem: [ { exclude: true } ,
{ type: #FOR_ACTION,
dataAction: 'checkExpirationDate' ,
label: 'Check for expiration' } ] ,
identification: [ { position: 1, label: 'ID' } ,
{ type: #FOR_ACTION,
dataAction: 'checkExpirationDate',
label: 'Check for expiration' } ] }
@[Link]: true
ID;
@[Link]: [ {
position: 10 ,
importance: #HIGH,
label: 'Product'
}]
@[Link]: [ {
position: 10 ,
label: 'Product'
}]
Product;
@[Link]: [ {
position: 20 ,
importance: #MEDIUM,
label: 'Category'
}]
@[Link]: [ {
position: 20 ,
label: 'Category'
}]
Category;
@[Link]: [ {
position: 30 ,
importance: #MEDIUM,
label: 'Brand'
}]
@[Link]: [ {
position: 30 ,
label: 'Brand'
}]
Brand;
@[Link]: [ {
position: 40 ,
importance: #MEDIUM,
label: 'Price/Currency'
}]
@[Link]: [ {
position: 40 ,
label: 'Price/Currency'
}]
Price;
@[Link]: true
Currency;
@[Link]: [ {
position: 60 ,
importance: #MEDIUM,
label: 'Quantity'
}]
@[Link]: [ {
position: 60 ,
label: 'Quantity'
}]
Quantity;
@[Link]: [ {
position: 70 ,
importance: #MEDIUM,
label: 'Purchase Date'
}]
@[Link]: [ {
position: 70 ,
label: 'Purchase Date'
}]
PurchaseDate;
@[Link]: [ {
position: 80 ,
importance: #MEDIUM,
label: 'Expiration Date'
}]
@[Link]: [ {
position: 80 ,
label: 'Expiration Date'
}]
ExpirationDate;
@[Link]: [ {
position: 90 ,
importance: #MEDIUM,
label: 'Expired'
}]
@[Link]: [ {
position: 90,
label: 'Expired'
}]
Expired;
@[Link]: [ {
position: 100 ,
importance: #MEDIUM,
label: 'Rating'
}]
@[Link]: [ {
position: 100 ,
label: 'Rating'
}]
Rating;
@[Link]: [ {
position: 110 ,
importance: #MEDIUM,
label: 'Note'
}]
@[Link]: [ {
position: 110 ,
label: 'Note'
}]
Note;
@[Link]: true
CreatedBy;
@[Link]: true
CreatedAt;
@[Link]: true
LastChangedBy;
@[Link]: true
LocalLastChanged;
c. In the metadata extension file ZC_XX_GROCERY, press Ctrl-A to select all
the contents and then press the Delete key. Press Ctrl-V to paste the contents
previously copied.
d. Press Ctrl-F. Enter XX in the Find field and your number in the Replace
with field. Press Replace All. Press Close.
e. Press Activate (Ctrl+F3).
Publish the Sustainable Grocery App
Publish the Sustainable Grocery App
It is time to publish the Sustainable Grocery App.
Objects to adjust:
Object Type Object Name Description of Change
Service Binding ZUI_XX_GROCERY_04 Publish service and test application.
Steps
1. Publish and test the service.
a. Double-click on the service bindings file ZUI_XX_GROCERY_04 in
the Project Explorer to open the file.
b. Expand the service ZUI_XX_GROCERY_04 in the services table and
select the line below with Version entry 1.0.0. Press
the Publish button. The publishing will take a few minutes.
Test the Sustainable Grocery App
Test the Sustainable Grocery App
It is time to test the Sustainable Grocery App.
Note
In this exercise, XX refers to your number.
Objects to adjust:
Object Type Object Name Description of Change
Service Binding ZUI_XX_GROCERY_04 Test application.
Steps
1. Preview the Sustainable Grocery App service.
a. Double-click on the service bindings file ZUI_XX_GROCERY_04 in
the Project Explorer to open the file.
b. In the Service Version Details section, select Grocery in the Entity
Set and Association list.
c. Press Preview... to launch the application.
2. Create a new product entry
a. Choose Create in the application.
b. Enter product Details:
Product Oatmeal
Category Breakfast
Brand Organics
Price 5.00
Currency USD
Quantity 1
Purchase Date Choose 3 weeks ago from today
Expiration Date Choose 3 days from today
Expired Unchecked
Rating 5
Note Yummy
c. Press Create.
d. Press the Alt+Left arrow to go back to the previous screen.
e. Press GO to view your new product.
3. Check expiration processing.
a. Select the check box to the right of your product.
b. Press Check for Expiration. Note field Expired with a value of No.
c. Click on the product line to go to the detail page.
d. Choose Edit to change the product.
e. Change the Expiration Date to 1 day ago.
f. Press Save.
g. Press Check for expiration. Notice fields Expired now with a value
of Yes.
h. Press the Alt+Left arrow to go back to the first page.