Skip to Content
0

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

Sep 12, 2017 at 10:09 PM

162

avatar image

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?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Mantri Shekar Sep 13, 2017 at 06:25 AM
0

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.

Show 15 Share
10 |10000 characters needed characters left characters exceeded

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.

0

Hi Juliano,

Exactly this is what you need to do.

Regards,

Shekar.

1

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.

0

Hi Juliano,

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

1

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!

0

Hi Juliano,

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

Regards,

Shekar.

0

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!

0

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.

0

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

thank you very much for your attention.

Regards,

Juliano

0

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.

0

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.

0

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

Regards.

0

Welcome Juliano

0

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!

0

The links which I shared earlier would help you.

0
Sharath M G Sep 13, 2017 at 07:08 AM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

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!

0