0% found this document useful (0 votes)
97 views

D-Code Presentation - Building ABAP Applications Using Code Pushdown

The document discusses new features in ABAP Open SQL, including expressions, complex joins, and removing restrictions. It covers new syntax for expressions, host variables, literals, CASE expressions, COALESCE expressions, arithmetic expressions including integral, decimal, and floating point, and string concatenation using && operator. The document also discusses ABAP Core Data Services (CDS) and ABAP Managed Database Procedures (AMDP) for calling HANA SQLScript from ABAP.

Uploaded by

Mohit Pandya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
97 views

D-Code Presentation - Building ABAP Applications Using Code Pushdown

The document discusses new features in ABAP Open SQL, including expressions, complex joins, and removing restrictions. It covers new syntax for expressions, host variables, literals, CASE expressions, COALESCE expressions, arithmetic expressions including integral, decimal, and floating point, and string concatenation using && operator. The document also discusses ABAP Core Data Services (CDS) and ABAP Managed Database Procedures (AMDP) for calling HANA SQLScript from ABAP.

Uploaded by

Mohit Pandya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 71

run( )

DEV263 – Building ABAP


Applications Using Code
Pushdown to the Database

Dr. Andreas Grünhagen, SAP SE


Christiane Kettschau, SAP SE
Dr. Sigrid Wortmann, SAP SE

Public
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.

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 2


Agenda

ABAP New Open SQL


• New Syntax, Expressions Any
• Complex Joins, Removing Restrictions Database
ABAP Core Data Services (CDS)
• General concept to define new Data Dictionary Views
ABAP Managed Database Procedures (AMDP) HANA
• ABAP “Look & Feel” for calling HANA SQLScript Only

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 3


Open SQL
New Syntax
Complex Joins
Expressions

Let’s start with a new Syntax


© 2014 SAP SE or an SAP affiliate company. All rights reserved. 4
What is Open SQL ?

&&
Database
Common Semantics for
Abstraction
SQL
Layer

&&
More than
the subset
of all SQL like syntax
databases
© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 5
What is missing in Open SQL ?

No Expressions

&&
Limited Join types

&& No UNIONS, …

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 6


Open SQL

Expressions
© 2014 SAP SE or an SAP affiliate company. All rights reserved. 7
Host Variables and Literals

DATA: lv_user TYPE c LENGTH 10. • Host Variables and Literals can be
used in the projection list.
SELECT node_key,
@sy-datum, • Host Variables have to be escaped
@lv_user AS username, with an @.
'X' AS value
• Use Case:
FROM snwd_so
INTO @ls_workarea. Set reasonably default values and
ENDSELECT. thus transfer logic from the
application server to the database.

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 8


The New Open SQL Syntax

Escape all Host variables with ‘@‘ Separate list elements


(e.g. ABAP variables) with commas

Be consistent !

Note: All existing Open SQL Select remain valid !

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 9


CASE Expression

SELECT @sy-datum,
so_id, Case-Expression illustrated by an
CASE lifecycle_status example.
WHEN 'N' THEN 'New'
WHEN 'P' THEN
CASE billing_status
WHEN 'P' THEN 'Paid'
ELSE 'Pending'
END
ELSE 'Undefined'
END FROM snwd_so
INTO TABLE @my_table.

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 10


CASE Expression

CASE atomic_expression • You can now use the very powerful


( WHEN atomic_expression CASE expression in OpenSQL in
THEN expression ) * the projection list.
[ ELSE expression ]
END • The ELSE part is optional.

atomic_expression := column, host variable, literal


expression := arbitrary expression (column, host variable,
arithmetic, literal, case, …)

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 11


COALESCE Expression

• COALESCE is a enhanced form of CASE, which can be used, to set reasonable


default values for the right table, when using a LEFT OUTER JOIN.
expr1, if expr1 is not NULL
COALESCE(expr1, expr2) =
expr2, else

SELECT so_id,
COALESCE( partner~company_name, 'N/A' )
FROM snwd_so AS so
LEFT OUTER JOIN snwd_bpa AS partner
ON so~buyer_guid = partner~node_key
INTO TABLE @so1.

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 12


Demo

