Professional Documents
Culture Documents
yoppie.aries@gmail.com
SAPUI5 - Learning Plan
Backpack
Basic
MVC Structure
JSON
Binding Data
SAP XSJS
Backpack
What is HTML?
Javascript
A scripting language developed by Netscape to enable Web
authors to design interactive sites. Although it shares many of
the features and structures of the full Java language, it was
developed independently. Javascript can interact with HTML
source code, enabling Web authors to spice up their sites with
dynamic content.
Web Application structure
Introduction to SAPUI5
Editor :
SAP WEB IDE
Eclipse
(Need Java
Development Kit)
Introduction to SAPUI5
Jquery Framework
<ELEMENT>
</ELEMENT>
Single tag <ELEMENT />
</ELEMENT>
<html>
<head>
<title> </title>
</head>
<body>
<p> </p>
</body>
</html>
HTML Practice
Buatlah file .html Ketentuan :
Gunakan Background Color
Isikan dengan : Gunakan align
Title Gunakan placeholder
Gunakan Color
Marque
Text
Input type Text
Button
Link
Gambar
CSS coding convention
Initialize it by element name, id, or class
You can put inside style element in html or use it
externally.
Select Element by :
Purposely to assist
Initiate inside of sript element tag at html
Located inside/outside html page
Case insensitive
Javascript Syntax
Arithmetic Operator
Operator Description
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulus
++ Increment
-- Decrement
Javascript Syntax
Logical
IF ELSE
Conditional statements are used to perform different actions based on
different conditions.
if (condition) {
//block of code to be executed if the condition is true
} else if (condition){
}
SWITCH
The switch statement is used to perform different actions based on
different conditions.
switch(expression) {
case n:
code block
break;
case n:
code block
break;
default:
default code block
}
Javascript Syntax
Looping
DATA
MODELER
HANA
STUDIO
APPLICATION
DATABASE DEVELOPMENT
PROVISIONING
SAPUI5
Model View Controller (MVC)
The Model View Controller (MVC) concept is used in UI5 to separate the representation of information from the
user interaction. This separation facilitates development and the changing of parts independently.
Model, view, and controller are assigned the following roles:
The view is responsible for defining and rendering the UI.
The model manages the application data.
The controller reacts to view events and user interaction by modifying the view and
model.
MVC Complete Structure
View Conventions
View names are capitalized
All views are stored in the view folder
Names of XML views always end with *.view.xml
The default XML namespace is sap.m
Controller Conventions
Controller names are capitalized
Controllers carry the same name as the related view (if there is a 1:1 relationship)
Event handlers are prefixed with on
Controller names always end with *.controller.js
SAPUI5 Element
Input List
Page Message Dialog
ComboBox Panel
Date Picker Icon
Table Layout
Label IconTabBar
Radio Button TextArea
Button
Etc..
https://sapui5.hana.ondemand.com/sdk/docs/api/
Index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
<title>Practice</title>
<script
id="sap-ui-bootstrap"
src="/sap/ui5/1/resources/sap-ui-core.js"
data-sap-ui-theme="sap_bluecrystal"
data-sap-ui-libs="sap.m"
data-sap-ui-compatVersion="edge"
data-sap-ui-preload="sync"
data-sap-ui-xx-bindingSyntax="complex"
data-sap-ui-resourceroots='{
userTest": "./"
}' >
</script>
<script>
sap.ui.getCore().attachInit(function () {
sap.ui.xmlview({
viewName: "userTest.view.App"
}).placeAt("content");
});
</script>
</head>
<body class="sapUiBody" id="content">
</body>
</html>
App.view.xml
<mvc:View
controllerName="userTest.controller.App
xmlns:=sap.m
xmlns:mvc="sap.ui.core.mvc">
</mvc:View>
App.controller.js
sap.ui.define([
"sap/ui/core/mvc/Controller"
], function(Controller) {
"use strict";
return Controller.extend("userTest.controller.App", {
onInit : function(){
}
});
});
SAP HANA XSJS
What is XSJS?
SAP HANA XS JavaScript (XSJS) is an application
programming language in JavaScript. It can be used to
exposes data stored in database tables or views to client
side. Additionally we can also implement any business
logic.
SAP HANA XSJS Architecture
SAP HANA XSJS API SUPPORT
Business Logic
Javascript API
Connection
to DB
Session
Handling API
Request Parameter
Processing API
SAP HANA XSJS
Example
Session Handling
$.session
.getSecurityToken()
.getUsername()
.assertAppPrivilege(privilegeName)
.getTimeout()
Request Handling
$.request
.setBody()
.parameters
.contentType()
.entities
SAP HANA XSJS
Exercise