SlideShare a Scribd company logo
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Internet of Things Using SAP HANA
Lesson Four: Consuming Data With HANA XS
Course Overview
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Release Date:
March 18, 2016
Release Date:
March 31, 2016
Coming Soon…
Now Available!
Internet of Things Using SAP HANA
Lesson Four: Consuming Data With HANA XS
Learn More @ http://www.blackvard.com/iot-overview/
Release Date:
April 14, 2016
Release Date:
May 26, 2016
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Agenda
What Will Be Covered:
1. Consuming Data With HANA XS
1. Creating An OData Service
2. INSERT.XSJS Service
3. Granting Authorizations
4. Creating A Sequence
2. About us
Creating An OData Service (1/11)
 Open Eclipse in Project Explorer view to access the connectivity
project you created in lesson three of the Internet of Things Using
SAP HANA: HANA XS Web Service.
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Creating An OData Service (2/11)
 Let’s create a new folder. Select the connectivity project; right-click on it.
 Follow menu path New - > Folder to begin creating a new folder.
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Creating An OData Service (3/11)
 Give the new folder the Folder name: services2, in order to
distinguish the folder from user interfaces, server-side logic, etc.
 Select the Finish button.
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Creating An OData Service (4/11)
 Now create an OData Service that will expose the business partner table.
 Begin by creating a new File. Select the services2 folder; right-click it.
 Follow menu path New - > File.
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Creating An OData Service (5/11)
 Name the File name: analysis.xsodata; click Finish.
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Creating An OData Service (6/11)
 Insert the Service Namespace Syntax seen below into the Eclipse text editor.
 Supply the namespace for documentation purposes, inside the services itself.
 Doesn’t control or generate anything in the system.
 Add the OData service content; including the name of the database artifact you
wish to expose (tables/views/analytic views, etc.).
 For this lesson, in our schema, we have a table called ANALYSIS which we
want to expose in this service.
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Creating An OData Service (7/11)
 After entering the syntax click Save.
Copyright © Blackvard Management Consulting – All rights reserved
www.blackvard.com
Creating An OData Service (8/11)
 Now Commit the file syntax. Select the services2 folder, right-click it.
 Follow menu path Team - > Commit to commit the syntax to the repository
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.comwww.blackvard.com
Creating An OData Service (9/11)
 Now Activate it. Select the services2 folder; right-click it.
 Follow the menu path Team - > Activate.
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Creating An OData Service (10/11)
 We’re ready to test the service in our web browser, using the URL below.
 https://s12hanaxs.hanatrial.ondemand.com/p1941908884trial/zhanaxs/connectivity/services2/analysis.xsodata/
 The screenshot below displays a document, listing a small definition file that
shows the name of the exposed entities in very simple XML documentation.
 You can expose multiple entities & relationships between entities (e.g. All Columns, etc.).
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Creating An OData Service (11/11)
 Add /$metadata to the URL to inspect the service interface & data types.
 https://s12hanaxs.hanatrial.ondemand.com/p1941908884trial/zhanaxs/connectivity/services2/analysis.xso
data/$metadata
 Other programming languages can utilize the service interface and gather all
the required information needed to dynamically call and process the service.
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Creating INSERT.XSJS Service (1/9)
 Let’s create the INSERT.XSJS service; return to the Project Explorer view.
 Select the services2 folder again, right-click it.
 Follow menu path New - > File.
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Creating INSERT.XSJS Service (2/9)
 Insert the File name of: insert.xsjs; click Finish.
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Creating INSERT.XSJS Service (3/9)
 Insert the following XSJS JavaScript coding into the Eclipse text editor.
 NOTE: This is quite a bit of coding, so let’s review what each line of the
