1. Which Control Libraries Are Used For Ui5 Application Development?

Ans: sap.ui.commons, sap.ui.table and sap.suite.ui libraries for desktop application development and sap.m library along with sap.ui.layout for Fiori application development.

  1. How Navigation Works In Sapui5?

Ans: Sap uses two mechanisms, routing and EventBus. Routing Is specifically used for bookmarking the URL. We define routing in component.js within the metadata. It also defines the navigation path and hash changer which is used at the runtime to change the url of the particular screen.

  1. What Is Component?

Ans: It is the first point of the application, it serves as an index, which encapsulates all the application details, like  view names, routing details, main view, applications type(Full Screen or SplitApp), application service configuration etc.

There are 2 types of compponents:

  • Faceless components: Mainly without UIs, Used for business logic and helper methods e.g. Formatters.
  • UI Component: typically component.js file which is made by extending sap.ui.core.UI Component class.
  1. What Is Responsive Web Design?

Ans: A web application which gives same look and feel to the user in desktops and mobile devices.

  1. What Is The Syntax To Define A Control In Ui5?

Ans: var obj_name = new sap.m.ControlName(“id of control”,{ properties, events, aggregations });

  1. What Is Formatter In Sapui5 And How To Use It?

Ans: We need to use formatter when we need to perform some changes on the back end property data on the front end.

we can use formatter while data  binding to a property like as follows:

oControl = new sap.ui.commons.TextField({
value : {path : “/path”, formatter : function(oEvent){
return “Value:”+oEvent;
}}});

  1. How Many Types Of Views Are Available In Sapui5?

Ans: There are 4 types of views available:

  • JS view
  • JSON view
  • XML view
  • HTML view
  1. How Many Types Of Data Model Are Available In Sapui5?

Ans: SAPUI5 has following predefined four data models available:

  • JSON Model:Client-side model, supports two way binding.
  • XML Model: Client-side model and intended for small data sets this is very rarely used model.
  • Resource Model: This is also client side model used to maintain resource bundles, specially texts.
  • ODATA Model: This is most important model of the four provided.
  1. What All Events/life Cycle Are Available In Sapui5’s Views Controller?

Ans: There are 4 lifecycle available in SAPUI5’s views controller, they are:

  • onInit()– it is called when a view is instantiated and its controls have already been created.
  • onExit()– it is called when the view is destroyed, used to free resources and finalize activities.
  • onAfterRendering()– when the view has been rendered and, therefore, its HTML is part of the document.
  • onBeforeRendering()-It is called before the controller view is re-rendered and not before the first rendering.
  1. What Is The Main Difference Between Odata Model And Json Model?

Ans: The JSON model is a client-side model and, therefore, intended for small datasets, which are completely available on the client.The OData model is a server-side model: the dataset is only available on the server and the client only knows the currently visible rows and fields.

  1. What Is Sapui5 Bootstrapping?

Ans: SAPUI5 Bootstrapping means loading and initializing SAPUI5 in any HTML page. Themes and Libraries are defined in this.

  1. In How Many Ways You Can Bind Data To Your Controls?

Ans: We can bind data to any controls using three methods, Property, Element and Aggregation binding.

  1. What Are Sapui5 Fragments?

Ans: Fragments are very light weight UI controls. Fragments are not completely like views but they act like a view. Fragments are defined similar like views and are names like “Fragment.fragment.xml“.

  1. Does Fragment Have Its Own Controller?

Ans: Fragments are created without controllers, they don’t have their own controllers they share controller of the view which is invoking it.

  1. What Is Metadata Annotations?

Ans: The service metadata document describes the structure of all resources in the service. This structural metadata makes it easy to understand a service. We can explore service metadata at the address “$metadata” relative to the service root.

  1. What Are Common Metadata Annotations?

Ans: Following are some of the service metadata annotations which are common and a front end developer must know these in order to understand the service and integrate it:

  • edm:EntityContainer
  • edm:EntitySet
  • edm:EntityType
  • edm:Property
  • edm:NavigationProperty
  • edm:AssociationSet
  1. What Is Sap Fiori?

Ans: SAPUI5 is client side HTML5 rendering framework or library and SAP FIORI is collection of and released as waves of applications which are completely based on SAPUI5 framework. It means we can create applications using SAPUI5 framework and SAP FIORI is final product i.e. application. In SAPUI5 we have to code from scratch, but in Fiori Application the custom application is already built and enhancements can be done on those custom apps.

  1. How Many Types Of Fiori Applications Are There?

Ans: There are 3 types of fiori applications:

  • Transactional
  • Analytical
  • Fact Sheets
  1. What Is The Difference Between Sap Fiori And Sapui5?

Ans: SAP FIORI is collection of standard applications based on SAPUI5 library provided by SAP. SAP FIORI applications share some standard design guidelines and way in which these application are developed.

  1. What Is Fiori Launchpad And Explain It?

