Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

Important edit: As Thomas Jung mentioned in comment:

Just to be clear: INA is Generally Available, but not designed nor intended to be used in this way.  INA is supported when used as designed.

XS will supply the general REST service enablement you are looking for. These features of XS are planned to be available/supported with HANA 1.0 SP5 at the end of November.

You can get data from SAP HANA using XSEngine from Netweaver Cloud Connectivity Service. Let's start...

I will use HANA AWS for this blog. So it will be total cloud solution!

First of all we will check our SAP HANA XSEngine. Enter your url:

http://host:80<instance>/sap/bc/ina/service/v1/

You will get it like this screen:

Then we will add a connection to Netweaver Cloud. You can get more information about this: https://help.netweaver.ondemand.com/default.htm?cs_getting_started.html#concept_036E470892E74053AC41...

As you see on this screenshot we will use "Basic Authentication". You can use full url of the Attribute view. By adding url like this you can use more than one Attribute View.

Add below to web.xml file.

  <resource-ref>
    <res-ref-name>awshana</res-ref-name>
    <res-type>com.sap.core.connectivity.api.http.HttpDestination</res-type>
  </resource-ref>

Let's write some Java:

            Context ctx = new InitialContext();
            HttpDestination destination = (HttpDestination) ctx.lookup("java:comp/env/awshana");
            HttpClient client = destination.createHttpClient();
            HttpGet get = new HttpGet("/nwturk/AT_MATERIALCollection");
            HttpResponse resp = client.execute(get);
            HttpEntity entity = resp.getEntity();
         } catch (DestinationException e) {
            throw new RuntimeException(e);
         } catch (NamingException e) {
            throw new RuntimeException(e);
         }

As you can see at line number 4 we added attribute view url. So you can get all attribute views like this.

HANA XSEngine returns you JSON format. So it is easy to parse data.

Happy cloud days!

10 Comments
Labels in this area