text communicates to the system.
 See lines 1 – 12 below, with explanation:
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Lines 1 - 12:
This function getRequestParameters() will parse each
URL parameter and store them in an Array.
This array list will be returned.
Creating INSERT.XSJS Service (4/9)
 See lines 13 – 32 below, with explanation:
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Lines 13 – 32:
The function doGet() calls the previously defined method
getRequestParameters() to get a list of all URL parameters
from the provided URL string.
In the next step, we are ensuring that each paramsObject itself
is not empty, and then we ensure that each of its attributes: tour,
car, alt, and long are NOT empty or not provided.
If they do not contain any data (“ .length <= 0”) or were not
provided ( == NULL), we abort this script.
Creating INSERT.XSJS Service (5/9)
 See lines 33 – 46 below, with explanation:
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Lines 33 – 46:
If our given URL string contains all required parameters and values, we
create a new output in Line 33 and initialize the data within Line 34.
In Line 35, we create a new timestamp.
Line 36, we prepare our database connection that executes in Line 37,
including mapping to our own SCHEMA.
In Line 38, the SQL statement is prepared, which will insert the values
in the table ANALYSIS.
Notice the sequence id_seq_2. This is our first column value. The four
question marks are placeholders for the upcoming values we are
providing in Lines 42 to 45.
Creating INSERT.XSJS Service (6/9)
 See lines 47 – 60 below, with explanation:
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Lines 47 – 60:
In Line 47, we execute the entire command that has been
prepared before. A final commit, in Line 48, for our
database statement will persist the data in the database.
Line 49 creates a new Array and in the Lines 50 – 53, we
push each parameter at the end of the Array.
Line 54 will print all the previously added parameters for
the user (in our sample, this is not required).
Finally, in Line 55, we close the entire database connection
and show with the statement in Line 57 that everything was
successfully inserted in the table.
Creating INSERT.XSJS Service (7/9)
 See lines 61 – 66 below, with explanation:
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Lines 61 – 66:
This is our main program call. We only allow GET URL parameters
(just in case you want to exclude POST).
If we receive a GET call, and only then, the main method doGET()
is called, and will start the parsing process.
Otherwise, we abort and return an error.
Creating INSERT.XSJS Service (8/9)
 After inserting the XSJS JavaScript coding, click the Save icon to save it.
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Creating INSERT.XSJS Service (9/9)
 Click the Activate SAP HANA Development Object icon to activate the service.
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Granting Authorizations (1/4)
 Now Grant an Authorization to the user (INSERT rights to PUBLIC).
 Please note: granting public rights could be a security risk within your organization.
 Return to the Systems view, select your system; right-click it.
 Select Open SQL Console.
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Granting Authorizations (2/4)
 In the SQL Console, enter the coding seen below.
 Please note: granting public rights could be a security risk within your organization.
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Granting Authorizations (3/4)
 Right-click on the coding, & select Execute to execute the SQL script.
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Granting Authorizations (4/4)
 A confirmation message that the statement was successfully executed appears.
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Creating A Sequence (1/8)
 Now Create a Sequence.
 In Systems view, select the SAP HANA Administration Console perspective.
 If it is not already open, click the Open Perspective icon to open it.
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Creating A Sequence (2/8)
 Scroll down to SAP HANA Administration Console.
 Select SAP HANA Administration Console.
 Click OK to open that perspective.
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Creating A Sequence (3/8)
 Return to the Systems view in Eclipse.
 In your project, follow the menu path: Catalog - > <Your SAP HANA Cloud
Developer ID> - > Sequences.
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Creating A Sequence (4/8)
 To create the new sequence, select the Sequences folder, right-click it.
 Select the New Sequence option.
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Creating A Sequence (5/8)
 Enter the Sequence Name as ID_SEQ_2.
 Enter the Start with value as 1.
 Enter the Increment By value as 1.
 Enter the Minimum Value as 1.
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Creating A Sequence (6/8)
 Click the green Execute icon to execute the new sequence.
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Creating A Sequence (7/8)
 The below success message will appear, letting you know the sequence
has been successfully added.
 Also, the ID_SEQ_2 sequence now appears in the Sequences folder.
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Creating A Sequence (8/8)
 Ensure the sequence values have been added successfully.
 Call the following URL in your web browser:
 https://s12hanaxs.hanatrial.ondemand.com/p1941908884trial/zhanaxs/connectivity/services2/insert.
