cancel
Showing results for 
Search instead for 
Did you mean: 

How to save data entered on input fields on a Hana Table?

Former Member
0 Kudos

Hi people, Im new to this SAPUI5 technology and I have a simple (at last it should be...) issue: I have built an app with some input fields and a "save data" button, and after filling those input fields I would like to get the entered data saved on a Hana Table. I got some outdated tutorials and lots of information and I didn't solve my problem yet, m completely lost, can someone help me?

Accepted Solutions (1)

Accepted Solutions (1)

mantrishekar
Active Participant
0 Kudos

Hi Juliano,

For inserting data from SAP UI5 to HANA we have 2 options

1) Creating .xsjs Service and Insert Data into HANA DB

2) Creating .xsodata service and Insert Data into HANA DB.

Regards,

Shekar.

Former Member
0 Kudos

Ok Mantri, Im going to take a look on that, I was trying this tutorial here: https://blogs.sap.com/2015/03/17/how-to-create-a-new-odata-service-using-the-web-based-workbench/, but Im not sure if this is what Im looking for!

Thank you very much!

Juliano.

mantrishekar
Active Participant

Hi Juliano,

Exactly this is what you need to do.

Regards,

Shekar.

Former Member
0 Kudos

I didn´t find a tuto to help me with this, could you indicate me some? I´ve created a DB and when I try to access the SAP HANA Web-Based Development Workbench, it asks me to enter a username and password, but I have no idea about what username/passoword it´s talking about, I try to fill it with the same credentials I use to access the WEB IDE, but unsuccessfully 😕

Thanks in advance.

mantrishekar
Active Participant

Hi Juliano,

User name is SYSTEM and password is the password which you entered while creating DB

Former Member
0 Kudos

Ok, Im still on the same, completely lost, some tutorial which can help me with this? I've build up my DB on SAP HANA and I have my app created on SAPUI5, but no idea about how to do this link. Maybe Im searching it wrong, because I really find lots of informations on web, but nothing that explains it on a simple way.

Thanks!

mantrishekar
Active Participant
0 Kudos

Hi Juliano,

Are you able to Login to Hana DB and able to see the Table which you created?

Regards,

Shekar.

Former Member
0 Kudos

Hi Mantri, yes, Im. My doubt is about how to create the XS Project and the xsjs file to make this link between SAPUI5/Hana works.

Thank you very much.

Regards!

mantrishekar
Active Participant
0 Kudos

Hi Juliano,

There are Multiple ways of creating xs project(Basically to consume xsjs or xsodata services).

First way : Through SAP Hana Studio. Follow below link to use first approach.

https://blogs.sap.com/2015/06/08/steps-to-create-xs-application-project-using-hana-trial-instance/Second way : In Hana web based Development workbench u can create a SAP UI5 Project and create xsjs files as for your requirement. Follow step 1 and step 2 in below link.

https://www.sap.com/india/developer/tutorials/hana-web-development-workbench.html

Hope this would be helpful.

Regards,

Shekar.

Former Member
0 Kudos

Ok, i´ll try it asap and let you know.

thank you very much for your attention.

Regards,

Juliano

Former Member
0 Kudos

Well, thank u very much for your attention Shekar. I´ve built the XS project as well as the xsjs file, following the steps described on the second tutorial you post, but I don´t know how to proceed to make the whole thing works. I mean, I have a xsjs file with some code inside, but I don´t know what to do now on the SAPUI5 application to call this, could you help me? I´ll show here the code I´ve written on my xsjs file:

screen-shot-11-16-17-at-1139-pm.png

Regards.

Juliano.

mantrishekar
Active Participant
0 Kudos

Hi Juliano,

If you run the respective XSJS Service you will get a URL .

Apply below steps on a Button Click

var url = "someurl";

var oModel = new sap.ui.model.json.JSONModel();

oModel.loadData(url,object,true,"POST");

Here object is nothing but the Object where you stored the entered Data

true for sysnchronous or asynchronous mode for executing specific Service

POST- as you are trying to insert data I wrote Post.If you want to fetch the data you can replace POST with GET.

Former Member
0 Kudos

Got it, I´ll try it, thanks again Shekar!

Regards.

mantrishekar
Active Participant
0 Kudos

Welcome Juliano

Former Member
0 Kudos

Well, any step-by-step tutorial (using sap web ide and hana web ide) you could indicate to me? Im really a newbie on this and all the information I find seems to be too advanced for me, sorry for ask it for you again 😕

Regards!

mantrishekar
Active Participant
0 Kudos

The links which I shared earlier would help you.

Answers (1)

Answers (1)

Sharathmg
Active Contributor
0 Kudos

Are you using annotaions based design or importing an oData moel for interacting with the backend?

Former Member
0 Kudos

Sharath, m not using anything yet, I just know what a need to do, and 'til now I just put the input fields on my app and they are working already. Im really really new to this technology, I've started from scratch some weeks ago, and the only demand I got from my client is: "An app with 8 input fields, and you save the entered data on a Hana Table".

Im still trying to understand what Hana really offers, m not sure if I really need a backend or if I can just use some Hana functionality to save my data.

Thank very much for your attention!