Top 12 Sap Hana Xsjs Interview Questions You Must Prepare 19.May.2024

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

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

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.

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"}

}

File extension of XSJS library is .xsjslib

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.

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

service {

"mySchema"."myTable" as "MyTable"

create forbidden

update forbidden

delete forbidden;

}

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://<WebServerHost>:80<SAPHANAinstance>/sap/hana/xs/ide.

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.

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.

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

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.