Ans: It is  a home page for all the FIORI applications provided to. There are more than five hundred custom app provided by SAP. This shows tile based UI where every UI redirects to assigned FIORI application. This Launchpad is fully customizable according to your needs like theming and all.

  1. How Can You Get The Web Browser Of The Client On Which Sap Fiori Application Is Running?

Ans: SAPUI5 library provides a special API “sap.ui.Device“which can be used to for device and its feature detection. This API provides flags like “chrome”, “firefox”, “mozilla”, “edge” etc. in “sap.ui.Device.browser” API which returns boolean values.

  1. What Are Fiori Design Principles?

Ans: There are 5 design principles we need to keep in mind while designing SAP Fiori applications.

  • Role Based
  • Delightful
  • Simple
  • Responsive
  • Coherent
  1. Which Open Standards And Tools Are The Foundation Of Sapui5 Technology?

Ans:

  • js for visualization
  • ARIA for accessibility standards and keyboard handling
  • jQuery for managing DOM elements and abstracting browser differences
  1. What Sapui5 Control Metadata Is Used To Configure The Ui Elements At Runtime?

Ans:

  • Associations
  • Properties
  • Aggregations
  1. What Are View Types Offered By Sapui5?

Ans:

  • JavaScript views
  • JSON views
  • XML views
  1. What Is The Purpose Of A Controller?

Ans:

  • To separate the UI and the processing logic
  • To control the application flow by handling user events or updating the view
  1. Name Some Standard Controller Hooks In Sapui5?

Ans:

  • onInit– an event that is called when the view and the controller are instantiated
  • onExit– an event that is called when the view and the controller are destroyed
  1. What Information Can Be Stored In The Manifest.json File Of Your App?

Ans:

  • Root view
  • Supported device types
  • Supported themes
  1. Which Of The Following Namespaces Can Be Used In The Manifest.json File?

Ans:

  • ui5
  • app
  • ui
  1. What Is The Name Of The File Where The Descriptor For Applications, Components, And Libraries Is Stored?

Ans: Manifest.json

  1. For What Stands The Abbreviation Json?

Ans: Java Script Object Notation

  1. Which Data Binding Mode Means A Binding From The Model To The View And From The View To The Model (value Changes In The Model And In The View Update All Corresponding Bindings And The View And Model, Respectively)?

Ans: Two-way

  1. How Would You Add An Icon From The Sapui5 Icon Font To A Button In An Xml View?

Ans: <Button text=”Save Draft” icon=”sap-icon://save” />

  1. Which Predefined Sizes For Margins That Stand For 8px (0.5rem), 16px (1rem), 32px (2rem), Or 48px (3rem) Are Available In Sapui5?

Answer : ‘Tiny’, ‘Small’, ‘Medium’ or ‘Large’

  1. What Is Aggregation Binding Used For?

Ans: To bind a set of data entities to a list-like structure

  1. What Do You Need If You Want To Bind A List To Data In Your Jsonmodel?

Ans:

  • An array with the data in the JSONModel that you want to bind to the list
  • A template list item to be cloned
  • A bound list control
  1. How Can You Access Validation Errors In Sapui5?

Ans:

  • Set handleValidation to true in the manifest.json file.
  • Register to the validationError event on sap.ui.getCore().
  1. Name Some Types In Sapui5?

Ans:

  • ui.model.type.Float
  • ui.model.type.DateTime
  • ui.model.type.Currency
  1. What Coding Do You Need To Add To Your Xml View To Enable Grouping In Your List Binding?

Ans: group: true

  1. Which Of The Following Sequences Of Steps Do You Use To Assemble The Url To Access Your Odata Service’s Metadata?

Ans:

  • Run your app from SAP Web IDE and copy its URL into a new browser tab.
  • In your app’s manifest.json file, go to “services”, copy the URI, and use it to replace the file path in the URL from Step 1.
  • Append “/$metadata” and press enter.
  1. How Many Filters Can You Apply On A List Binding?

Ans: As many as needed

  1. What Is The Best Practice For Showing Or Hiding An Sapui5 Control At Runtime?

Ans: Set the “visible” property of the control to “true” or “false”.

  1. When Do You Use Element Binding?

Ans: When you want bindings of child controls to resolve their paths relative to the binding of the parent

  1. What Is The Difference Between Aggregation Binding And Element Binding?

Ans: Aggregation binding is used for list-like structures, whereas element binding can be used to set the binding context of any parent control.

  1. How Is Paging Accomplished In Odata Query?

Ans: Paging can be accomplished by using $skip in combination with $top. The parameters’ values describe the interval of the data that is requested.

  1. Name Some Odata Query Parameters?

