Академический Документы
Профессиональный Документы
Культура Документы
on
SAP Web IDE
HTML5, CSS, Java Script, J Query, Complementary OOPS ABAP, Component JS, Routing, Manifest, Custom Controls
Latest topics covered without copy paste of code.
http://www.onlinefioritrainings.com
For more www.onlinefioritrainings.com
No JAVA knowledge is required to create a Fiori App from scratch.
We need Java Script, that will be covered in the course.
SAP WebIDE – Development environment
SAP UI5 – SAP UI5 is a framework to develop responsive web Application. These applications can be executed on different
platforms, different browsers and different devices.
Framework- Collection of libraries, Each library include classes, each class include methods.
Difference between HTML5 and UI5 ?
Presentation
Mobile
SAP GUI Browser
Devices
Application Layer
S/4HANA Suite 7i
Cloud Apps
Hybris ByD
SAP UI5 design Time component SAP UI5 Run Time component
1. Actual program business or orchestration logic – manipulation, IF, Loop, call - display control to User
<html>
<head>
</head>
<body>
</body>
<html>
Anubhav.abap@gmail.com
http://www.onlinefioritrainings.com
D
T M
Hybrid toolkit
SAP UI5 Framework
SAP WebIDE
Git Repository
IoT
Custom Standard
….
Steps:
1. Install Java - http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
2. Download WebIDE http://tools.hana.ondemand.com
3. Winrar in your computer
4. Copy the WebIDE downloaded file(zip) to yourcompdirectory/MyWebIDE/
5. Extract Here in the folder, This creates and Eclipse folder in your directory.
6. Hint: Those who are already working in laptop with local servers like tomcat, jboss, the port no 8080 is
dedicated to these servers hence WebIDE will not start, Change port no in orion.ini file.
7. Double click on orion.exe and we are ready for SAP Fiori.
8. To start webide use http://localhost:8080/sapwebide/index.html
Funda fox:
Browser directly understand HTML
User can only see content in browser provided it is kept in body of HTML
HTML5 versions are released by W3C, SAP UI5 versions are released by SAP
HTML5 is a markup to just design user interface without any logic, SAP UI5 is a framework.
HTML5 is having standard tags but it is also liberal in nature. SAPUI5 has strict JS syntax to follow.
Open UI5 is a Subset of SAP UI5, Most commonly used libraries are part of open UI5 for consumption by users.
Open UI5 is an open source under Apache 2.0 license. SAP UI5 is a licensed product, this comes along with SAP
Netweaver or SCP (SAP Cloud Platform – formally known as HCP – HANA Cloud Platform).
Declaration of doctype
<head>
</head>
<body>
</body>
Meta tag:
It depicts the metadata of HTML page. For example some characteristics related to HTML documents are
Encoding-type
Author
Keyword
Description GET – read data Server
POST – create data
PUT – update data DNS Server
MERGE – read + update
DELETE - delete
cookies
Webmaster
Funda fox:
Every HTML element can have id property. Developer should make sure that id is always unique.
Html elements can also have name , class (classification) property, which doesn’t needs to be unique.
<header>
Personal address
<article>
Official address
<section> <section>
<footer>
html
head body
CSS is used to do styling of HTML element in a way that it separates the style code from HTML code.
3 ways to apply CSS:
1. Inline Style: is just like element level styling. too much of coding
<tagName style=“prop:value ; prop:value”></tagName>
2. Internal Style: Applying the style for group of elements together, it is also possible to apply style on single element as well.
For applying internal Style, we should use a new tag called <style> tag in the header of HTML.
Syntax:
<style>
selector : {
prop: value;
prop: value
}
</style>
3. External Style: It is just like internal styling but the code for styling is taken out in a separate file and reference the file in
HTML file.
when we use tagname selector, it affects elements of entire page with maching tag, But majorly user needs style on group of
elements. In these cases, we don’t use tagname but we use classname as our selector.
Standard is that we don’t mention class name at element level. But we wrap the element around a tag with a div tag and use
class name.
padding
Selector:pseudo-class{
---CODE
}
Funda Fox:
JS is a programming language which is the only language that browser understand directly.
JS is case-sensitive.
Naming-convention for java script variables and function
The first latter of the word should be small, next consecutive word’s first latter should be capital.- Camel Case
Iloveindia iLoveIndia wearelearningfiori weAreLearningFiori
2 Types of JS:
1. Client side JS – JS code which completely runs in client-side (runs in browser). UI5, Angular JS
Create responsive web applications.
2. Server side JS – JS code runs on server side. E.g. XSJS, Node.JS. Server side programming like db lookup, sending email,
updating system status.
Purpose of JS?
Write imperative logic – if, looping, arithmetic and logical operations
Manipulate the CSS @ runtime
Validate your input
Manipulate the DOM
Output function:
1. alert() – provide a popup to user
2. Console.log – print output to console
3. document.write – replace whole HTML page content with write content
4. .innerText – change text of an HTML element
0 1 2
var itab = [
{ "empId": 100, "empName": "Anubhav" },
{ "empId": 200, "empName": "Roger" },
{ "empId": 300, "empName": "Monika" },
{ "empId": 400, "empName": "Rashi" }
]
Functions in JS:
2 types of functions in JS
1. Anonymous function (functions w/o any name)
function(args, args) {
…..
}
1. Named functions
function functionName(args, args){
…..
}
aynch
Exercise:
Create a table and list of input fields for first name and last name.
When user fill the first name and last name in input field and press on add button, the values should get
Appended to table as a row.
jQuery: it is a java script library. The motive of this JS library is to “write less and do more”.
Most commonly used statements and methods are available in jQuery to consume. It helps developers to quickly
achieve the desired results by writing less amount of code.
Funda fox:
jQuery is not SQL query. It has nothing to do with SELECT, INSERT….
Why jQuery?
Industry standard. Google, Microsoft, Netflix, SAP.
$(selector).method/action();
Funda Fox
Chaining in js: when we call a method in java script, we can call another method on top of it. This called chaining
object.method1().method2().method3();
object.method1(); object.method2() ; object.method3();
Call back function: a function which gets triggered when a particular operation is completed. Typically call
back functions are asynchronous and anonymous.
object.function(callbackFunction);
1
India
Renderer
HTML5, CSS, JS
Browser
Funda fox:
For every property of a SAP UI5 control, We will have setter and getter method available. For example if there is a text
property, we will have setText and getText method to change and read the text of UI Control.
document.getElementById() always return the object of HTML element on which we cannot apply the methods of SAP UI5.
We need to obtain object of SAP UI5 control using different technique.
For every event a fireEventName() and attachEventName() and deattachEventName() methods gets created.
Association in OOPS:
Disadvantage of not doing modularization are
Maintainability of code
Multiple developers cannot work together
B
Error prone
Airplane
1
Engine
n
Association:
1. Aggregation : lose coupling, good to have relationship. Both objects can function independently.
2. Composition : tight coupling, objects cannot function independently. Must have relationship.
Sap.ui.core.Element
sap.ui.core.Control
Funda Fox:
In JAVA SCRIPT we use “extends” keyword to indicate the inheritance.
If you are unable to find property or event of a particular class, check its parent class.
output reads
Model
View
Data binding Data
Input / Output
Models
• JSON Model
• XML model
• Resource Model
• OData Model
Controller - JS
Operand 1
Operand 2 Displaying total
Calculate
Class (mvc)
ViewType
JS XML JSON HTML
sap.ui.core.mvc.ViewType.JS
Yes. Best practice says that we should have one controller per view. Vice-versa is not possible. Which means we cannot have
multiple controllers per view.
Why you see XML views are preferred, Why SAP recommends XML views, Why standard Fiori Apps delivered by SAP has
XML views only?
<xml>
VB.NET
ABAP
C#.NET
Int. table
<xml> Collection, array
<empNo>200</empNo> Elements
Which contains
<eName>Anubhav</eName> 1. Values
2. Attributes
<smoker attr=“val”>false</smoker>
</empStr>
</root>
If we have multiple verity of nodes, we can choose which type node we want to create, we can use namespace concept in
xml. So in the root of xml we can define a recognizable identity to type of node.
Sap.ui.core, sap.ui.commons, sap.m
Namespace:Button
Funda fox:
If we do not pass the <nameofmodel> this model acts like default model for entire application and all UI controls will seek
data from this model. If there are multiple models in a single application, this becomes a confusion for application and UI
controls to pick data from which model? In this case we will give an identifier to the model which we are setting as model
name. in order to refer the model name we use “modelname>”
Binding Type
rows
$(".sapUiTableCol label").css("color","red").css("font-weight","bold")
Model
entitySet
Element 2
Element 3
Element 4
Simple form
Element n
Data source
JSON, ODATA UI
Return value from
value formatter
formatter
New library.ControlName(“id”,{
property: {
path: ‘model path’,
formatter: reference to the function
}
});
.bindProperty(“path”, formatterFunction);
For more www.onlinefioritrainings.com
jQuery.sap.require(“module path”);
Just loading some dependencies.
SAP 1.32 >
Scaffolding template: it used to declare any JS file in the project. This is the forward to declare the resources of our application
and also manage all the dependencies between modules.
Syntax:
sap.ui.define(
[“dependency1”, “dependency2”,….],
function(oDep1, oDep2,…){
return {};
});
Does it change your ABAP code when you write in SE38 from SE80.
No.
www.eclipse.org/downloads/
Workspace: It is a folder in computer where eclipse will store all the projects. (also known as local repository)
ABAP UI5
F5 F11
F6 F10
F7 Shift + F11
F8 F8
Fiori UX
Fiori is all about User Experience.
UI & UX – You can change the User Interface, But you cannot change user
experience.
Fiori is all about user experience. It means set of standard fiori apps delivered
initially by SAP known as X1 Apps. The basis these apps are the guidelines.
SAPGUI
UI5
View
Index.html
View View
Return Page; Return Page;
Browser
Go Next
App Control
oAppObject = objApp.byId(“idAnubhav”);
oAppObject.addPage(objFirst);
DOM.placeAt
title
Item 1 - obj
Item 2 - obj
items …
template …
Item n - obj
sap.m.List
DisplayListItem StandardListItem
sap.m.Table
CustomListItem ColumnListItem
InputListItem ObjectListItem
FeedListItem ActionListItem
When we use XML views the id gets adapted automatically by SAP UI5 framework
It appends the parent id before control id e.g. if we have a list(l) inside a view (v) v--l
Inside event handler try below code
this.getView()
this.getView().byId("idSpidy")
sap.ui.getCore().byId("idSpidy")
STARTofSelection
Select * from dbtab where matnr IN selOpt
Endofpage
Write: with loop.
What to be filter?
On what basis to be filter?
Value to be checked?
2 operands and 1 operator
oList.getBinding(“items”).filter(filterObj);
Operand1 operator Operand2
Name Contains searchString
BaseController
getModel(), getODataModel()
MasterController DetailController
Parasite? survives on the host. It doesn’t cook its food on own its own. It relies on host.
View 1 Controller 1
Fragment XML
View 2 Controller 2
Fragment
returns SelectDialog
Display
x
SimpleForm
Change
!x SimpleForm
Edit Save
Syntax:
Control.extend(“name of the control”, {
metadata: {
properties: {},
aggregation: {},
events: {},
methods: {} Is the renderer object to talk to the browser and tell the
}, browser to put something in DOM.
init: function(){},
renderer: function(oRm, oControl){}
Object of current control which we are designing. With
}); the help of this object oControl, we can access properties
For more www.onlinefioritrainings.com
UX Designer Custom Code Developer
Use build tool to design Developing custom
the UX controls
Google map provides us a JS API with the help of that we can integrate Gmaps in our JS based applications.
Competence
Competent Advantage
Company
Red ocean
orion CDN
UI5
neo-app.json
Framework
SAP Gateway
akamai
Jdk 1.8
Tomcat 8.0
Component.JS wraps the functionality of entire application. It also provides an entry point for our Fiori App.
We are killing the dependency on Index.html.
Funda fox:
If you want to integrate your Fiori Application with SAP Fiori Launchpad, you must have to have the Component.js file in your
project.
Purpose of Component.js
Seamless integration with Fiori Launchpad
Includes all the dependencies of Fiori app on other Fiori
Metadata information of project e.g. version, name, author, template version
Navigation concept for entire UI5 application – Router manifest.json
Dependency on SAP UI5 framework
Ability to define data models at design time (JSON, XML, RES., ODATA)
Includes the OData Service configuration
Fiori application id and app (S/4)
Advanced configurations (ALP, OVP)
Extensibility concepts
Syntax:
sap.ui.define([“sap/ui/core/UIComponent”], function(Component){
return Component.extend(“path”,{
metadata: {},
init: function(){},
destroy: function(){},
createContent: function(){}
});
});
OLD
sap.ui.core.UIComponent.extend(“namespace”,{});
Index.html
App
App
SAP Fiori Launchpad
Master Shell Control
Detail
Index.html
Component.js App
App
Component Container
Master
Detail
For more www.onlinefioritrainings.com
Component js – driver of entire application functionality.
Manifest.json – application descriptor, metadata of application with all required properties inside , referenced in component JS
Neo-app – interface file to connect to WebIDE resources
https://sites.google.com/site/sapfioribatch215/
https://sites.google.com/site/sapfioribatch215/extra-credit
https://sites.google.com/site/sapfioribatch215/my-forms
https://sites.google.com/site/sapfioribatch215/home
Every single page has its own tag, every page is marked with unique identity.
Advantage is that browser can now track the history of these navigations. You need to make every selection, every navigation
A unique state.
Restore the state of UI is currently not possible.
Steps to implement a Router: Router is a read-made object which is available in UICompoenent class.
Config – which is the router class, where all my views are present, what is type of all my views, container
Router (n) – each router will have tagName, name, target (what should be loaded) – [view name, id, where to load]
Presentation Odata
Why OData?
Model
Open standard
Easy to implement HTTP, HTTPS
It is STATELess
Complexity behind Data manipulation
Support CRUD (Create, Read, Update, Delete) OData
Application
Latest version of OData in market is V4
Gateway
Operation HTTP
Read of a single/multiple GET
Creating new record POST
HANA
Deleting data DELETE
Updating data PUT
Read & Update MERGE
For more www.onlinefioritrainings.com
An OData Service includes
Service Document – Displays all the available EntitySets to apply operation on data.
Service Metadata Document – Talks About all the data about data (entitytypes). E.g. for an entityset it includes entitytype.
EntitySet – representation of a real-world object e.g. Material, Sales Order, Sales Order Item etc. All the CRUD operations are
applied on Entityset
EntityType – definition of data, it includes all the properties of an entity e.g. for material entity we have material no, mat
group, storage unit, mat class…. https://sapes4.sapdevcenter.com/sap/opu/odata/iwbep/GWSAMPLE_BASIC/
https://sapes4.sapdevcenter.com/sap/opu/odata/iwbep/GWSAMPLE_BASIC/
Load data for only 10 records ($top=n&$skip=n) SELECT * UP TO ROWS n Fiori App(M)
https://sapes4.sapdevcenter.com/sap/opu/odata/iwbep/GWSAMPLE_BASIC/Product
Set?$format=json&$top=10&$skip=10
Filter data using odata - SELECT * from tab WHERE category = ….
https://sapes4.sapdevcenter.com/sap/opu/odata/iwbep/GWSAMPLE_BASIC/Product bad
Set?$format=json&$filter=Category%20eq%20%27Notebooks%27
Pattern search
https://sapes4.sapdevcenter.com/sap/opu/odata/iwbep/GWSAMPLE_BASIC/Product Gateway
Set?$format=json&$filter=substringof(%27Screen%27,Category)
Order by
https://sapes4.sapdevcenter.com/sap/opu/odata/iwbep/GWSAMPLE_BASIC/Product
Set?$format=json&$orderby=Category ECC
Association
http://localhost:8080/webidedispatcher/destinations/ES4/sap/opu/odata/iwbep/G
WSAMPLE_BASIC/ProductSet('HT-
1010')?$format=json&$expand=ToSupplier,ToSalesOrderLineItems HANA
WebIDE
Neo-app.json
destination
destination
destination
localfile
Intranet
local
OData Service
Neo-app.json
WebIDE
HANA
Gateway GW_FND
Fiori Frontend System
IWBEP, GW_FND
Application
UI5
Application Application
CRM ERP
Fiori backend Backend
Database layer
BP
BAPI_EPM_BP_GET_LIST
BAPI_EMP_BP_GET_DETAIL
BAPI_EPM_BP_CHANGE
BAPI_EPM_BP_CREATE
BAPI_EPM_BP_DELETE
ORDERS