Expressions
 ABAP Class: ZCL_DEV263_SQL_EXAMPLES
Types of Arithmetic Expressions

Integral Arithmetic

||
Expressions
Decimal

||
Arithmetic
Expressions
Floating Point
Expressions

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 14


Types of Arithmetic Expressions

Integral Arithmetic
Expressions

Works with all Integer and packed numbers without decimals.


+, -, *, DIV, MOD, ABS
Overflow occurs per sub-expression,
e.g. 2147483647 + 1 – 1 will overflow

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 15


Types of Arithmetic Expressions

Decimal Arithmetic
Expressions

Works with all packed numbers with decimals, mixed with Integer
and packed numbers without decimals.
+, -, *, ABS, FLOOR, CEIL

Overflow is not allowed by syntax check:


syntax error if result could overflow at precision 31 or 14 decimals

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 16


Types of Arithmetic Expressions

Floating Point
Expressions

Works only with FLOAT columns / host variables, you can not mix.

+, -, *, /, ABS, CAST

May lead to different results, depending on machine type, operating


system, and database vendor of the database’s host system
Use only for reporting

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 17


String Concatenation

• You can CONCATENATE character columns with the && operator.

SELECT
CASE address_type • Spaces are trimmed away from
WHEN '01' columns and host variables,
THEN postal_code && '->' && ' ' && city except if you use an ABAP
constant which contains exactly
WHEN '02'
one space.
THEN city && ',' && postal_code
END
FROM snwd_ad
INTO TABLE @my_table.

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 18


Open SQL

Complex Joins && Removing Restrictions


© 2014 SAP SE or an SAP affiliate company. All rights reserved. 19
Joins – ON-Condition

SELECT so_id, partner~company_name


FROM snwd_so AS so ON-Condition can contain:
LEFT OUTER JOIN snwd_bpa AS partner
“ complex on condition • Literal values
ON so~buyer_guid = partner~node_key
• Arbitrary Operators:
AND so~lifecycle_status <> 'N'
AND so~billing_status = 'X' < <= > >= <> between
AND partner~bp_role = '01' • Cross-Joins
INTO TABLE @so1.

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 20


Complex Joins using brackets ( … )

SELECT … FROM
( snwd_so AS so1
LEFT OUTER JOIN snwd_bpa AS p1 • Joins can be enclosed in brackets
ON so1~buyer_guid = p1~node_key • Arbitrary nesting of joins
AND so1~lifecycle_status = 'N')
INNER JOIN
( snwd_so AS so2
LEFT OUTER JOIN snwd_bpa AS p2
ON so2~buyer_guid = p2~node_key
AND so2~lifecycle_status = 'X')
ON so1~node_key = so2~node_key
INTO TABLE @so1.

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 21


Further Restrictions

• Many numerical limits have been softened:

• The maximal number of tables in a JOIN has been increased to 50.

= 50

• The maximal number of subqueries has been increased from 9 to 50.

= 50
© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 22
Demo && Exercise 1
Arithmetic Expressions, Joins
 Demo ABAP Class: ZCL_DEV263_SQL_EXAMPLES

 Exercise ABAP Class: ZCL_DEV263_SQL_EXC_XX (XX: your group number)

Methods: exercise_1 and exercise_2


ABAP Core Data
Services
 General Concept
 CDS View Definition

Let’s take a “View” Visit DEV 202 Core Data Services – Next Generation
Data Definition and Access on SAP HANA

© 2014 SAP SE or an SAP affiliate company. All rights reserved. 24


Core Data Services (CDS)

 Next generation of data definition and access for


database-centric applications
 CDS includes
– Data Definition Language (DDL)
CDS

HANA XS

–… (in Later Releases: Data Control Language,


ABAP

Java


ABAP

Data Manipulating Language, … )


 ABAP Integration
– Integrated into existing
ABAP / DDIC Infrastructure, including LM
– Open SQL on CDS Entities

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 25


Introduction

Where we started:

Limited functionality:
• No outer Joins
• No complex Joins
SE11 View • No inline comments
Definition • No unions
• No View on View
• ….
© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 26
CDS Entities / CDS Views

• Views are defined in Ddl Sources


