Sie sind auf Seite 1von 62

Internet of Things Using SAP HANA

Lesson Three: HANA XS Web Service


Copyright Blackvard Management Consulting All rights reserved www.blackvard.com
Course Overview

Internet of Things Using SAP HANA


Lesson Three: HANA XS Web Service

Now Available!

Lesson One Lesson Two Lesson Lesson Lesson


Three Four Five
Introductio XS Trial HANA XS Consuming Sample
n To Application Web Data With Application
Internet Prerequisit Service HANA XS
of Things es & Setup

Release Date: Release Date: Release Date: Coming Soon Coming Soon
March 18, 2016 March 31, 2016 April 14, 2016

Learn More @ http://www.blackvard.com/iot-overview


Copyright Blackvard Management Consulting All rights reserved www.blackvard.com
Agenda

What Will Be Covered:

1. Database Setup/Database Connection/HANA XS Web-Service Connection

1. Creating & Connecting an SAP HANA Trial Instance

2. Creating an SAP HANA Subpackage & Repository Workspace

3. Creating an XS Project

4. Creating the Application Descriptors & Role

5. Creating an XS Destination File/Creating an XSJS File/Granting a User Role

6. Testing Your Application

2. About Us

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating an SAP HANA Trial Instance (1/4)

Now lets begin with your next lesson by creating an SAP HANA Trial
instance in the SAP HANA Cloud Platform Cockpit
From the main SAP HANA Cloud Platform Cockpit, select Databases
& Schemas.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating an SAP HANA Trial Instance (2/4)

All available account databases will be listed along w/ ID, Type, Database
System, & Database Version (none are currently available below for this trial).
To view database details (state & existing bindings) select a database list & click the link name.
Database overviews allow you to perform actions such as database deletion, etc.
To create a new trial instance, simply click the New button.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating an SAP HANA Trial Instance (3/4)

The New Database/Schema pop-up screen is displayed.


Enter the Schema ID.
Can be freely defined, but must begin w/ a letter and contain only uppercase & lowercase
letters such as a z or Z, numbers 0 9, & only the special characters of . and -.
For this example, use Schema ID: zhanaxs.
Select an available Database System from the drop-down box & click Save.
For this example, use Database System: HANA XS (<shared>).

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating an SAP HANA Trial Instance (4/4)

The new zhanaxs schema has been successfully created.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Connecting an SAP HANA Trial Instance (1/5)

Return to the Eclipse IDE, to connect directly to the shared


SAP HANA schema, using SAP HANA Tools.
In Eclipse, navigate to Window - > Show View - > Other.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Connecting an SAP HANA Trial Instance (2/5)

In the Show View pop-up, open the SAP HANA folder, and select Systems.
Click the OK button.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Connecting an SAP HANA Trial Instance (3/5)

After clicking OK, you will see the Systems view in the main Eclipse IDE.
From the Systems menu bar, in the bottom right-hand portion of the screen,
select the Add System icon and then select the Add Cloud System option.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Connecting an SAP HANA Trial Instance (4/5)

Modify your Landscape host information (if required).


You can learn more about landscape hosts here:
https://help.hana.ondemand.com/help/frameset.htm?350356d1dc314d3199dca15bd2ab9b0e.html
Enter the Account name, User name, Password, and click Next.
The system will fetch SAP HANA Schemas and Databases for you.
For more information about your account visit:
https://help.hana.ondemand.com/help/frameset.htm?8ed4a705efa0431b910056c0acdbf377.html

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Connecting an SAP HANA Trial Instance (5/5)

In the SAP HANA Schemas and Databases window, choose the


Schemas radio button (if it is not already selected by default).
From the Schemas drop-down menu, select the desired zhanaxs schema.
Click Finish.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating an SAP HANA Subpackage (1/4)

Eclipse is now connected to your SAP HANA Cloud Platform zhanaxs schema.
Proceed to the SAP HANA Development perspective.
If not already in this perspective, click the Open Perspectives icon seen
below, then select SAP HANA Development & click OK.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating an SAP HANA Subpackage (2/4)

In the Systems view, open your project.


Open the Content folder, then open the package (e.g. p1941908884trial).
Right-click on zhanaxs, then follow menu path: New - > Package.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating an SAP HANA Subpackage (3/4)

The New Package dialog box appears.


In both the Name and Description fields, add the new subpackage name
connectivity to the end of the full package path as seen below.
Choose OK to confirm.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating an SAP HANA Subpackage (4/4)

The new subpackage connectivity is added to the package


hierarchy below the zhanaxs package.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating a HANA Repository Workspace (1/3)

