SAP HANA XS

Qs 1. What is SAP HANA XS Engine?
Answer: XS Engine is a JavaScript application server based on the Mozilla SpiderMonkey 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
Qs 2. 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"}
}


Qs 3. How can we create a job and schedule it in HANA?
With the help of XSJob 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.

Qs 4. 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;
}

Qs 5. 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.

Qs 6. 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.

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

Qs 8. 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
Qs 9. What is the file extension of XSJS library?
File extension of XSJS library is .xsjslib

Qs 10. 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.

Qs 11. Can we call an xsjslib from another XS project?
Yes. XSJS library (xsjslib) can be called from another XS project or another package.

Qs 12. 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.

Click here to go to Next Chapter. 2.1 All Interview and Question

No comments:

Post a Comment