xsjs?car=2&tour=1&alt=1&long=1
 The “Data inserted successfully!” message should appear.
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Success – You Completed The Lesson!
10/10Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Congratulations, you completed the lesson!
In this lesson you successfully learned:
– Consuming Data With HANA XS
• Creating OData Service
• INSERT.XSJS Service
• Granting An Authorization
• Creating A Sequence
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
Want to learn more about
connecting your devices?
Contact us today for your FREE
consultation with our experts.
Email: info@blackvard.com
Require A Consultation?
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
 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
Key Achievements of Blackvard Management Consulting in Previous Projects
What We’ve Accomplished
Blackvard Management Consultants
www.blackvard.comCopyright © Blackvard Management Consulting – All rights reserved
Short Bio:
Lukas M. Dietzsch is managing director at Blackvard
Management Consulting, LLC. He is holding a Master’s
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.
He is repeatedly commended by customers for driving
efficient solutions for complex problems in globally
distributed team environments and meeting tough deadlines.
For further information please visit:
www.blackvard.com
Lukas M. Dietzsch
lukas@blackvard.com
Copyright © Blackvard Management Consulting- All rights reserved www.blackvard.com
Managing Director
Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
An overview of current and previous customers:
Customers That Recommend Blackvard

More Related Content

PPTX
HANA XS Web Service
PDF
What's New in SAP HANA SPS 11 Operations
PPT
Oracle Application Express
PDF
SAP HANA SPS10- SAP HANA Dynamic Tiering
PDF
Oracle APEX Social Login
PPT
Oracle apex hosting
PDF
SAP HANA SPS10- SQLScript
PPT
Oracle Apex Overview
HANA XS Web Service
What's New in SAP HANA SPS 11 Operations
Oracle Application Express
SAP HANA SPS10- SAP HANA Dynamic Tiering
Oracle APEX Social Login
Oracle apex hosting
SAP HANA SPS10- SQLScript
Oracle Apex Overview

What's hot (20)

PPTX
Apex basics-for Beginners
PDF
Oracle Application Express 20.2 New Features
PDF
Abap proxies
PPTX
What's New in SAP HANA SPS 11 DB Control Center (Operations)
PPTX
Creating Single Page Applications with Oracle Apex
PDF
Oracle apex-hands-on-guide lab#1
PPTX
Oracle Apex Installation (EPG)
PPTX
Introduction to apex code
PDF
Hana e2 e_adminmonitoring_sps08
PDF
Oracle APEX勉強会 - 認証と認可の実装を学ぶ
PPTX
OData service from ABAP CDS
PDF
OOW16 - Getting Optimal Performance from Oracle E-Business Suite [CON6711]
PDF
OOW16 - Personalizing Oracle E-Business Suite: The Next Generation [CON6716]
PDF
OOW15 - Standards-Based Desktop Integration in Oracle E-Business Suite
PDF
Affordable Workflow Options for APEX
PDF
OOW15 - Installation, Cloning, and Configuration of Oracle E-Business Suite 12.2
PPTX
HANA SPS07 Studio Development Perspective
PPTX
Oracle APEX Introduction (release 18.1)
PPTX
Monitoring and Maintaining SharePoint 2013 Server
PDF
OOW16 - Testing Oracle E-Business Suite Best Practices [CON6713]
Apex basics-for Beginners
Oracle Application Express 20.2 New Features
Abap proxies
What's New in SAP HANA SPS 11 DB Control Center (Operations)
Creating Single Page Applications with Oracle Apex
Oracle apex-hands-on-guide lab#1
Oracle Apex Installation (EPG)
Introduction to apex code
Hana e2 e_adminmonitoring_sps08
Oracle APEX勉強会 - 認証と認可の実装を学ぶ
OData service from ABAP CDS
OOW16 - Getting Optimal Performance from Oracle E-Business Suite [CON6711]
OOW16 - Personalizing Oracle E-Business Suite: The Next Generation [CON6716]
OOW15 - Standards-Based Desktop Integration in Oracle E-Business Suite
Affordable Workflow Options for APEX
OOW15 - Installation, Cloning, and Configuration of Oracle E-Business Suite 12.2
HANA SPS07 Studio Development Perspective
Oracle APEX Introduction (release 18.1)
Monitoring and Maintaining SharePoint 2013 Server
OOW16 - Testing Oracle E-Business Suite Best Practices [CON6713]
Ad

