For
UI5 apps.
1. Install jdk in our system.
2. Download and extract eclipse
3. When we open eclipse first time, It will ask for workspace. Its folder in
our computer which will store all the files (Webcontent).
1991
HTML 2.0
1995
HTML 3.2
1997
HTML 4.01
1999
XHTML
2000
HTML5
2014
Header
Navigation
Section
Articles
Footer
<h1>Welcome</h1>
<font> <color>
<h1><font=Calibri><color>Welcome</color></font></h1>
CSS Cascading Style Sheets (CSS3)
Style = size, color, background, position
3 ways:
1. Inline we use style attribute at the HTML element level
2. Internal using <style> tag at the page level
3. External Using a external CSS file
Element
Element
Padding
Border
Margin
Size of HTML element on a page = element size + padding +
border + margin
Function in JS
function name(){
}
function(){}
var variable_name = values;
Syntax to create an object
{propName: val, propName2: value}
Array in JS
Var name = [val1,val2,val3]
If we combine the concept of Array and Object, It becomes JSON.
JSON Stands for JavaScript Object Notation. (Internal table of objects)
[{},{},{},{},{}]
Agenda
1. SAP UI5 framework
2. How to setup eclipse
3. SDK
It is a java script library which is responsible for rendering HTML5 pages.
Sap.ui.commons, sap.m,
Sap.ui.table, sap.ui.ux3
Dev.
HTML5 + CSS
https://tools.hana.ondemand.com/
kepler
Syntax
var oName = new
lib_name.API(sId,Prop.);
sId = id of the HTML element
Prop = into curly braces
{ propname: val , propname2:
val2 }
Design a button which is part of
sap.ui.commons library
ps://sapui5.netweaver.ondemand.com/sd
Enabled()
Enabled()
Visible()
Visible()
Exercise : Design a screen for user to enter user name. Also place a
button with click label as Show my name. On click of this button, Display
the user name in popup.
User Name
Show my
Name
Sap.ui.core.Control
All common method and
attributes which can be applied
on any control
Button
TextField
sap.ui.layout
50%
50%
User Name
Password
Password field
Button
Design an application header with a user name field. When user clicks on
Logoff button in application header, Change the entire DOM to logged off
successfully, <username>.
Doc.write()
Controller
action
response
notify
Model
View
Binding
View = screens what user will see. (JS, XML, JSON, HTML)
Model = Data of the application. (JSON, XML, Resourse, Odata)
Controller = Contain the business logic (JS)
View
MAIN.view.js
Create UI
element
objects
SAPUI5
Framewor
k
Package (PKG_ANUBHAV)
Class
CL_ANUBHAV
HB
Car_Type
SADA XUV
N
Sap.ui.core
Mvc
ViewType
JS
Sap.ui.core.mvc.ViewType.JS
View1
View2
View3
Controller
XML(String)
<Employees>
<Employee>
<Id>10</Id>
<Name>Anubhav</Name>
</Employee>
<Employee>
<Id>20</Id>
<Name>Jack</Name>
</Employee>
<Employee>
<Id>30</Id>
<Name>Spiderman</Name>
</Employee>
</Employees>
JAVA
(APIs)
Anubhav, Can you please show an example where we can navigate between
views.
In webdynpro, we have concept of plugs to navigate between views, how do
we achieve here?
Main
Panel
Next
Back
Child
Associatio
n
Data binding
OneWay
TwoWay
OneTime
1. Create object of model class
Sap.ui.model.<model class>.<model type>
2. Set or load data into model
setData or loadData
3. Set the model to
Application, View, Control
Model
Column
1. Title for the column
2. Template = control what type of UI element we want the column to be.
3. Along with the template property we need to also do the binding (From
which property of JSON, it will pick up values)
XML = eXtensible Markup Language unlike HTML, XML can have custom
tags.
Xmls can be processed by programming languages using DOM model.
<employee>
<row>
<empId></empId>
<eName></eName>
<gender></gender>
</row>
<row>
<empId></empId>
<eName></eName>
<gender></gender>
</row>
</employee>
Internationalization
Supporting the application developed in UI5 with multi-lingual support.
LOGIN Screen
Sap.ui.getCore().getModel()
All global variables for the controller are defined in onInit method.
With prefix, this.
1. Formatters
2. Solve the problem of data type
3. How to process XML
Formatters: many times when we develop the application, We would
need to format our data at runtime.
UIProp: {
path: model path,
formatter: formatter_function, function(value){}
}
Value: {
path: model>eName,
formatter: function(input){ convertandreturn}
}
New sap.uitable.table({
Id = myTable
});
UI Table COntrol
Index.html
App
sap.m.App
Pages
App
Goto
Page1
Page2
Back
title
Header
Item1
Item2
Content collection
of items []
Item3
Path of the
binding
Template :
type of list
Details
view
idPage2
Empty
view
Controller 1
View 2
Controller 2
View 3
Controller 3
Data
Chk products
SAP UI5
Framework
Browsers
HTML5 + CSS
Sap.ui.core.Control
Sap.ui.common
s.Button
Sap.ui.common
s.TextView
TextField
Bootstrap
SAP UI5 Framework
sap.m,
sap.ui.commons
1. Location of gmap
api
Google.maps
Google.geocode
Google.marker
http://maps.google.com/maps/api/js?sensor=false
Google.maps.Map => This will create a new map object
Google.maps.Marker => to mark a location on the map
Google.maps.geocoder => pass the address, returns the
lng & lat
COMPONENT.JS
UI Component which encapsulates entire functionality of our Application.
Navigation (Router)
Versioning Information
Dependencies
Global methods and variables
Configurations
Model
Instantiate the main App view
Initialization
1. We want structure our app by keeping all the entities in separate folders.
2. Integrating the app with SAP Launchpad. (Shell and Container)
sap.ui.core.UIComponent.declare(path of component);
sap.ui.core.UIComponent.extend(comp_name,{
metadata: {routers,dependencies,libs,configuration,menifest},
init: function(){},
destroy: function(){},
});
componentname.prototype.createContent = function(){
};
Whenever we use component.js concept the app will be called fiori-like app.
Index.html
MasterPage
s
Views
splitApp
DetailsPage
s
Index.html
Shell
Component
Container
Component.
js
Views
MasterPage
s
Split
App
DetailsPage
s
Odata: Open Data Protocol, this allows us to consume the data over http.
You do not need to worry about underlying data base and its queries.
RESTful APIs = Representational State Transfer
Odata.org
Any odata service we use has 3 parts
1. Service Document defines the entity sets of the services
2. Metadata document allows us to look at the meta data $metadata
3. Data - /EntitysetName
We have a company which is using SAP ERP today. This company wants to
improve the user experience and implement fiori screens. They still want
data from existing erp system.
Fiori
ERP
SAP Netweaver
Gateway 7.4
RFC
Application
DB
Features of odata:
Select some of the fields $select = field names
Paging $top $skip
$expand to check dependent entities data together.
$format = json
BAPI_EPM_PRODUCT_GET_LIST
BAPI_EPM_PRODUCT_GET_DETAILS
BAPI_EPM_PRODUCT_Create
Bapi_EPM_PRODUCT_UPDATE
BAPI_EPM_PRODUCT_DELETE
PRODUCTS
ORDERS
SUPPLIERS
WE WILL NOT HAVE SESSION TOMORROW!!!