Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Week 3 Exercise
Create and Test a Fiori Master Detail App with SAP Web IDE
Exercise - Week 3
Create and Test a Fiori Master Detail App with SAP Web IDE
Prerequisites
Before starting with this exercise, you need an SAP HANA Cloud Platform (HCP)
developer account and a destination in your account to the SAP NetWeaver Gateway
Service Consumption System as described in the week 2 exercise Create a new SAP
HANA Cloud Platform trial account.
Please verify your destination looks like this:
Note
All screenshots are based on SAP Web IDE version 1.9. Future versions of SAP Web IDE
might look different.
Learning Objectives
After going through the prerequisites of setting up your SAP HCP trial account and
creating a new destination to a demo back-end system, you are now ready to access SAP
Web IDE from your browser and create your first Fiori app. It is recommended that you use
the Google Chrome browser to get the best experience with SAP Web IDE.
The SAP Web IDE documentation is available here, and the list of supported browsers by
SAP Web IDE is available here.
In this exercise you will:
1. Create a new SAP Fiori Master Detail Application project by using the service
SALESORDERXX that is available on the ES1 SAP NetWeaver Gateway Service
Consumption System (this back-end service delivers the content data to your app) or,
alternatively, by using an Entity Data Model file (EDMX) provided.
2. Run the resulting app within the SAP Web IDE preview and test the results.
3. Run the app with random or personalized mock-data.
Login to your HANA Cloud Platform account in which you created the destination
to the NetWeaver Gateway Service Consumption System (The account that you
created in the week 2 exercise mentioned earlier).
1.2.
1.3.
In the webide entry details, you can find your personalized SAP Web IDE URL.
This is your starting point for the development environment.
The WebIDE URL should look like the following:
https://webideXXXXXXXX.dispatcher.hanatrial.ondemand.com
You may want to bookmark this URL for future use and easy access.
2. Create a new Project based on Fiori Master Detail App template and
SAP Netweaver Gateway Service
SAP Fiori apps consume data from a backend system using an OData service. In order to
generate and test the UI in SAP Web IDE, you need to have access to an OData service
or to a local Entity Data Model file (EDMX), which holds a service model description.
Using an EDMX file as a starting point is a common practice in projects where different
team members are working on the UI and on the data design. The EDMX file enables you
to start and design your application even before the OData service is ready.
In the week 2 exercise, you created a destination to the SAP NetWeaver Gateway Service
Consumption System that provided you demo data from an SAP back-end system.
In this section, you will start the creation of a Fiori app based on a Master Detail template
included in SAP Web IDE.
1. Launch SAP Web IDE.
2. From your Welcome Page, choose New Project from Template.
3. Alternatively, you can choose in the menu File New Project from Template
4. Choose SAP Fiori Master Detail Application from the templates screen and click Next.
(make sure not to choose SAP Fiori Master Master Detail Application)
5. Give a name to your project, e.g., MyFirstFioriApp and click Next at the bottom of the
page to continue to the next screen.
In the next step, you will create an app based on the destination you already defined in
week 2 (a real SAP NetWeaver Gateway service).
If you were unable to define or connect to a destination (for a real SAP NetWeaver
Gateway service), you can use the alternative method described in section 4 of this
exercise and start your application using an EDMX file. If that is the case, feel free to
skip straight to section 4 now.
6. Select the Service Catalog source and choose the connection to the SAP Netweaver
Gateway Service Consumption System. In the screenshot below, the destination
description is SAP Gateway Demo. In your account the name might be different,
depending on the name you provided when you created the destination.
Note
This might prompt you to login to the back-end system if you didnt store your
credentials during the creation of the destination entry. If this is the case, provide your
credentials when asked to do so.
Select the service SALESORDERXX and click Next to proceed.
7. In the Template Customization step, enter the following values for the Project Settings
and the Master Section.
Note
By using a value for the Project Namespace, you assign a kind of group definition to your
project files. In future exercises when you create a new view, the Project Namespace
value will indicate that the new view and its controller belong to your app or the respective
app that you are going to extend.
8. Scroll down to the Detail Section and provide values for the Detail Section as follows
and leave the Navigation Section blank.
11. Congratulations! Your project based on the service SALESORDERXX has been
created.
10
2. Expand the project folder (in this example, it is the MyFirstFioriApp project).
3. Select the index.html entry in the projects file browser.
4. Click the Run button to open a new browser tab/window.
If there is a successful connection to a back-end service that contains the relevant data,
the app will show the results in the Master Section. Selecting an entry in the Master
Section, corresponding information will be displayed in the Details Section.
11
If you want to learn how to run this application with random or personalized mock-data,
continue to section 5 of this exercise.
12
4. Create a new Project based on Fiori Master Detail App template, local
EDMX file and mock-data
SAP Fiori apps consume data from a back-end system using an OData service. In order to
generate and test the UI in the SAP Web IDE, you need to have access to an OData
service or to a local Entity Data Model file (EDMX), which holds a service model
description. Using an EDMX file as a starting point is a common practice in projects where
different team members are working on the UI and on the data design. The EDMX file
enables you to start and design your application even before the OData service is ready.
This section is provided as an alternative to what was covered in section 2 above and
allows you to complete this exercise without connectivity to an OData service. If you would
like to complete this exercise using this alternative, please follow section 2 steps 1-5 first
and then continue below, which is the screen you should see after completing section 2,
step 5. Otherwise, if you were able to complete section 2 and section 3 above, feel free to
skip straight to section 5.
1. Download the schema_file_salesorder.edmx file from the same openSAP page where
you found this exercise. Select the File System source and browse for the file you just
downloaded. Click on Next to proceed.
13
2. In the Template Customization step enter the following values for the Project Settings
and the Master Section.
Note
By using a value for the Project Namespace, you assign a kind of group definition to your
project files. In future exercises when you create a new view, the Project Namespace
value will indicate that the new view and its controller belong to your app or the respective
app that you are going to extend.
3. Scroll down to the Detail Section and provide values for the Detail Section as follows
and leave the Navigation Section blank.
14
6. Congratulations! Your project based on the SalesOrder EDMX schema file has been
created.
5. Test the app with mock-data and display the result in your SAP Fiori
app
Next you will learn how to test a Fiori App project without back-end data delivered by an
OData service or in addition to an existing OData service. SAP Web IDE allows running
each app with random or individualized mock-data. This helps developers to test their Fiori
apps from design and front-end development perspectives without interferences due to
lack of back-end availabilities.
The easiest way to run the app with mock-data is calling the app with random data.
1. Launch SAP Web IDE.
2. Expand the project folder (in this example, it is the MyFioriApp project).
3. Select the index.html entry in the projects file browser.
15
4. Choose from the menu Run Run with Mock Data to open a new browser
tab/window.
5. Check the results and select an entry in the Master Section to see its detailed
information.
Note
Alternatively, you can right-click on index.html and choose Run Run with Mock Data
16
5. Choose now either the option Generate Random Data and then edit this data. This is
available for both collections of this service / schema file.
17
18
9. To test again, right-click on the index.html entry in the projects file browser and go to
Run Run with Mock Data to open a new browser tab/window
10. Check the results and select an entry in the Master Section to see its detailed
information.
19
www.sap.com