CD263
ABAP on SAP HANA Building an End-to-End App
from HANA via ABAP to SAPUI5
Jens Weiler / PI HANA Platform
October 2013
Disclaimer
This presentation outlines our general product direction and should not be relied on in making a
purchase decision. This presentation is not subject to your license agreement or any other agreement
with SAP. SAP has no obligation to pursue any course of business outlined in this presentation or to
develop or release any functionality mentioned in this presentation. This presentation and SAP's
strategy and possible future developments are subject to change and may be changed by SAP at any
time for any reason without notice. This document is provided without a warranty of any kind, either
express or implied, including but not limited to, the implied warranties of merchantability, fitness for a
particular purpose, or non-infringement. SAP assumes no responsibility for errors or omissions in this
document, except if such damages were caused by SAP intentionally or grossly negligent.
2013 SAP AG or an SAP affiliate company. All rights reserved.
Outline
Introduction
ABAP Development Tools (ADT) and ABAP List Viewer (ALV)
ABAP Development Tools
ALV with Integrated Data Access (IDA)
ABAP on HANA
External Views
Database Procedure Proxies
HANA Transport Container
OData and SAPUI5
SAP NetWeaver Gateway as OData provider
SAPUI5 Application
2013 SAP AG or an SAP affiliate company. All rights reserved.
Introduction
SAP NetWeaver 7.4
Big Picture
Find more detailed overview on SCN:
http://scn.sap.com/docs/DOC-35002
Custom Applications
Some key facts about SAP NetWeaver 7.4
New go-to release with General Availability on May 10th, 2013
Next Enhancement Package after SAP NetWeaver 7.03/7.31
Supports SAP HANA and other classical databases
AS ABAP 7.4 is the foundation for SAP Business Suite and SAP BW
powered by SAP HANA
The most important cross application scenarios include
Seamless E2E development experience based on Eclipse
Easy deployment to Virtual Private Clouds with SAP Cloud Appliance
Library (CAL)
Mobile Apps with SAP HANA Cloud Platform using SAPUI5 and Gateway
SAP
Business
Suite
SAP
NetWeaver
BW
...
ABAP Development Tools for SAP NetWeaver
SAP NetWeaver AS ABAP 7.4
SAP HANA Database
Any DB
SAPUI5
ABAP
Gateway
Cloud
Java
HANA
2013 SAP AG or an SAP affiliate company. All rights reserved.
SAP NetWeaver AS ABAP 7.4 at a Glance
VISIT CD201 Application Development
based on ABAP and SAP HANA
Innovations and Enhancements
OnPremise/Cloud,
Low TCO/TCD across ABAP
systems
Gateway/SAPUI5
in AS ABAP
User experience & productivity
Web and mobile scenarios
Simplification, low TCO,
integrated ABAP and SAP HANA
Classical Database
ABAP Language
Improvements
2013 SAP AG or an SAP affiliate company. All rights reserved.
ABAP optimized
for SAP HANA
Business
Rules
Embedded
Analytics
Security
ABAP
on HANA
Lifecycle
Management
SAPUI5, FPM/WDA, NWBC etc.
Gateway
Connectivity
& Integration
Integrated
Development
Development Tools
in Eclipse
SAP NetWeaver AS ABAP 7.4
Latest security
standards
SAP HANA
Decision Service Management
with BRFplus
6
ABAP Application Development Optimized for SAP HANA
Accelerate, extend, innovate, and fully exploit the power of SAP HANA in ABAP
Performance analysis tools to detect optimization
potential
Eclipse based development environment for ABAP and
SAP HANA
Accelerate
Integration of SAP HANA views and procedures in ABAP
Transport and delivery of SAP HANA content in ABAP
Extend
UI components optimized for SAP HANA (ALV, faulttolerant value helps)
Reference scenario (Open Item Analysis) for ABAP on
SAP HANA
Innovate
Low risk and predictable
code optimization for HANA
Exploit HANA in the wellknown ABAP environment
2013 SAP AG or an SAP affiliate company. All rights reserved.
Enhanced user
experiences
Proven SAP NetWeaver development
infrastructure and lifecycle management
7
Highlights of SAP NetWeaver AS ABAP 7.4
VISIT CD262 & CD263 to get
hands on ABAP for HANA
ABAP based applications using SAP HANA
Guidelines and Best practices
Improved
tools for
performance
analysis
Re-Use
components
optimized for
SAP HANA
Using
SAP HANA
artifacts in
ABAP
Transparent Optimizations
SAP NetWeaver Application Server ABAP 7.4
2013 SAP AG or an SAP affiliate company. All rights reserved.
ABAP 7.4 Reference Scenario
2013 SAP AG or an SAP affiliate company. All rights reserved.
Find more information and guides on SCN:
http://scn.sap.com/docs/DOC-35518
Enterprise Procurement Model (EPM)
Sales Order and Invoice
Invoice Header
Find more information and guides on SCN:
http://scn.sap.com/docs/DOC-31458
Sales Order Header
Business Partner /
Customer
Invoice Item
Sales Order Item
Product
2013 SAP AG or an SAP affiliate company. All rights reserved.
10
End-to-End Application: From HANA via ABAP to SAPUI5
What we will do today
1. ABAP
Development Tools
2. ABAP List
Viewer
2013 SAP AG or an SAP affiliate company. All rights reserved.
3. HANA Artifact Exposure
and Consumption
4. OData Service
5. SAPUI5
Application
11
ABAP Development Tools
Learn to work with ABAP Development Tools
1. ABAP
Development Tools
2. ABAP List
Viewer
3. HANA Artifact Exposure
and Consumption
4. OData Service
5. SAPUI5
Application
Application Model Changing Trends
Today: Business Apps are mainly built in
ABAP
ABAP runs the complete application logic
Database for data storage
User Interface is rendered in SAP GUI / Browser
Parts of the application will run on MOBILE
Parts of the application will run in HANA
Parts of the application will run in the CLOUD
SAP NetWeaver in 2013
SAP NetWeaver
Application
Server ABAP
CLOUD
Trends will change the application model:
MOBILE
HANA
2013 SAP AG or an SAP affiliate company. All rights reserved.
13
SAPs Eclipse Strategy
VISIT CD260 ABAP in
Eclipse - Develop Like
Never Before
Integration Platform for all kind of development tools
Eclipse is SAPs strategic platform for highly
integrated design-time and development tools.
SAP HANA Studio
Design-Time for
Analytical Models
UI Development Tools
for HTML5
2013 SAP AG or an SAP affiliate company. All rights reserved.
NW Cloud
Development
Tools
NW Gateway
Tools
ABAP
Development
Tools (ADT)
14
Demo
Speed up your ABAP development using shortcuts
Edit
Navigate
Ctrl+Shift+A
Open development object
F3
Open definition
Ctrl+F2
Check development object
Alt+Left
Backward history
Ctrl+F3
Activate development object
Alt+Right
Forward history
Ctrl+Shift+F3
Activate all inactive objects
Ctrl+T
Quick hierarchy
Ctrl+Space
Code completion
F4
Open Type Hierarchy
Ctrl+1
Quick fix proposal
Ctrl+O
Quick outline
Alt+F2
Show method information
Ctrl+Shift+G
Where-used list
Ctrl+7
Toggle comment
Run, Debug
Shift+F1
Format source aka pretty printer
F8
Run current ABAP object
Alt+F8
Select & run ABAP application
Help
F1
ABAP keyword documentation
Ctrl+Shift+B
Toggle breakpoint
F2
Show code element information
F5, F6, F7, F8
Step into, over, return, resume
Ctrl+3
Search for commands & views
Ctrl+Shift+F10
Execute ABAP unit tests
Ctrl+Shift+L
List all keyboard shortcuts
Alt+F9
Profile development object
Join us on SCN: http://scn.sap.com/community/abap/eclipse
2013 SAP AG or an SAP affiliate company. All rights reserved.
16
ABAP List Viewer with Integrated Data Access
Experience the brand new ALV with Integrated Data Access (ALV with IDA)
1. ABAP
Development Tools
2. ABAP List
Viewer
3. HANA Artifact Exposure
and Consumption
4. OData Service
5. SAPUI5
Application
Classical ALV Building Blocks
" SELECTION SCREEN
SELECT-OPTIONS bp_id
FOR ls_alv-bp_id.
SELECT-OPTIONS company FOR ls_alv-company_name.
" SELECT [ALL ROWS ALL COLUMNS]
" FROM DATABASE INTO [ITAB] ON THE ABAP SERVER
DATA: lt_alv TYPE TABLE OF ztch_dv_salv_ida.
SELECT * FROM ztch_dv_salv_ida
INTO CORRESPONDING FIELDS OF TABLE lt_alv
WHERE bp_id
IN bp_id
AND company_name IN company.
" SHOW SELECTED DATA OF [ITAB] IN ALV ( FULLSCREEN MODE )
cl_salv_table=>factory( IMPORTING r_salv_table = DATA(lo_alv)
CHANGING t_table
= lt_alv
).
lo_alv->display( ).
2013 SAP AG or an SAP affiliate company. All rights reserved.
18
ALV with IDA Building Blocks
" SELECTION SCREEN
SELECT-OPTIONS bp_id
FOR ls_alv-bp_id.
SELECT-OPTIONS company FOR ls_alv-company_name.
" CREATE INSTANCE OF IDA ALV
DATA(lo_alv_display) = cl_salv_gui_table_ida=>create(
iv_table_name = 'ZTCH_DV_SALV_IDA' ).
" SET SELECTION CRITERIA
DATA(lo_collector) = NEW cl_salv_range_tab_collector( ).
lo_collector->add_ranges_for_name(
iv_name = 'BP_ID'
it_ranges = bp_id[] ).
lo_collector->add_ranges_for_name(
iv_name = 'COMPANY' it_ranges = company[] ).
lo_collector->get_collected_ranges(
IMPORTING et_named_ranges = DATA(lt_name_range_pairs) ).
lo_alv_display->set_select_options(
it_ranges = lt_name_range_pairs ).
" SHOW DATA OF [DATABASE VIEW] IN IDA ALV ( FULLSCREEN MODE )
lo_alv_display->fullscreen( )->display( ).
2013 SAP AG or an SAP affiliate company. All rights reserved.
19
Exercise
Exercise B: ABAP List Viewer with Integrated Data Access (40 Minutes)
Where can you find more information?
ALV on HANA Feature-Set NW 7.40 SP2 & Demo Reports
More information:
SAP Help Portal
ABAP List Viewer with Integrated Data Access (IDA)
Demo Reports
ABAP Package SALV_IDA_TEST
2013 SAP AG or an SAP affiliate company. All rights reserved.
21
ABAP on HANA
Leverage the power of HANA from ABAP Applications
1. ABAP
Development Tools
2. ABAP List
Viewer
3. HANA Artifact Exposure
and Consumption
4. OData Service
5. SAPUI5
Application
ABAP on HANA
VISIT RDP302 & CD262 to
get information about HANA
database performance
Ingredients for great performance
Code
Pushdown
SAP
NetWeaver
AS 7.4
SAP HANA
Database
Real Time Applications
2013 SAP AG or an SAP affiliate company. All rights reserved.
23
ABAP on HANA
VISIT CD161 & RDP160 to
get more information about
HANA development
Code Pushdown
Calculation
AS ABAP
Data to Code
Code to Data
SAP HANA
Database
Calculation
Code Pushdown means to move data intense calculations to the
database layer and only move the results to the application layer
2013 SAP AG or an SAP affiliate company. All rights reserved.
24
ABAP on HANA
Code Pushdown with Native SQL
ABAP
Application
Server
ABAP Program
EXEC SQL / ADBC
HANA
Database
HANA Catalog
HANA Repository
Database View
Database Procedure
2013 SAP AG or an SAP affiliate company. All rights reserved.
View
Procedure
DB
DB
table
DBtable
Table
25
ABAP on HANA
Code Pushdown with External Views / Database Procedure Proxies
ABAP
Application
Server
Database Procedure
Proxy
CALL DATABASE PROCEDURE
External
View
EXEC SQL / ADBC
Data Dictionary
HANA
Database
HANA Catalog
HANA Repository
Database View
Database Procedure
2013 SAP AG or an SAP affiliate company. All rights reserved.
ABAP Program
OPEN SQL
View
Procedure
DB
DB
table
DBtable
Table
26
ABAP on HANA
External Views
ABAP on HANA
External Views
External View is a proxy object in the ABAP Data Dictionary
Access via OPEN SQL:
SELECT * FROM external_view_name
INTO CORRESPONDING FIELDS OF TABLE lt_var .
Familiar developer experience (SE16, Where-Used, Navigation, ALV IDA )
Support for automatic client handling
The semantic of the database types can be enriched by mapping them to DDIC types,
e.g. NVARCHAR => CHAR/NUMC/DATC/
2013 SAP AG or an SAP affiliate company. All rights reserved.
28
ABAP on HANA Exercise
External Views Average number of days open for customer invoices
ABAP
Application
Server
ABAP Program
C1.1
ZCA_##_OPEN_INV
External View
OPEN SQL
ZCA_##_OPEN_INV
C1.2
Data Dictionary
HANA
Database
HANA Repository
Calculation View
CA_OPEN_INVOICES
Analytical View
Analytical View
AN_OPEN_INVOICE_AMOUNT
AN_OPEN_INVOICE_DAYS
2013 SAP AG or an SAP affiliate company. All rights reserved.
HANA Catalog
C2
View
DB
DB
table
DBtable
Table
29
Exercise
Exercises C1 & C2: External Views (30 Minutes)
ABAP on HANA
Database Procedure Proxies
ABAP on HANA
Database Procedure Proxies
Database Procedure Proxy is a proxy object in the ABAP Data Dictionary
Similar to calling methods / function modules:
CALL DATABASE PROCEDURE procedure_name
EXPORTING
iv_param
= lv_param
IMPORTING
et_param_1 = lt_param_1
et_param_2 = lt_param_2 .
An ABAP interface is generated to hold parameter type definitions
can be used to type the actual parameters of the proxy call
2013 SAP AG or an SAP affiliate company. All rights reserved.
32
ABAP on HANA Exercise
Database Procedure Proxies All invoices paid on a given date
ABAP
Application
Server
ABAP Program
C3.1
ZDP_CD263_##_PAID_INVOICES
Database Procedure Proxy
ZDP_CD263_##_PAID_INVOICES
CALL DATABASE PROCEDURE
C3.2
Data Dictionary
HANA
Database
HANA Catalog
HANA Repository
Database Procedure
DP_PAID_INVOICES_ON_DATE
2013 SAP AG or an SAP affiliate company. All rights reserved.
Procedure
DB
DB
table
DBtable
Table
33
Exercise
Exercise C3: Database Procedure Proxies (15 Minutes)
ABAP on HANA
External Views and Database Procedure Proxies Summary
Requires at least SAP NetWeaver 7.4 SP2 and the ABAP Development Tools (ADT) 2.7
HANA views and database procedures can be imported into the ABAP Dictionary as External Views and
Database Procedure Proxies respectively
HANA views and database procedures must exist in the HANA repository to be imported into DDIC using ADT
No ADT support for "HANA catalog-only" artifacts
External Views and Database Procedure Proxies can be called using OPEN SQL and the new ABAP
statement CALL DATABASE PROCEDURE respectively
External Views and Database Procedure Proxies can be synchronized with one click!
Not all HANA types are supported, e.g. HANA's date type cannot be mapped to ABAP type DATS
HANA views with input parameters are not supported
2013 SAP AG or an SAP affiliate company. All rights reserved.
35
ABAP on HANA
HANA Transport Container (HTC)
ABAP on HANA
HANA Transport Container (1)
VISIT ITM261 to learn more
about HANA transportation
management with or without ABAP
HANA repository content can be packaged within HANA Delivery Units
A Delivery Unit can be enclosed in a HANA Transport Container (HTC)
The HTC is owned and managed by the ABAP Application Server
The HTC can be transported via the standard ABAP Change and Transport System (CTS)
2013 SAP AG or an SAP affiliate company. All rights reserved.
37
ABAP on HANA
HANA Transport Container (2)
Source ABAP System
Target ABAP System
ABAP Transport Request
ABAP Transport Request
ABAP Program
ABAP Program
Database Procedure Proxy
Database Procedure Proxy
External View
External View
HANA Transport Container
HANA Transport Container
2
Delivery Unit
Delivery Unit
Database Procedure
Database Procedure
Database View
Database View
Source HANA Database
2013 SAP AG or an SAP affiliate company. All rights reserved.
Target HANA Database
38
Demo
HANA Transport Container (HTC)
ABAP on HANA
HANA Transport Container Summary
Delivery Units can only be transported completely there is no delta transport
Snapshot saved in ABAP transport is not updated automatically each time the HANA content
changes take a snapshot immediately before releasing the ABAP transport!
System setting (in target system) controls whether imported HANA content is activated
automatically
SNOTE support for HANA Transport Container (SP2, automatic activation in SP4)
2013 SAP AG or an SAP affiliate company. All rights reserved.
40
OData & SAPUI5
SAP NetWeaver Gateway as OData Provider
SAPUI5 Application
1. ABAP
Development Tools
2. ABAP List
Viewer
3. HANA Artifact Exposure
and Consumption
4. OData Service
5. SAPUI5
Application
OData Service & SAPUI5 Application
Key Players
Key Players
(External) DDIC View
Data Basis
SAP NetWeaver Gateway
OData Service Provider
Gateway Eclipse Plugin
Creation of the SAPUI5 Starter Application
SAPUI5 ABAP Repository
Team Provider
Import of the UI5 application into the
SAPUI5 ABAP repository (based on BSP
repository)
Browser
Test/Run OData Services & SAPUI5
Applications
2013 SAP AG or an SAP affiliate company. All rights reserved.
42
OData Service & SAPUI5 Application
Architecture & Development Overview
Application Architecture
CLIENT
UI5 runtime
and libraries
Browser
Controller
Models
Views
HTTP
Request/Response
Gateway OData Service
External View
SERVER
AS ABAP
DB access,
e.g. OpenSQL
SAP HANA
SAPUI5 Application Development
DB View
2013 SAP AG or an SAP affiliate company. All rights reserved.
Local
development
of SAPUI5
Application
Eclipse
Develop a SAPUI5
Starter application
SAPUI5 ABAP
Repository
AS ABAP
Import the SAPUI5 application
into the ABAP Application Server
Data
43
OData Service & SAPUI5 Application
Exercise
Exercise D1: Create and test an OData service
Exercise D2: Build and test a SAPUI5 application
2013 SAP AG or an SAP affiliate company. All rights reserved.
44
Exercise
Exercise D: OData Service & SAPUI5 Application (40 Minutes)
OData Service & SAPUI5 Application
Useful Links
Development Tools
Visit lectures on these topics:
https://tools.hana.ondemand.com/
SAP NetWeaver Gateway:
CD201 - Application Development based on
ABAP and SAP HANA
http://help.sap.com/saphelp_gateway20/helpdata/en/2f/d48687c1e14e87915
d41e595a4285d/content.htm
https://help.hana.ondemand.com/gateway_gwpa/frameset.htm?5ad0d36c78a
e4d49b7f7e8d72dbfa046.html
CD202 - Development of High Performance
Applications Using SAP HANA, ABAP, and
SAPUI5
SAPUI5:
CD204 - Develop an End-to-End Scenario with
ABAP on SAP HANA, SAP NetWeaver Gateway,
and SAPUI5
https://sapui5.netweaver.ondemand.com/sdk
https://sapui5.netweaver.ondemand.com/devguide.html
CD107 - SAP NetWeaver Gateway - On-Premise
and in the Cloud
SAPUI5 ABAP Repository Team Provider:
https://sapui5.hana.ondemand.com/sdk/#docs/guide/UI5BSPRepository.html
2013 SAP AG or an SAP affiliate company. All rights reserved.
46
End-to-End Application: From HANA via ABAP to SAPUI5
What we have done today
1. ABAP
Development Tools
2. ABAP List
Viewer
2013 SAP AG or an SAP affiliate company. All rights reserved.
3. HANA Artifact Exposure
and Consumption
4. OData Service
5. SAPUI5
Application
47
Questions? Answers!
Further Information
SAP Public Web
ABAP for HANA Reference Scenario
ABAP for HANA SCN Space
www.sap.com
SAP Education and Certification Opportunities
www.sap.com/education
Watch SAP TechEd Online
www.sapteched.com/online
Further Questions want to know more about ABAP for HANA
[email protected] 2013 SAP AG or an SAP affiliate company. All rights reserved.
49
SAP TechEd Virtual Hands-on Workshops and SAP TechEd Online
Continue your SAP TechEd education after the event!
SAP TechEd Virtual Hands-on Workshops
SAP TechEd Online
Access hands-on workshops post-event
Available January March 2014
Complementary with your SAP TechEd registration
Access replays of keynotes, Demo Jam, SAP TechEd
LIVE interviews, select lecture sessions, and more!
View content only available online
http://saptechedhandson.sap.com/
2013 SAP AG or an SAP affiliate company. All rights reserved.
http://sapteched.com/online
50
Feedback
Please complete your session evaluation for CD263.
THANKS for joining us!
Thanks for attending this SAP TechEd session.
2013 SAP AG or an SAP affiliate company. All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG.
The information contained herein may be changed without prior notice.
Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.
National product specifications may vary.
These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and
SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth
in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and
other countries.
Please see http://www.sap.com/corporate-en/legal/copyright/index.epx#trademark for additional trademark information and notices.
2013 SAP AG or an SAP affiliate company. All rights reserved.
52