UI5 and Fiori Interview Questions
UI5 and Fiori Interview Questions
UI5 and Fiori Interview Questions
Framework is a collection of libraries, each library includes classes, and each class includes methods
Q. Evolution of UI technologies
1st:
http://onlinefioritrainings.com
Prepared by : Charu Borkar [email protected]
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy ([email protected]) on UI5 and Fiori
Page |1
Q. Steps to follow in any programming language to develop an application?
Ans.
1. Initialization – load necessary dependencies - – Bootstrap in UI5
<script id=“sap-ui-bootstrap” src=“resources/sap-ui-core.js” data-sap-ui-libs=“sap.m”
data-sap-ui-theme=“sap_bluecrystal” >
</script>
For the theme to be active on the page : specify class “sapUiBody” in the <body> tag of the
html document.
http://onlinefioritrainings.com
Prepared by : Charu Borkar [email protected]
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy ([email protected]) on UI5 and Fiori
Page |2
</head>
<body>
( * place the control in the body )
</body>
<html>
SAP Web IDE can be used in two flavours: Personal Edition ( trial purpose ) & Productive Version
( subscription to companies )
Q. What is HTML?
http://onlinefioritrainings.com
Prepared by : Charu Borkar [email protected]
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy ([email protected]) on UI5 and Fiori
Page |3
HTML stands for Hypertext Markup Language which is created by W3C = World Wide Web
Consortium who is responsible for defining HTML tags and versions. All browser vendors like
Chrome, IE, Firefox, Safari.
It is used to create static web pages.
HTML is not a programming language. It is based on tags, if we follow the approach, we can create a
static webpage using these standard tags. E.g. button, input, datalist, li, ul, h1, table … etc.
Important Points to be noted:
Ø HTML is not case-sensitive
Ø Browser directly understand HTML
Ø User can only see content in browser provided it is kept in body of HTML
Ø 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.
http://onlinefioritrainings.com
Prepared by : Charu Borkar [email protected]
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy ([email protected]) on UI5 and Fiori
Page |4
· Open UI5 is an open source under Apache 2.0 license where as SAP UI5 is a licensed product, this
comes along with SAP Netweaver or SCP (SAP Cloud Platform – formally known as HCP – HANA
Cloud Platform).
html
head body
http://onlinefioritrainings.com
Prepared by : Charu Borkar [email protected]
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy ([email protected]) on UI5 and Fiori
Page |6
Q. What is CSS?
Ans. CSS – Stands for Cascading Style Sheet.
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>
2. 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.
St. to use a tagname selector, it affects elements of entire page with similar 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 not to mention class name at element level. But wrap the element around a tag with a
div tag and use class name.
http://onlinefioritrainings.com
Prepared by : Charu Borkar [email protected]
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy ([email protected]) on UI5 and Fiori
Page |7
Q. What is Responsive Web Design?
Ans. Web design which adapts itself according to screen size to provide a consistent user experience.
Based on device available space, the screen adjusts itself without a scroll bar at page level.
** list of available pseudo classes can be obtained from w3cshools.com, eg. FOCUS, HOVER etc
Q. What is JavaScript?
Ans. It is a programming language understood by browser. It is completely different then java in
terms of design, purpose and concept.
· JavaScript is case-sensitive
· Naming convention to be followed for declaring JavaScript “variables” and “function”
- first word should start with small letter
- next consecutive word should be camel caps or first letter of next word
should caps
eg: HelloWorld à helloWorld
· Every statement of JS should end with semi colon (;)
· Object oriented
http://onlinefioritrainings.com
Prepared by : Charu Borkar [email protected]
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy ([email protected]) on UI5 and Fiori
Page |8
Ans. There are two types of JS:
1. Client side JS – JS code which completely runs in client-side (runs in browser). Eg.UI5,
Angular JS etc to Create responsive web applications.
2. Server side JS – JS code runs on server side. eg. XSJS, Node.JS. Server side programming like
DB lookup, sending email, manipulating data, updating system status.
1. document – object of your DOM (Document Object Model) – Runtime structure of HTML
document
the document object provides lots of methods to obtain the object of HTML element(s)
which are APIs – Application programming Interface – represented by a reusable method or
class.
i. document.getElementById – single element by its id (id of html element is unique)
ii. document.getElementsByClassName – list of all elements by class name
iii. document.getElementsByTagname – list of all elements having that tag
http://onlinefioritrainings.com
Prepared by : Charu Borkar [email protected]
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy ([email protected]) on UI5 and Fiori
Page |9
Ans.
Q. What is jQuery?
Ans. jQuery is not a language. It is a JavaScript library which is concise and fast to avoid writing large
piece of code using JS. It is based on a principle of “write less, do more”.
The most commonly used line of code and methods are available in jQuery to be consumed in the
application code helping developers to quickly achieve desired results without much coding.
There are two ways to consume this library:
- Download the jQuery and reference
- Reference online – CDN(Content Delivery Network)
http://onlinefioritrainings.com
Prepared by : Charu Borkar [email protected]
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy ([email protected]) on UI5 and Fiori
P a g e | 11
Q. What is a Call Back Function in JS?
It is a function which gets triggered when a particular operation is completed. Typically Call Back
Functions are asynchronous and anonymous.
syntax: object.function(callbackFunction);
.hide, .show, .fadeOut, .fadeIn, .animate
Q. What is SDK? What does SAP UI5 SDK offers?
Ans. SDK refers to Software Development Kit. It’s a repository of API’s and related documentation, to
be referred to develop applications based on particular technology.
SAP UI5 SDK offers latest updates on the framework. It gives the latest information about the
evolution in SAP UI5 technology like version, API reference, Sample applications, ICON explorer etc
Statement: For every event in SAP UI5, methods a fireEventName() and attachEventName() and
deattachEventName() get created.
Note that! the control name always starts with capital letter. Pure camel case.
sId: Unique ID of the control.
http://onlinefioritrainings.com
Prepared by : Charu Borkar [email protected]
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy ([email protected]) on UI5 and Fiori
P a g e | 12
sProperties: the attributes/properties of the UI element. All the properties should follow
below syntax
{
propname: “prop val”,
propname: “prop val”
}
http://onlinefioritrainings.com
Prepared by : Charu Borkar [email protected]
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy ([email protected]) on UI5 and Fiori
P a g e | 13
Q. What is MVC Architecture?
getControllerName: function(){
Return the controller name of the view;
}
createContent: function(){
Return objectOfUIControl;
}
Q. How to specify the path of the root folder, in the app, where your view and controller resides?
It is defined by specifying the path in data-sap-ui-resourceroots inside the initialization block under
<script> tag in the header of index.html
data-sap-ui-resourceroots=‘{ “rootnamespace” : “./” }’
http://onlinefioritrainings.com
Prepared by : Charu Borkar [email protected]
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy ([email protected]) on UI5 and Fiori
P a g e | 15
Q. Can we have multiple views in a project?
Yes.
Q. Why you see XML views are preferred, Why SAP recommends XML views, Why standard Fiori
Apps delivered by SAP has XML views only?
MVC – Model View Controller is the Design Pattern we are using.
In order to avoid developers coding any processing logic inside a view, we use xml view. This will
prevent MVC violations.
The parsing of xml is faster than JS views.
XML is standard in industry for creation of user interface.
Q. What is XML?
XML stands for eXtensible Markup Language. It was initially designed for common language for
communication (data transfer) between heterogeneous (multiple) technologies.
To create and process XML, an XML document has to be provided with interfaces/classes and APIs.
When we convert data type (int. table, collection, array) to XML à Rendering
When we convert XML to data type (int. table, coll, arr) à Parsing
IF_IXML, CL_XML_DOCUMENT…IF_IXML_NODE etc. (XI)
http://onlinefioritrainings.com
Prepared by : Charu Borkar [email protected]
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy ([email protected]) on UI5 and Fiori
P a g e | 16
If we have multiple variety of nodes, we can choose which type node we want to create, to do that
you need to use namespace concept in XML. So in the root of XML we can define a recognizable
identity to type of node.
St. 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>”
Every curly braces or bracket will be converted to a forward slash (/), In case of table include index
(starts with 0) in path
/empStr/empNo – path for employee number
Path for salary - /empStr/curr
Employee number for 2nd record -- /empTab/1/empNo
Q. What is binding?
To change and access the data in the model object we use binding.
http://onlinefioritrainings.com
Prepared by : Charu Borkar [email protected]
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy ([email protected]) on UI5 and Fiori
P a g e | 18
Q. what are different APIs to access and change the data in the model object?
oModel.getProperty(“path”) – returns the data at the path level
oModel.setProperty(“path”, “value”) – change the data inside model object.
OR
http://onlinefioritrainings.com
Prepared by : Charu Borkar [email protected]
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy ([email protected]) on UI5 and Fiori
P a g e | 19
3. Aggregation Binding – to connect UI control with multiple set of elements, you need to use
aggregation of the control. Eg. Table-rows. So whenever there are multiple elements, it has
to be achieved by aggregation binding.
4. Element Binding
St. A Container control has an aggregation called pages: and in this aggregation we are going to
create array of views
Now in the Main.View in the createContent Method we return the object of the main view. i.e page
http://onlinefioritrainings.com
Prepared by : Charu Borkar [email protected]
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy ([email protected]) on UI5 and Fiori
P a g e | 20
Q. Steps to Create a control in the UI?
Ans. Creation of Event for the Control (eg: Button) and defining the event in the controller and add
the control to the page
Q. To Access the object of the control , how to get the runtime instance of the object?
Ans. sap.ui.getCore.byId (“”)
http://onlinefioritrainings.com
Prepared by : Charu Borkar [email protected]
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy ([email protected]) on UI5 and Fiori
P a g e | 21