Ans:

  • $skip
  • $count
  • $expand
  1. What Are Semantic Colors In Sapui5?

Ans: They are representations of states such as success, warning, and error.

  1. Name Some Semantic States In Sapui5?

Ans:

  • Positive
  • Negative
  • Critical
  1. How Can You Compose Filters In Sapui5?

Ans:

  • By creating multiple filters and concatenating them either with AND or OR
  • By creating a single sap.ui.model.Filter object and specifying a path, an operator, and up to two values
  1. Where Are Filters Applied In Sapui5?

Ans: To an aggregation binding

  1. Which Filter Operation Can You Use To Filter Items With A Numeric Value Lower Than X?

Ans: sap.ui.model.FilterOperator.LT

 

  1. What Can You Do To Enable Your Sapui5 Application To Adapt To The User’s Device?

Ans:

  • As many controls are responsive out of the box, check whether you have to do anything at all.
  • Set the compact density on devices without touch support.
  1. What Can A “device Model” Be Used For?

Ans:

  • To check whether a device supports touch interaction
  • To influence the user interface without coding, based on the characteristics of the device
  1. What Information Is Provided By The Sap.ui.device Api?

Ans:

  • The device type (phone/tablet)
  • Whether the device has touch support
  • The browser name and version
  1. Which Control Adapts Its Appearance On Touch Devices?

Ans: The PullToRefresh control: It is represented as a simple button on non-touch devices, but the user needs to pull the page content down on touch devices to refresh it.

  1. Why Is It Useful To Have Fragments In Your App?

Ans: To create reusable UI parts without a designated controller or other behavior code

  1. What Happens In The Dom Tree When Nesting Xml Views?

Ans: Each XML view creates its own DOM element regardless of the nesting level.

  1. What Can You Do To Structure Your Application Code Better?

Ans:

  • Use subdirectories for related views and controllers.
  • Use fragments to define reused UI parts only once.
  • Put the functionality used in multiple controllers into a base controller and extend this controller in the other controllers in your app.
  1. What Are Fragments Primarily Used For?

Ans: To make parts of your view reusable

  1. What Are Dialogs In Sapui5?

Ans:

  • They are rendered into a specific area (the static area) in the DOM.
  • They needo be added to the “dependent” aggregation of the view to get access to the models.
  1. What Happens When You Instantiate A Dialog From A Single-rooted Fragment?

Ans:

  • The dialog instance is returned when you invoke the fragment factory.
  • The dialog is instantiated but not displayed.
  1. Which Property Of The Routing Configuration In The Manifest.json File Should You Use To Automatically Display A Target That Is Not Found?

Ans: Bypassed

  1. How Many Targets Can You Configure Within A Route In The Manifest.json File?

Ans:

As many as you like

  1. What Is The Correct Sequence Of Called Functions / Handled Callbacks Of The Odata Model In The Add Controller?

Ans: on metadataLoaded – createEntry – submit – on success

  1. What Is The Recommended Place To Configure A “twoway” Binding For The Odata Model So That Data Changes In The View Are Written Back To The Model?

Ans: In the “models” section of the manifest.json file

  1. How Are Unit Tests For Your App Started In Sap Web Ide?

Ans:

  • By selecting the run configuration Run Unit Tests
  • By right-clicking the unitTests.qunit.html file and selecting an option from the Run menu
  1. How Do You Register A Unit Test In Qunit?

Ans: Call QUnit.test() in your test code with a speaking test description and a callback that contains at least one assertion.

  1. Which Testing Features Are Provided By The Sap Fiori Worklist Application Template?

Ans:

  • A test suite that calls all your unit and integration tests
  • Clear separation of test and production code
  • Unit test setup (QUnit) and basic test coverage
  1. Which Options Are Available In Sapui5 If You Want To Create A Custom Control?

Ans:

  • Extend an existing control with your own features.
  • Create a composite control that reuses existing controls internally.
  • Extend the sap.ui.core.Control base class and build a new control.
  1. Which Of The Following Are Part Of The Control Metadata?

Ans:

  • Aggregations
  • Properties
  • Events
  1. What Do You Have To Consider When Defining Control Metadata?

Ans:

  • You can give an aggregation either one or many values by defining the multiplicity as “one” or “many”.
  • You can make an aggregation invisible in the control API by setting the visibility to hidden.
  1. How Do You Enable The Debugging Option For Sap Netweaver Odata Services?

Ans: Use the URL parameter sap-ds-debug=true.

  1. What Do You Have To Consider When Choosing The Sapui5 Version For The Application Template?

Ans: The SAPUI5 version must be available in your target deployment system.

  1. What Is Openui5?

Ans:

  • A subset of SAPUI5 containing the complete core and more than 200 UI controls
  • A free-to-use and open source UI library ready for your contributions
  1. What Is The Correct Syntax For Defining Namespaces In Xml Views?