@AbapCatalog.sqlViewName: 'ZCDS_DEV263_V' (new kind of Dictionary object)
/* Demo View */
• CDS View Entity: zcds_dev263_example
// on Sales Order table
define view zcds_dev263_example as SqlView: ZCDS_DEV263_V
select from snwd_so
• CDS View Entity will carry more
{ node_key,
so_id, semantic as SQLViews
created_by as createdby
• SQLView is the representation on
}
Database
• Syntax partly similar to SQL

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 27


Entities - Lifecycle

not saved
Define Ddl Source: save, write to
@AbapCatalog.sqlViewName: R3TR DDLS
'V_DDTEST_SDDL_SO‚ transport order
/* Demo View */
// on Sales Order table
define view saved
e_ddtest_sddl_so
as select from snwd_so
{ node_key,
so_id, … activate and generate
}

active

REPORT ZDEMODDLS.

data e_wa type e_ddtest_sddl_so.

select * from e_ddtest_sddl_so


change into @e_wa
where so_id = '0500009841'.
endselect.
write:/ syst-dbcnt.

export
DB

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 28


CDS Views: Select list

@AbapCatalog.sqlViewName: 'V01'
define view z_view_01 as • Select *: select all columns
select * from swnd_so

@AbapCatalog.sqlViewName: 'V02'
define view z_view_02 as • Comma separated list of names,
select gross_amount, net_amount as net optional alias names with keyword
from snwd_so
AS
@AbapCatalog.sqlViewName: 'V03' • Alternative Syntax, select list after
define view z_view_03 as from clause enclosed in curly braces
select from snwd_so
{ gross_amount, {….}
net_amount as net }

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 29


CDS: Select list

@AbapCatalog.sqlViewName: 'V04'
define view z_view_04 as • Literal Values
select gross_amount as gross,
'Amount Values' as descr, Only C-Sequence Literals
2147483647 as value (Max length 1333 )
from snwd_so and signed integer Literals (4-Byte)

@AbapCatalog.sqlViewName: 'V05'
define view z_view_05 ( gross, descr, value )
as select gross_amount, • List of names as part of the view
'Amount Values', signature
2147483647
from snwd_so

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 30


CDS: View on View

@AbapCatalog.sqlViewName: 'V06'
define view z_view_06 as
• View Entity z_view_06 defined on
select gross_amount, net_amount table SNWD_SO
from snwd_so

@AbapCatalog.sqlViewName: 'V07'
define view z_view_07 as • View Entity z_view_07 defined on
select gross_amount as gross, View Entity z_view_06
net_amount as net
from z_view_06

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 31


CDS: Group By with having

• Group entries according to a


@AbapCatalog.sqlViewName: 'V08'
define view z_view_08 as given set of grouping columns
select billing_status, (like in std. SQL)
delivery_status
max(net_amount) as max_net, • Columns outside of aggregate
avg(net_amount) as avg_net,
from qlast_sddl_so
functions (min, max, count, avg,
group by billing_status, delivery_status sum) must be listed in GROUP
having sum(net_amount) > 100 BY
• Having clause

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 32


CDS: CASE Expression

@AbapCatalog.sqlViewName: 'V09' • ‘Simple’ CASE


define view z_view_09 as
select from qlast_sddl_so • Supported expressions after
{
so_id,  CASE : columns|builtin-
buyer_guid, functions|arithm. expr.
case lifecycle_status
when 'N' then 'New'  WHEN: columns|literals|CASE
when 'P' then 'In process'
when 'C' then 'Closed'  THEN+ELSE: everything but builtin-
else 'Canceled'
end as status_txt functions
}
• Resulting column type derived from
expressions after THEN and ELSE
• ELSE is optional

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 33


CDS: CASE Expression

@AbapCatalog.sqlViewName: 'V10'
define view z_view_10 as • CASE can be nested
select from qlast_sddl_so
{ • Generally, expressions can be
so_id,
buyer_guid,
nested
case lifecycle_status
• But only certain types of
when 'N' then 'New'
when 'P' then expressions
case billing_status allowed in certain positions
when 'P' then 'Payed'
else 'Open'
end
when 'C' then 'Closed'
else 'Canceled'
end as status_txt
}

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 34


