Skip to Content
-1

When can we use XSJS, XSODATA and NodeJs?

Nov 02, 2017 at 02:57 PM

61

avatar image
Former Member

We would like to know when we have to go for XSJS/ XSODATA / NodeJs?

10 |10000 characters needed characters left characters exceeded

your question is very vague... what system do you have? what are you trying to accomplish - please provide more details.

0
Former Member

Hi Sergio,

I am new to HANA XSJS Development. I am using HANA trail account to do POC on HANA in SAP HANA Web development workbench. Let me explain my scenario with small example.

I had 2 dependent tables

Table #1:

----------------------------

OrderHeader {

OrderId Integer , // This key is generated using sequence

Description varchar(100)

}

Table #2

------------------------------

OrderItem{

OrderId INTEGER, // This key is associated with OrderHeader~OrderId

OrderItem NVARCHAR(10),

Description varchar(100)

}

And my ODATA service file is

orders.xsodata

------------------------

service{

"<SCHEMA>"."OrderHeader" as "OrdHdr"

create using "xsjsDemo::createHdrData" // ODATA EXIT - Procedure Implementation

update using "xsjsDemo::updateHdrData" // ODATA EXIT - Procedure Implementation

delete using "xsjsDemo::deleteHdrData"; // ODATA EXIT - Procedure Implementation

"<SCHEMA>"."OrderItem" as "OrdItm"

create using "xsjsDemo::createItmData" // ODATA EXIT - Procedure Implementation

update using "xsjsDemo::updateItmData" // ODATA EXIT - Procedure Implementaion

delete using "xsjsDemo::deleteItmData"; // ODATA EXIT - Procedure Implementation

}

I am using SAPUI5 ODATA Batch service call to do this. But i am facing a problem here the generated sequence number (which is in createHdrData Procedure) of OrderHeader is not able to send to OrderItem(Which is in createItmData Procedure). How can i pass this generated number ?

and i found that there are 3 types of implementations for ODATA Exits

1. XS Javascript using .xsjslib

2. Node.js function

3. HANA Procedure

So I was bit confusing when to choose which implementation among XSJS/XSODATA/NodeJs?

Am i able to save whole object(OrderHeader & OrdrerItem) as a transaction using XSODATA service?

Am i able to save whole object(OrderHeader & OrdrerItem) with dependencies using XSJS service?

Am i able to save whole object(OrderHeader & OrdrerItem) with dependencies using Node.js?

In any implementation i need to follow the transaction principle(Save All or None).

Please correct me if something is wrong in my requirement

0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Frank Schuler
Nov 08, 2017 at 06:39 AM
0

Hello Phani,

XSJS and XSODATA have already been available with SAP HANA XS Classic. Node.js has become available with SAP HANA XS Advanced. If you like, there is a great openSAP course on the topic:

Software Development on SAP HANA (Delta SPS 11)

Best regards

Frank

Share
10 |10000 characters needed characters left characters exceeded