Ans: xmlns:m=”sap.m”

  1. Why Is Not All Javascript Code Put In A <script> Tag Directly On The Index.html Page?

Ans:

  • To clearly separate concerns according to the MVC concept.
  • To make your code much easier to read and maintain
  • To enable your code to dynamically load resources as they are needed
  1. What Is A Component Within Sapui5?

Ans: An independent and reusable part that can be used to structure SAPUI5 applications

  1. What Information Can Be Stored Inside The Manifest.json File Of Your App?

Ans:

  • Content densities
  • Root view
  • Models of your app
  1. What Is The Benefit Of Data Binding Within Sapui5?

Ans: SAPUI5 uses data binding to bind two data sources or information sources together to keep them in sync. This means: All changes in one source are also reflected in the other one.

  1. How Can You Add A Margin All Around A Control?

Ans:

class=”sapUiSmallMargin”

  1. Which Base Class Are You Recommended To Extend When Implementing A Custom Type?

Ans: sap.ui.model.SimpleType

  1. How Can You Distinguish Absolute And Relative Binding Paths?

Ans: Absolute binding paths always start with a “/”.

  1. How To Sort And Group Your Sap.m.list When Added To The View.xml?

Ans:

items=”{
path : ‘/ProductSet’,
sorter : {
path : ‘Category’,
group : true
}
}”

  1. How Can You Access The List Item Control In An Event Handler For The Press Event?

Ans: Call the getSource() method at the event object parameter.

  1. What Is The Role Of The Application Template In The Development Process?

Ans: To generate an initial set of files that serve as the starting point for the development of a productive application

  1. How Can Sap.m.table Behave On Smaller Devices Such As Phones And Tablets?

Ans:

  • It hides less important columns.
  • It displays less important columns as a “pop-in”; it stacks them vertically inside the row making the table larger in height.
  1. Which Filter Operation Is Appropriate For A Textual Search In Sapui5?

Ans: sap.ui.model.FilterOperator.Contains

  1. Which Responsiveness Features Can You Realize By Setting Standard Css Classes Provided By Sapui5?

Ans:

  • Adding different margins to controls depending on the screen size
  • Hiding controls depending on the screen size
  1. Which Options For Code Reuse Are Available In Sapui5?

Ans:

  • Controller inheritance
  • Nested views
  • Fragments
  1. When Should You Put Code From Your View Into A Separate View Or Fragment And Nest It Into The Original View?

Ans: When you realize that you need to reuse this code in several other places and views in your app.

  1. What Do You Have To Do To Grant A Dialog Access To The Surrounding View’s Models?

Ans: Add the dialog to an aggregation of the view, for example the “dependent” aggregation.

  1. What Is The Purpose Of The “static Area” In The Dom?

Ans: To display dialogs and popup controls over the application UI

  1. Which Benefits Does The Hash-based Navigation In Sapui5 Offer?

Ans:

  • Hash-based navigation adjusts the current hash to your interactions with the app, so that the URL can always be bookmarked.
  • It allows you to build one-page apps where the contextual navigation is done by changing the hash, so the browser does not have to reload the page.
  1. What Do You Have To Do To Be Notified When The Hash Has Changed To A Certain Pattern?

Ans: Register to the patternMatched event of the route.

  1. What Is Sinon.js?

Ans: A standalone unit testing library for JavaScript that provides spies, stubs, and mocks

  1. Where Does Opa Fit In The Testing Pyramid?

Ans: In component/integration tests

  1. Why Is Automated Testing Beneficial For App Development?

Ans:

  • It significantly reduces the manual testing effort.
  • It is easier to hand over the app to other developers.
  • You can avoid regressions and bugs in your code.
  1. What Is The Main Difference Between Html5 And Sap Ui5?

Ans: HTML5 is a markup language and it doesn’t have programming capabilities but SAP UI5 is a framework which is based on MVC approach to build web applications. HTML5 is mainly for the purpose of creating a simple webpage without formatting and logic but UI5 provides standard style and components to build rich UIs.

  1. What Is Mvc?

Ans:

MVC stands for model view controller; it’s an architecture to design UI based applications to achieve maximum reusability and extensibility of the application for future changes. Model is the representation of data in form of object, View defines the UI and Controller contains all the logic to drive as well connects view with model.

  1. Why Sapui5 Instead Of Html5?

Ans: As HTML5 world is the new age front technology across all aspect of internet applications SAP was kind of trailing in this age because SAP was using age old WebDynpro for building SAP Web Applications which lacks in rich and user-friendly UI. SAP identified this and came up with its own custom HTML5 library i.e. SAPUI5.

SAP UI5 Interview Questions Overall rating: ★★★★☆ 4.4 based on 427 reviews
5 1

Write A Review 

Name
Email
Review Title
Rating
Review Content