CDS: Built-in functions

@AbapCatalog.sqlViewName: 'VA01'
define view z_viewa_01 as String functions:
select from qlast_sddl_bpa
{ • LPAD(arg1, targetlen, arg2)
lpad( bp_id, 13,'0' )
as bp_role_id, • SUBSTRING(arg, startpos,
email_address
} targetlen)

@AbapCatalog.sqlViewName: 'VA01'
define view z_viewa_01 as Arithmetic functions:
select from qlast_sddl_so
{ • CEIL(arg)
so_id as id,
ceil( gross_amount ) • MOD(arg1, arg2)
as gross_amount_rounded_up
}

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 35


CDS: CAST expression

• Supported operands:
@AbapCatalog.sqlViewName: 'V10'
define view z_view_10 as Literal, column, path expression,
select from snwd_so build-in function, arithmetic
{ expression
currency_code,
gross_amount as original_amount, • Supported types in abap
cast( gross_amount as abap.fltp) +
(cast( -gross_amount as abap.fltp) * 0.03) namespace:
as reduced_amount,
cast( gross_amount as abap.fltp) * 0.03 char( len ), clnt, cuky( len ), curr(
as savings len, decimals ), dats, dec( len,
} decimals ), fltp, int1, int2, int4,
lang, numc( len ), quan( len,
decimals ), tims, unit( len )
• No nesting of CAST expressions
© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 36
CDS: Arithmetic expressions

@AbapCatalog.sqlViewName: 'V11'
define view z_viewa_11 as • Supported operators: +, - , * and unary -
select from qlast_sddl_so
{ • Complex expressions and
so_id, bracketing of sub expressions possible
buyer_guid,
net_amount + tax_amount
as gross_amount,
cast(net_amount as abap.fltp) * 0.8
as discount,
-tax_amount
as negative_tax
}

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 37


CDS: Joins

Supported Join Types:


@AbapCatalog.sqlViewName: 'V12'
define view z_view_12 as • Inner Join
select so.node_key,
• Left Outer Join
partner.company_name,
ad.country • Right Outer Join
from qlast_sddl_so as so
inner join qlast_sddl_bpa as partner
on so.buyer_guid = partner.node_key
left outer join qlast_sddl_address as ad
• Complex Join operations using ( … ) are
on partner.address_guid = ad.node_key supported
where so.lifecycle_status = 'N' • Arbitrary On-Conditions (incl. >, >=, <, <=,
like between, and, or, not)

Restrictions: no select * together with joins


© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 38
Demo && Exercise 2
CDS Views
 Demo CDS Views: ZCDS_DEV263_DEMO[1-3]

 Exercise CDS View: ZCDS_DEV263_EXC_1_XX (XX: your group number)

ABAP Report: ZR_DEV263_CDS_EXC_XX


ABAP
Managed
Database AMDP
Procedures
HANA
Challenge

Leverage native capabilities of SAP HANA from ABAP

 Call build-in SQLScript procedures from your ABAP code

 Write your own SQLScript procedures and access them from ABAP

 Take advantage of the comfort offert by the ABAP Language, its IDE
and lifecycle management

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 41


Haven‘t I seen it all before?

Can’t I use EXEC SQL or ADBC?

sql->execute_ddl(
`CREATE PROCEDURE myproc (IN p_val1 char(10)) AS BEGIN `
&& `SELECT val2 FROM mytab WHERE val1 = :p_val1 ; END ` ).
sql->execute_procedure( proc_name = 'myproc' ).

Yes, but after the first 100 lines of plain SQLScript source code you might
want something else …

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 42


You want …

 Syntax check with meaningful error messages and warnings

 Decent support by ABAP development environment, i.e. syntax


highlighting, references, navigation, code completion

 Natural integration into ABAP runtime

 ABAP transportation and lifecycle management

 Trouble shooting tools and support for runtime analysis

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 43


That’s why we invented AMDP

The basic idea is simple:

 use ABAP classes as containers for SQLScript

 and let HANA SQLScript source code benefit from the existing
ABAP development tools and lifecycle management