Viewers also liked (18)

PPTX
Introduction to Design Thinking
PPTX
Structuring An ABAP Report In An Optimal Way
PPTX
Introduction Into SAP Fiori
PPTX
Predictive Analytics 3.1 – Adding a Dataset & Visualization
PPTX
Introduction To Big Data & Hadoop
PPTX
SAP Persistence - Creating Source Code Automatically
PPTX
Debugging and Profiling Cloud Apps? Sure, You Can Do It Now!
PDF
SAP HANA SPS09 - XS Programming Model
PPTX
How to Create "Hello, World!" in Fiori
PPTX
Scrum vs Kanban
PDF
Workshop 16: EmberJS Parte I
PDF
Unlock The Value Of Your Microsoft and SAP Investments
PPTX
Change document display
PDF
Workshop iOS 3: Testing, protocolos y extensiones
PPT
CDS Unit Testing
PDF
Workshop 11: Trendy web designs & prototyping
PDF
Workshop iOS 4: Closures, generics & operators
PDF
Hana sql
Introduction to Design Thinking
Structuring An ABAP Report In An Optimal Way
Introduction Into SAP Fiori
Predictive Analytics 3.1 – Adding a Dataset & Visualization
Introduction To Big Data & Hadoop
SAP Persistence - Creating Source Code Automatically
Debugging and Profiling Cloud Apps? Sure, You Can Do It Now!
SAP HANA SPS09 - XS Programming Model
How to Create "Hello, World!" in Fiori
Scrum vs Kanban
Workshop 16: EmberJS Parte I
Unlock The Value Of Your Microsoft and SAP Investments
Change document display
Workshop iOS 3: Testing, protocolos y extensiones
CDS Unit Testing
Workshop 11: Trendy web designs & prototyping
Workshop iOS 4: Closures, generics & operators
Hana sql
Ad

Similar to Consuming Data With HANA XS (20)

PDF
Autodesk Technical Webinar: SAP NetWeaver Gateway Part 2
PPTX
SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...
PDF
Developer & Fusion Middleware 1 | Mark Drake | An introduction to Oracle XML ...
PDF
SAP ODATA Overview & Guidelines
PPTX
Create rest service in osb 12c over database table
PPTX
SenchaCon 2016 - How to Auto Generate a Back-end in Minutes
PPTX
SenchaCon 2016 - How to Auto Generate a Back-end in Minutes
PDF
ORM Pink Unicorns
PDF
ITB2017 - Slaying the ORM dragons with cborm
PDF
MuleSoft London Community February 2020 - MuleSoft and OData
PDF
Killing Shark-Riding Dinosaurs with ORM
DOC
Sap bo 4.2 course content
DOC
SAP Business Objects 4.2 Training Online
DOC
Online SAP BO 4.2 Training
DOC
SAP BusinessObjects Design Studio 1.7
DOC
BOBJ Training Online
PPTX
Oracle soa online training
PDF
Adding Data into your SOA with WSO2 WSAS
PDF
Training BOBJ SAP Online
PPT
Proper Connections Development for Proper Domino Developers
Autodesk Technical Webinar: SAP NetWeaver Gateway Part 2
SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...
Developer & Fusion Middleware 1 | Mark Drake | An introduction to Oracle XML ...
SAP ODATA Overview & Guidelines
Create rest service in osb 12c over database table
SenchaCon 2016 - How to Auto Generate a Back-end in Minutes
SenchaCon 2016 - How to Auto Generate a Back-end in Minutes
ORM Pink Unicorns
ITB2017 - Slaying the ORM dragons with cborm
MuleSoft London Community February 2020 - MuleSoft and OData
Killing Shark-Riding Dinosaurs with ORM
Sap bo 4.2 course content
SAP Business Objects 4.2 Training Online
Online SAP BO 4.2 Training
SAP BusinessObjects Design Studio 1.7
BOBJ Training Online
Oracle soa online training
Adding Data into your SOA with WSO2 WSAS
Training BOBJ SAP Online
Proper Connections Development for Proper Domino Developers