Now create a Repository Workspace.


Navigate to the Repositories view.
Click the Create Repository Workspace icon.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating a HANA Repository Workspace (2/3)

Select your SAP HANA system from the displayed SAP HANA Systems list.
If your system is not listed, click the Add System button and add it to the list.
If you have more than one system, ensure the correct system is selected.
Enter Workspace Name zhanaxs (the same name as the root package name).
In the Workspace Root field, browse and select the desired folder that will
contain the workspace you are creating. Click Finish.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating a HANA Repository Workspace (3/3)

The workspace now appears in the Repositories view, and a folder has been
added to your local system (e.g. C:\Users\Erin\hana_work), which will contain
all your development files.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating an XS Project (1/7)

Return to the Project Explorer view.


In the Project Explorer view, choose File - > New - > XS Project.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating an XS Project (2/7)

The New XS Project dialog box appears.


Enter connectivity as the Project name, and click the Next button.
For this tutorial, keep all default settings as-is.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating an XS Project (3/7)

Select the Repository Workspace you created (eg. zhanaxs).


In the Repository Package field, choose the Browse option.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating an XS Project (4/7)

Navigate to the subpackage (e.g. p1941908884trial.zhanaxs.connectivity).


Double-click it, or click OK.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating an XS Project (5/7)

The package now appears in the Repository Package field.


Click Next.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating an XS Project (6/7)

In the New XS Project dialog box, de-select the default XS Application Access
(.xsaccess) and XS Application Descriptor (.xsapp) Access Objects.
Click Finish.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating an XS Project (7/7)

The new project (e.g. connectivity) now appears in the Project Explorer view.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating The Application Descriptors (1/9)

Now create the Application Descriptor file.


In the Project Explorer view, select the project (e.g. connectivity), right-click it.
Choose New - > File.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating The Application Descriptors (2/9)

In the File name field, insert .xsapp, and click Finish.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating The Application Descriptors (3/9)

After entry, save it by clicking the Save icon, or select Ctrl + S.


Activate it by clicking the green Activate SAP HANA Development Object icon.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating The Application Descriptors (4/9)

Now create the Application Access file.


In the Project Explorer view, select the project, and right-click it.
Select New - > File.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating The Application Descriptors (5/9)

Enter the File name as .xsaccess, and click Finish.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating The Application Descriptors (6/9)

For the .xsaccess file, insert the coding seen below.


After entry, save it by clicking the Save icon, or select Ctrl + S.
Activate it by clicking the green Activate SAP HANA Development Object icon.

Enhanced Coding View:

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating The Application Descriptors (7/9)

Now create the Application Privileges file.


In the Project Explorer view, select the project, and right-click it.
Choose New - > File.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating The Application Descriptors (8/9)

Enter the File name as .xsprivileges, and choose Finish.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating The Application Descriptors (9/9)

Insert the coding seen below and click the Save icon.
Then click the Activate SAP HANA Development Object icon.

Enhanced Coding View:

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating The Application Role (1/3)

Now create the Role.


In the Project Explorer view, select the project, and right-click it.
Choose New - > File.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating The Application Role (2/3)

Enter the File name as model_access.hdbrole, and select Finish.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating The Application Role (3/3)

Insert the coding below & replace <package name> with the package name
where the project is shared.
Please note that the brackets <> are only placeholders and should be deleted.
For this tutorial, the code should appear similar to p1941908884trial.zhanaxs.connectivity.
Save the file, then click the Activate SAP HANA Development Object icon.

Enhanced Coding View:

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating an XS Destination File (1/3)

Now create the XS Destination file.


In the Project Explorer view, select the project, and right-click it.
Follow the menu path New - > File.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating an XS Destination File (2/3)

Enter the File name as google.xshttpdest, and click Finish.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating an XS Destination File (3/3)

Insert the below destination configuration settings, then click the Save icon.
Click the Activate SAP HANA Development Object icon.

Enhanced Coding View:

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating an XSJS File (1/4)

Now create the XSJS file.


In the Project Explorer view, select the project, and right-click it.
Follow menu path New - > File.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating an XSJS File (2/4)

Enter the File name as google_test.xsjs, and click Finish.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating an XSJS File (3/4)

Insert the XSJS JavaScript coding below, then click the Save icon.
Click the Activate SAP HANA Development Object icon.
Note: A larger view of the full JavaScript coding can be seen on the next slide.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Creating an XSJS File (4/4)

An enhanced visual of the full XSJS JavaScript coding can be seen below:

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Granting a Role To The User (1/4)