To learn more about the SQLScript language visit:


 CJ627 Getting Started with SQLScript in SAP HANA
 DEV161 SQLScript – Push Code Down into SAP HANA to Achieve Maximum Performance
 and many more …

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 44


How to write AMDPs - Implementation
Method body is
class cl_amdp_demo implementation. implemented as HANA
SQLScript procedure
method my_first_dbproc by database procedure
for hdb language sqlscript SQLScript option “read-only”
options read-only
Declare referenced AMDP methods
using my_db_table. and ABAP Data Dictionary tables
-- your sqlscript code starts here
--
-- use the database table from the using clause
select * from my_db_table where contains(stringcol,'find me',fuzzy(0,1));
-- go on with more sqlscript code
--
endmethod.
endclass.

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 45


How to write AMDPs - Definition

class cl_amdp_demo definition.


public section.
Marker interface required

interfaces if_amdp_marker_hdb.
All parameters are passed as value
methods my_first_dbproc
importing value(im_param1) type type1 default 1234
exporting value(ex_param2) type type2
changing value(ch_param3) type type3.
Default values for importing parameters

endclass.

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 46


Call AMDP methods from ABAP

class cl_amdp_demo implementation.


method call_my_first_dbproc.
data: lt_param2 type type2, lt_param3 type type3
my_first_dbproc( importing ex_param2 = lt_param2
changing ch_param3 = lt_param3 ).
endmethod.
endclass. In ABAP AMDP methods are called like any other ABAP method

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 47


Call AMDP methods from other AMDP methods

class cl_amdp_demo implementation.


method my_second_dbproc by database procedure for hdb language sqlscript
options read-only using cl_amdp_demo=>my_first_dbproc.
-- Call another AMDP using the SQLScript syntax.
--
call "CL_AMDP_DEMO=>MY_FIRST_DBPROC"( im_param1 => :im_param,
ex_param2 => :ex_param,
ch_param3 => :ch_param ).
endmethod.
endclass.
The full name has to specified in capital
Parameter binding as in SQLScript
letters with => and quotes

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 48


Demo

 Definition & implementation of a simple AMDP class


 Error handling: syntax error / warning, long text
 ZCL_DEV263_AMDP_EXAMPLES[_FINAL]
System Demo: Method Implementation

ABAP syntax error

ADT recognizes this method as AMDP method and highlights the background (if configured).

Hovering over the red icon or looking at “Problems” gives more details.

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 50


System Demo: Method Definition

Declaring the interface removes the syntax error.

The signature is not correct:


Only value parameters are
supported. More information
can be found in the ABAP
Problem Help.

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 51


System Demo: USING Clause

Database tables and AMDP methods have to be declared in the “using” clause and
objects declared in the “using” clause have to be referenced in the SQLScript body.

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 52


System Demo: calling AMDPs inside AMDPs

Take care of the


correct syntax and
capitalization.

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 53


AMDP Syntax: Summary

 Marker interface IF_AMDP_MARKER_HDB tags classes with AMDPs

 Parameters are passed by value (comparable to RFC)

 Scalars and internal tables are allowed as parameters

 Importing parameters may have default values

 Referenced objects from the Data Dictionary & AMDP methods must
be listed in the USING clause

 AMDP classes can also contain ABAP methods

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 54


Lifecycle management

 ABAP methods: part of the ABAP load once they are generated

 AMDP methods: reside in SAP<SID> scheme of the database, the


home of ABAP data

 AMDP makes sure that a database procedure is available at runtime


• AMDP creates database procedures at latest at first use
• AMDP recreates database procedures, if the source code or dependent objects
change
• AMDP deletes obsolete database procedures asynchronously

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 55


No programmer is perfect: runtime errors

Like any method call, AMDP method calls may fail. Typical errors are:
• Invalid parameters at runtime
• Syntax errors in SQLScript after changes in used objects
• Errors during (re-)creation of database procedures

AMDP provides detailed dump information (ST22)


• Special section “Database procedure (AMDP) information”
• SQLScript call stack and error message evaluation

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 56


Demo && Exercise

 Execution of an AMDP method


 Error handling: special info section in ST22
 Exercise 4
System Demo: Call an AMDP with illegal value

Execute (F8)
DBPROC_3 Try a negative value and execute (F8)

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 58