Recently uploaded (20)

PDF
DP Operators-handbook-extract for the Mautical Institute
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
A Presentation on Touch Screen Technology
PDF
Hybrid model detection and classification of lung cancer
PDF
Mushroom cultivation and it's methods.pdf
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
Zenith AI: Advanced Artificial Intelligence
PPTX
Tartificialntelligence_presentation.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Encapsulation theory and applications.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Web App vs Mobile App What Should You Build First.pdf
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
DP Operators-handbook-extract for the Mautical Institute
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Enhancing emotion recognition model for a student engagement use case through...
gpt5_lecture_notes_comprehensive_20250812015547.pdf
A Presentation on Touch Screen Technology
Hybrid model detection and classification of lung cancer
Mushroom cultivation and it's methods.pdf
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
Zenith AI: Advanced Artificial Intelligence
Tartificialntelligence_presentation.pptx
Approach and Philosophy of On baking technology
Encapsulation theory and applications.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Web App vs Mobile App What Should You Build First.pdf
SOPHOS-XG Firewall Administrator PPT.pptx
Assigned Numbers - 2025 - Bluetooth® Document
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf

Consuming Data With HANA XS

  • 1. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com Internet of Things Using SAP HANA Lesson Four: Consuming Data With HANA XS
  • 2. Course Overview Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com Release Date: March 18, 2016 Release Date: March 31, 2016 Coming Soon… Now Available! Internet of Things Using SAP HANA Lesson Four: Consuming Data With HANA XS Learn More @ http://www.blackvard.com/iot-overview/ Release Date: April 14, 2016 Release Date: May 26, 2016
  • 3. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com Agenda What Will Be Covered: 1. Consuming Data With HANA XS 1. Creating An OData Service 2. INSERT.XSJS Service 3. Granting Authorizations 4. Creating A Sequence 2. About us
  • 4. Creating An OData Service (1/11)  Open Eclipse in Project Explorer view to access the connectivity project you created in lesson three of the Internet of Things Using SAP HANA: HANA XS Web Service. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
  • 5. Creating An OData Service (2/11)  Let’s create a new folder. Select the connectivity project; right-click on it.  Follow menu path New - > Folder to begin creating a new folder. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
  • 6. Creating An OData Service (3/11)  Give the new folder the Folder name: services2, in order to distinguish the folder from user interfaces, server-side logic, etc.  Select the Finish button. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
  • 7. Creating An OData Service (4/11)  Now create an OData Service that will expose the business partner table.  Begin by creating a new File. Select the services2 folder; right-click it.  Follow menu path New - > File. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
  • 8. Creating An OData Service (5/11)  Name the File name: analysis.xsodata; click Finish. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
  • 9. Creating An OData Service (6/11)  Insert the Service Namespace Syntax seen below into the Eclipse text editor.  Supply the namespace for documentation purposes, inside the services itself.  Doesn’t control or generate anything in the system.  Add the OData service content; including the name of the database artifact you wish to expose (tables/views/analytic views, etc.).  For this lesson, in our schema, we have a table called ANALYSIS which we want to expose in this service. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
  • 10. Creating An OData Service (7/11)  After entering the syntax click Save. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
  • 11. Creating An OData Service (8/11)  Now Commit the file syntax. Select the services2 folder, right-click it.  Follow menu path Team - > Commit to commit the syntax to the repository Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.comwww.blackvard.com
  • 12. Creating An OData Service (9/11)  Now Activate it. Select the services2 folder; right-click it.  Follow the menu path Team - > Activate. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
  • 13. Creating An OData Service (10/11)  We’re ready to test the service in our web browser, using the URL below.  https://s12hanaxs.hanatrial.ondemand.com/p1941908884trial/zhanaxs/connectivity/services2/analysis.xsodata/  The screenshot below displays a document, listing a small definition file that shows the name of the exposed entities in very simple XML documentation.  You can expose multiple entities & relationships between entities (e.g. All Columns, etc.). Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
  • 14. Creating An OData Service (11/11)  Add /$metadata to the URL to inspect the service interface & data types.  https://s12hanaxs.hanatrial.ondemand.com/p1941908884trial/zhanaxs/connectivity/services2/analysis.xso data/$metadata  Other programming languages can utilize the service interface and gather all the required information needed to dynamically call and process the service. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
  • 15. Creating INSERT.XSJS Service (1/9)  Let’s create the INSERT.XSJS service; return to the Project Explorer view.  Select the services2 folder again, right-click it.  Follow menu path New - > File. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
  • 16. Creating INSERT.XSJS Service (2/9)  Insert the File name of: insert.xsjs; click Finish. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
  • 17. Creating INSERT.XSJS Service (3/9)  Insert the following XSJS JavaScript coding into the Eclipse text editor.  NOTE: This is quite a bit of coding, so let’s review what each line of the text communicates to the system.  See lines 1 – 12 below, with explanation: Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com Lines 1 - 12: This function getRequestParameters() will parse each URL parameter and store them in an Array. This array list will be returned.
  • 18. Creating INSERT.XSJS Service (4/9)  See lines 13 – 32 below, with explanation: Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com Lines 13 – 32: The function doGet() calls the previously defined method getRequestParameters() to get a list of all URL parameters from the provided URL string. In the next step, we are ensuring that each paramsObject itself is not empty, and then we ensure that each of its attributes: tour, car, alt, and long are NOT empty or not provided. If they do not contain any data (“ .length <= 0”) or were not provided ( == NULL), we abort this script.
  • 19. Creating INSERT.XSJS Service (5/9)  See lines 33 – 46 below, with explanation: Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com Lines 33 – 46: If our given URL string contains all required parameters and values, we create a new output in Line 33 and initialize the data within Line 34. In Line 35, we create a new timestamp. Line 36, we prepare our database connection that executes in Line 37, including mapping to our own SCHEMA. In Line 38, the SQL statement is prepared, which will insert the values in the table ANALYSIS. Notice the sequence id_seq_2. This is our first column value. The four question marks are placeholders for the upcoming values we are providing in Lines 42 to 45.
  • 20. Creating INSERT.XSJS Service (6/9)  See lines 47 – 60 below, with explanation: Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com Lines 47 – 60: In Line 47, we execute the entire command that has been prepared before. A final commit, in Line 48, for our database statement will persist the data in the database. Line 49 creates a new Array and in the Lines 50 – 53, we push each parameter at the end of the Array. Line 54 will print all the previously added parameters for the user (in our sample, this is not required). Finally, in Line 55, we close the entire database connection and show with the statement in Line 57 that everything was successfully inserted in the table.
  • 21. Creating INSERT.XSJS Service (7/9)  See lines 61 – 66 below, with explanation: Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com Lines 61 – 66: This is our main program call. We only allow GET URL parameters (just in case you want to exclude POST). If we receive a GET call, and only then, the main method doGET() is called, and will start the parsing process. Otherwise, we abort and return an error.
  • 22. Creating INSERT.XSJS Service (8/9)  After inserting the XSJS JavaScript coding, click the Save icon to save it. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
  • 23. Creating INSERT.XSJS Service (9/9)  Click the Activate SAP HANA Development Object icon to activate the service. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
  • 24. Granting Authorizations (1/4)  Now Grant an Authorization to the user (INSERT rights to PUBLIC).  Please note: granting public rights could be a security risk within your organization.  Return to the Systems view, select your system; right-click it.  Select Open SQL Console. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
  • 25. Granting Authorizations (2/4)  In the SQL Console, enter the coding seen below.  Please note: granting public rights could be a security risk within your organization. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
  • 26. Granting Authorizations (3/4)  Right-click on the coding, & select Execute to execute the SQL script. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
  • 27. Granting Authorizations (4/4)  A confirmation message that the statement was successfully executed appears. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
  • 28. Creating A Sequence (1/8)  Now Create a Sequence.  In Systems view, select the SAP HANA Administration Console perspective.  If it is not already open, click the Open Perspective icon to open it. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
  • 29. Creating A Sequence (2/8)  Scroll down to SAP HANA Administration Console.  Select SAP HANA Administration Console.  Click OK to open that perspective. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
  • 30. Creating A Sequence (3/8)  Return to the Systems view in Eclipse.  In your project, follow the menu path: Catalog - > <Your SAP HANA Cloud Developer ID> - > Sequences. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
  • 31. Creating A Sequence (4/8)  To create the new sequence, select the Sequences folder, right-click it.  Select the New Sequence option. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
  • 32. Creating A Sequence (5/8)  Enter the Sequence Name as ID_SEQ_2.  Enter the Start with value as 1.  Enter the Increment By value as 1.  Enter the Minimum Value as 1. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
  • 33. Creating A Sequence (6/8)  Click the green Execute icon to execute the new sequence. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
  • 34. Creating A Sequence (7/8)  The below success message will appear, letting you know the sequence has been successfully added.  Also, the ID_SEQ_2 sequence now appears in the Sequences folder. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
  • 35. Creating A Sequence (8/8)  Ensure the sequence values have been added successfully.  Call the following URL in your web browser:  https://s12hanaxs.hanatrial.ondemand.com/p1941908884trial/zhanaxs/connectivity/services2/insert. xsjs?car=2&tour=1&alt=1&long=1  The “Data inserted successfully!” message should appear. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com
  • 36. Success – You Completed The Lesson! 10/10Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com Congratulations, you completed the lesson! In this lesson you successfully learned: – Consuming Data With HANA XS • Creating OData Service • INSERT.XSJS Service • Granting An Authorization • Creating A Sequence
  • 37. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com Want to learn more about connecting your devices? Contact us today for your FREE consultation with our experts. Email: info@blackvard.com Require A Consultation?
  • 38. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com  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 Key Achievements of Blackvard Management Consulting in Previous Projects What We’ve Accomplished
  • 39. Blackvard Management Consultants www.blackvard.comCopyright © Blackvard Management Consulting – All rights reserved Short Bio: Lukas M. Dietzsch is managing director at Blackvard Management Consulting, LLC. He is holding a Master’s 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. He is repeatedly commended by customers for driving efficient solutions for complex problems in globally distributed team environments and meeting tough deadlines. For further information please visit: www.blackvard.com Lukas M. Dietzsch lukas@blackvard.com Copyright © Blackvard Management Consulting- All rights reserved www.blackvard.com Managing Director
  • 40. Copyright © Blackvard Management Consulting – All rights reserved www.blackvard.com An overview of current and previous customers: Customers That Recommend Blackvard

