openSAP Ui52 Week 1 Unit 2a 2b Exercises
openSAP Ui52 Week 1 Unit 2a 2b Exercises
Exercises
PUBLIC
TABLE OF CONTENTS
DEVELOPING IN THE CLOUD WITH SAP WEB IDE ..................................................................................... 3
Create an SAP Cloud Platform Developer Account ..................................................................................... 4
Navigate to your Web IDE Workspace ........................................................................................................... 7
Configure the Service for SAP Fiori Launchpad .......................................................................................... 9
Connect to the Demo System ES5 ............................................................................................................... 16
Test the Development Environment ............................................................................................................ 21
Deploy Project to Share it with the Outside World .................................................................................... 26
RELATED MATERIAL .................................................................................................................................... 28
2
DEVELOPING IN THE CLOUD WITH SAP WEB IDE
Summary
In this unit, you’ll set up everything you need for the hands-on exercises in this course. You’ll get to know the
development environment SAP Web IDE, configure your own SAP Fiori launchpad, and create a destination
to the ES5 SAP Gateway demo system. Then, you’ll test everything by creating a “Pre-Flight Check” app.
Finally, you’ll deploy your first app to the SAP Cloud Platform.
Preview
After this exercise, the foundation is established for the rest of the course: The basic configuration is in place
and has been tested, and you understand the corresponding concepts.
3
Create an SAP Cloud Platform Developer Account
Explanation Screenshot
https://account.hanatrial.ondem
and.com/
4
Explanation Screenshot
5
Explanation Screenshot
6
Navigate to Your SAP Web IDE Workspace
Explanation Screenshot
7
Explanation Screenshot
8
Configure the Service for the SAP Fiori Launchpad
In this step you’ll configure the SAP Fiori launchpad in preparation for week 4 of the course.
Explanation Screenshot
9
Explanation Screenshot
10
Explanation Screenshot
11
Explanation Screenshot
12
Explanation Screenshot
13
Explanation Screenshot
14
Explanation Screenshot
You have successfully created a basic SAP Fiori launchpad in preparation for week 5.
15
Connect to the ES5 Demo System
In this step, you create an account with a user name and a password for the SAP Gateway demo system
ES5. Then, you can configure a destination in the SAP Cloud Platform Cockpit.
Sign Up and Get Started with the SAP Gateway Demo Consumption System
Explanation Screenshot
16
Explanation Screenshot
17
Explanation Screenshot
18
Explanation Screenshot
19
Explanation Screenshot
Note that this test is just a technical ping without authorization check. So, if you enter an incorrect password,
this test will still be successful. For this reason, a test was added for the Pre-Flight Check app to see if you
can retrieve a record through the service. If you get the record, the service works.
20
Test the Development Environment
Let’s now check if our SAP Web IDE set-up works by adding the Pre-Flight Check example. From the SAP
Cloud Platform Cockpit, go back to Services, find SAP Web IDE Full-Stack again, and re-open your
workspace by choosing Go to Service.
Explanation Screenshot
21
Explanation Screenshot
22
webapp/index.html (NEW)
<!DOCTYPE HTML>
<head>
<meta charset="UTF-8">
<title>openSAP - Evolved Web Apps with SAPUI5</title>
<link rel="stylesheet" type="text/css"
href="../../resources/sap/ui/core/themes/sap_belize/library.css">
<script id="sap-ui-bootstrap"
data-sap-ui-libs="sap.m"
src="../../resources/sap-ui-core.js"
data-sap-ui-theme="sap_belize">
</script>
<script>
// check javascript
document.addEventListener("DOMContentLoaded", function() {
document.getElementById("web").innerHTML = "Ready!";
});
// check ui5
sap.ui.getCore().attachInit(function() {
new sap.m.Title({
text: "Ready!"
}).placeAt("ui5");
document.getElementById("go").style.display = "block";
});
</script>
</head>
<body class="sapUiBody sapUiSmallMargin sapUiForceWidthAuto">
<h1>Evolved Web Apps With SAPUI5</h1>
<hr/>
<h2>Pre-flight Check</h2>
<ul>
<li><p><strong>Web Page:</strong></p>
<p id="web"></p></li>
<li><p><strong>SAPUI5:</strong></p>
<p id="ui5"></p></li>
<li><p><strong>Backend System:</strong></p>
<iframe id="es5"
src="/ES5/sap/opu/odata/iwbep/GWSAMPLE_BASIC/VH_CountrySet('DE')?$format=xml"
style="border:none; display: block"></iframe>
</li>
</ul>
<h2><span id="go" style="display: none; color: forestgreen">→ All systems go
– ready for take-off!</span></h2>
</body>
</html>
Next, you make your destination available to your app by adding it to the neo-app.json file.
23
Explanation Screenshot
webapp/neo-app.json
{
"welcomeFile": "index.html",
"routes": [
{
"path": "/resources",
"target": {
...
24
Your workspace should now look like this:
Remember to always save your changes by choosing the save icon(s) . You should also use the
preview button in the header toolbar from time to time. This will open a new tab with a preview of your app.
Your “app” (remember: this is just a test) is now simulated in the cloud, and you will see the Pre-Flight Check
app:
Next, you’ll learn how to deploy and share the app on SAP Cloud Platform.
25
Deploy Project to Share it with the Outside World
The link to a deployed app is accessible on the internet. Use it to illustrate technical issues or share your
achievements with other learners.
When previewing your app with the button, you can conveniently test your local development. However,
if you want to share your code, the local preview is not good enough. The URL is connected to your user
session and won’t work for other learners.
webapp/neo-app.json
{
"welcomeFile": "webapp/index.html",
"routes": [
{
"path": "/resources",
"target": {
...
Before deploying the app, you need to configure the path so that SAP Cloud Platform can find the
index.html file. In your SAP Web IDE workspace, (re-)open your neo-app.json file. Adjust the path for
the welcome file by adding webapp/ in front of index.html. Now, the path matches the folder structure in
your webapp folder.
Save the file by clicking on one of the buttons in the top left corner
Explanation Screenshot
26
Explanation Screenshot
27
Explanation Screenshot
In the next unit, you’ll learn how to set up a local development environment as an alternative to SAP Web
IDE, how you can consume UI5, and how you can benefit from the latest UI5 Tooling.
RELATED MATERIAL
Demo Kit: App Development Using SAP Web IDE
28
Coding Samples
Any software coding or code lines/strings (“Code”) provided in this documentation are only examples and are not intended for use in a production system environment. The Code is only intended to better
explain and visualize the syntax and phrasing rules for certain SAP coding. SAP does not warrant the correctness or completeness of the Code provided herein and SAP shall not be liable for errors or
damages cause by use of the Code, except where such damages were caused by SAP with intent or with gross negligence.
www.sap.com/contactsap
© 2018 SAP SE or an SAP affiliate company. All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an SAP affiliate company.
The information contained herein may be changed without prior notice. Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors.
National product specifications may vary.
These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP or its affiliated companies shall not be liable
for errors or omissions with respect to the materials. The only warranties for SAP or SAP affiliate company products and services are those that are set forth in the express warranty statements
accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.
In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related presentation, or to develop or release any functionality
mentioned therein. This document, or any related presentation, and SAP SE’s or its affiliated companies’ strategy and possible future developments, products, and/or platform directions and functionality are
all subject to change and may be changed by SAP SE or its affiliated companies at any time for any reason without notice. The information in this document is not a commitment, promise, or legal obligation
to deliver any material, code, or functionality. All forward-looking statements are subject to various risks and uncertainties that could cause actual results to differ materially from expectations. Readers are
cautioned not to place undue reliance on these forward-looking statements, and they should not be relied upon in making purchasing decisions.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in Germany and other
countries. All other product and service names mentioned are the trademarks of their respective companies. See http://www.sap.com/corporate-en/legal/copyright/index.epx for additional trademark
information and notices.