Now Grant a Role to the user.


Return to the Systems view.
Select your system & right-click it, then select Open SQL Console.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Granting a Role To The User (2/4)

The SQL Console opens.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Granting a Role To The User (3/4)

In the SQL Console, enter the coding below:

Replace <SAP HANA Cloud user> w/ your user ID, & replace the sample trial
instance w/ your own trial information as depicted below:

Right-click on the coding,


& select Execute to execute the procedure.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Granting a Role To The User (4/4)

A confirmation message that the statement was successfully executed will


appear.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Testing Your Application (1/8)

Now test the application. Return to the SAP HANA Cloud Platform Cockpit.
Navigate to HANA XS Applications.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Testing Your Application (2/8)

The new HANA XS Application will now display in your SAP HANA
Cloud Platform Cockpit.
In the HANA XS Applications table, click the application URL link to
launch the application.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Testing Your Application (3/8)

Since SAP HANA Cloud Cockpit only displays the root of an applications
URL path, a possible 404 (Not found) error may appear after clicking the
new applications URL.
To resolve this issue, the following steps may be required:
Add the application name to the URL address in the internet browser (hello.xsjs).
Create an index.html file, which is the default setting for the file displayed when the
package is accessed without specifying a file name in the URL.
Override the above default setting by specifying the default_file keyword in the .xsaccess
file. For example:

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Testing Your Application (4/8)

To correct the 404 error (if required), return to the Repositories view in
Eclipse.
Navigate to the connectivity subpackage, and right-click it.
Select New - > Other.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Testing Your Application (5/8)

In the Wizard, open the Web folder, then select HTML File.
Click Next.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Testing Your Application (6/8)

Give the New HTML File the File name: index.html.


Click Finish.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Testing Your Application (7/8)

The below index.html file coding will appear.


Change the Insert title here text to: Hello, World!
Change the character set from ISO-8859-1 to UTF-8 as seen below.
Click the Save icon to save it.
Then click the Activate SAP HANA Development Object icon to activate it.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Testing Your Application (8/8)

Return to the 404 error page, and add index.html to the end of the URL below:
https://s12hanaxs.hanatrial.ondemand.com/p1941908884trial/zhanaxs/connectivity/
Now use the new URL to test your application, as seen here:
https://s12hanaxs.hanatrial.ondemand.com/p1941908884trial/zhanaxs/connectivity/index.html
Your Hello, World! HANA XS Trial Application is now connected & displayed.

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Success You Completed The Lesson!

Congratulations, you completed the lesson!

In this lesson you successfully:


Created & Connected an SAP HANA Trial Instance
Created an SAP HANA Subpackage & Repository Workspace
Created an XS Project
Created Application Descriptors and Role
Created an XS Destination File, XSJS File & Granted a User Role
Tested Your Application

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com10/10


Require A Consultation?

Want to learn more about


connecting your devices?

Contact us today for your FREE


consultation with our experts.

Email: info@blackvard.com

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


What Weve Accomplished

Key Achievements of Blackvard Management Consulting in Previous Projects

Technical project leads and ABAP architects responsible for quality in technical scope and budget in global
roll-outs of SAP Logistics applications (SAP LE / LO)

Conducted multiple SAP ABAP, SAP HANA, and SAP Fiori trainings for various US companies

Implementation of a standard SAP software solution for Spend Management within SAP AG & ARIBA (annual
spend volume 3 Bill. EUR) which can be used in all SAP systems

Improved claims management using SAP FS-CM which is generating annual savings of 15 Mio for a huge
German public healthcare organization

Implemented a global solution for procurement processes at BMW AG using SAP SRM / B2B

Blueprinting and implementation of SAP software for banking credit cancelations for VOLKSWAGEN

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com


Managing Director

Short Bio:
Lukas M. Dietzsch is managing director at Blackvard
Management Consulting, LLC. He is holding a Masters
degree in Information Technology and is an experienced IT
solution architect and project lead.
His strong background in adapting to requirements and
standards in different industries and on various platforms are
valuable assets for Blackvard customers.

Lukas M. He is repeatedly commended by customers for driving


Dietzsch efficient solutions for complex problems in globally
lukas@blackvard.com distributed team environments and meeting tough deadlines.

For further information please visit:


Blackvard Management Consultants
www.blackvard.com

Copyright Blackvard Management Consulting-


Consulting All
Allrights
rightsreserved
reserved www.blackvard.com
Customers That Recommend Blackvard

An overview of current and previous customers:

Copyright Blackvard Management Consulting All rights reserved www.blackvard.com

Das könnte Ihnen auch gefallen