300+ TOP Sap Hana Xsjs Interview Questions and Answers

Q1. What Is Hana Cds? What Are The Artifacts We Can Create Using Cds?

Core Data Services (CDS) artifacts are design-time definitions. When CDS file is activated, it generate runtime objects.

CDS can be used to create following database artifacts:

  • Create a table (entity)
  • Create an SQL views
  • Create an association between entities or views
  • Create a user-defined structured type

Q2. Can We Call An Xsjslib From Another Xs Project?

Yes. XSJS library (xsjslib) can be called from another XS project or another package.

Q3. How Can We Create A Job And Schedule It In Hana?

With the help of XSJs file, we can run a service (for example, an XS JavaScript or a SQLScript) at a scheduled interval.

We first need to define the service either in XSJS or in SQLScript procedure. Then we can create XSJob file and mention the service details along with time interval. Finally from HANA Admin tool we can activate the job.

Q4. What Is The Purpose Of Xsaccess File In Hana Xs Project?

The application-access (.xsaccess) file enables you to specify who or what is authorized to access the content exposed by the application package and what content they are allowed to see.

The application-access file does not have a name before the dot (.); it only has the file extension .xsaccess. The contents of the .xsaccess file must be formatted according to JavaScript Object Notation (JSON) rules.

Example of .xsaccess file:

{

“exposed” : true,

“authentication” : { “method” : “Form”}

}

Q5. What Is The File Extension Of Xsjs Library?

File extension of XSJS library is .xsjslib

Q6. What Is Benefit Of Xodata Compared To Xsjs?

In HANA XSOData, there is a OData framework which provide many functionalities and we only need to provide details like data source, association etc. This is very helpful for developers as coding effort is almost zero. OData framework also takes care of security aspects like SQL injection, XSRF etc.

While in XSJS, we need to code everything our own. This results into more coding effort. We also need to take care of security aspects, performance etc.

Q7. How Can We Create An Xsodata Service Which Only Allows To Read Data But Prevents Any Insert/update/delete Operation?

This can be done with the “forbidden” command. For example:

service {

“mySchema”.”myTable” as “MyTable”

create forbidden

update forbidden

delete forbidden;

}

Q8. What Are The Different Web-based Tools Available In Hana Xs? How Do We Access Them?

There are mainly 4 XS Web-based tools:

  • Editor: Inspect, create, change, delete and activate SAP HANA repository objects.
  • Catalog: Create, edit, execute and manage SQL catalog artifacts in the SAP HANA database.
  • Security: Manage users and roles.
  • Trace: View and download SAP HANA trace files and set trace levels (for example, info, error, debug).

The URL to access these tools is: http://:80/sap/hana/xs/ide.

Q9. What Is Sap Hana Xs Engine?

XS Engine is a JavaScript application server based on the Mozilla Spider Monkey engine. The main idea of SAP HANA XS is to embed a full featured application server, web server, and development environment within the SAP HANA appliance itself.

Important points about SAP HANA XS:

  • XS is a Small footprint application server / web server.
  • It is the basis for an application development platform inside SAP HANA.
  • It simplifies architecture and lowers the TCO (total cost of operation).
  • It provides easy access to SAP HANA database via HTTP-based consumption.

Q10. Is It Possible To Call An External Service From Internet In Xs Application? If Yes, Then How?

Yes, we can call an external service from Internet. This can be achieved with HTTP Destination (xshttpdest).

We first need to create an HTTP Destination file and provide the details of external service along with other security and proxy details. Then we can call this destination from XSJS using $.net.http.readDestination API.

Q11. Suppose We Want To Create An Xs Application And Want To Make It Public. User Should Not Need Any Hana Database User To Access This Application. Is It Possible? If Yes, How?

In .xsaccess file, we can set the authentication to null. After this anyone can open the application without user id and password.

Q12. Can We Call An Http Destination From An Xsjs If Http Destination Is In A Different Package?

No. We must keep the HTTP destination configuration in the same package as the application that uses it. An application cannot reference an HTTP destination configuration that is located in another application package.