System Demo: Runtime error display

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 59


System Demo: Section in ST22 for AMDP

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 60


Key Takeaways (new with 7.40 SP05)

ABAP Open SQL ABAP Managed Database


 New Open SQL Syntax Procedures
 Literal Values  Source code integration into ADT editor
 Complex Expressions  ABAP-like syntax check
ABAP Core Data Services  ABAP-like runtime behavior and RABAX
handling
 New Data Modelling Paradigm
 Integration into ABAP lifecycle and source
 Source Based View Definition code management

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 61


Outlook

ABAP Open SQL ABAP Managed Database


• Searched Case Procedures (7.40 SP08)
• Inline Data Declaration • Exception handling

• Unions • Improved debugging support

• Connection handling (same database)


ABAP Core Data Services
• BAdI support for database procedures
• View Parameters

• More Built-in Functions

• Data Control Language

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 62


Questions & Answers
SAP d-code Virtual Hands-on Workshops and SAP d-code Online
Continue your SAP d-code education after the event!

SAP d-code Virtual Hands-on Workshops SAP d-code Online


 Access hands-on workshops post-event  Access replays of keynotes, Demo Jam, SAP d-code
 Starting January 2015 live interviews, select lecture sessions, and more!
 Complementary with your SAP d-code registration  Hands-on replays
http://sapdcodehandson.sap.com http://sapdcode.com/online

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 64


Further Information

SAP Public Web


scn.sap.com/community/developer-center/
scn.sap.com/community/abap-for-hana

SAP Education and Certification Opportunities


www.sap.com/education
open.sap.com

Watch SAP d-code Online


www.sapcode.com/online

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 65


Feedback
Please complete your session evaluation for
DEV263

Thanks for attending this SAP TechEd && d-code session.


©©2014
2014SAP
SAPSE
SEororananSAP
SAPaffiliate
affiliatecompany.
company.AllAllrights
rightsreserved.
reserved. Public 6666
Appendix
Open SQL & CDS
• EPM Data Model

AMDP
• Technical requirements
• Syntax check

© 2014 SAP SE or an SAP affiliate company. All rights reserved. 67


Enterprise Procurement Model (EPM) Find more information and guides on SCN:
http://scn.sap.com/docs/DOC-31458
Sales Orders and Products

Products
Address

Sales Order
Business
Items
Sales Order Partner /
Header Customer

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 68


Technical requirements

 AMDP compiler, runtime and development environment use


functionality provided by the database, e.g. AMDP does not parse
SQLScript  The installation of ABAP has to be set up with the
correct privileges (this is checked in TA SICK).

 AMDP generates artefacts in SAP<SID> schema of the database.

 Objects outside SAP<SID> are not under the control of AMDP and
therefore not part of the USING clause. They can be referenced, but
need to be available at runtime.

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 69


Syntax check
AMDPs for HANA can be written on any database. Some syntax checks
run on any database, some only on systems running on HANA.

 Any database: ABAP signature check, parameter types, marker


interface, …

 Any database: certain limitations for HANA SQLScript which can be


detected in the ABAP part, e.g. type mapping checks

 HANA only: native SQLScript errors

Only the last category needs the HANA in the development system!

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 70


© 2014 SAP SE 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 SE or an
SAP affiliate company.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE
(or an SAP affiliate company) in Germany and other countries. Please see http://global12.sap.com/corporate-en/legal/copyright/index.epx for additional trademark
information and notices.
Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors.
National product specifications may vary.
These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP SE or its
affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP SE or
SAP affiliate company 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.
In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related presentation, or to develop or
release any functionality mentioned therein. This document, or any related presentation, and SAP SE’s or its affiliated companies’ strategy and possible future
developments, products, and/or platform directions and functionality are all subject to change and may be changed by SAP SE or its affiliated companies at any time for
any reason without notice. The information in this document is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. All forward-
looking statements are subject to various risks and uncertainties that could cause actual results to differ materially from expectations. Readers are cautioned not to place
undue reliance on these forward-looking statements, which speak only as of their dates, and they should not be relied upon in making purchasing decisions.

© 2014 SAP SE or an SAP affiliate company. All rights reserved. Public 71

You might also like