Editor's Notes

  • #2: SAP HANA Predictive Analysis Library (PAL)
  • #3: ----- Besprechungsnotizen (24/05/16 12:58) ----- Please link all the previous sessions "Lesson One" should be linked with the file
  • #4: INSERT.XSJS Service
  • #8: Expose my business partner table. Begin by creating a file.
  • #9: Expose my business partner table. Begin by creating a file.
  • #10: (name schema) (then package name) , table name, then entity name to be exposed as “buyer” is the entity name. “buyer” Save the service.
  • #16: Create INSERT.XSJS service -> see coding
  • #17: Create INSERT.XSJS service -> see coding
  • #18: Create INSERT.XSJS service -> see coding
  • #19: Create INSERT.XSJS service -> see coding
  • #20: Create INSERT.XSJS service -> see coding
  • #21: Create INSERT.XSJS service -> see coding
  • #22: Create INSERT.XSJS service -> see coding
  • #23: Create INSERT.XSJS service -> see coding
  • #24: Create INSERT.XSJS service -> see coding
  • #25: For our sample we grant INSERT rights to PUBLIC
  • #26: P1941908884trial
  • #36: Call the URL and see if the values are coming in
  • #37: Create An OData Service INSERT.XSJS Service Granting Authorizations Creating A Sequence