You are on page 1of 24

openS

SAP
ABAP
P Deve
elopment for SAP HANA
A
WEEK 2, UNIT 1
00:00:13

Hello and welcome ba


ack to week 2
2, unit 1, Exis
sting Code: Is
I It Still Validd?

00:00:20

u did well witth the weeklyy assignments.


I hope you

00:00:23

Hi there. Before
B
we sta
art with unit 1, let me outtline the seco
ond week of this openSA
AP course:
ABAP Cod
ding: Where to Optimize?
?

00:00:33

We will sta
art with introducing you tto tools to find and spot potential
p
funcctional issues
s in your
existing ABAP
A
coding,,

00:00:43

static code
e checksw
we'll continue
e with that in the second unit
u when it i s going to be
e about
optimizatio
on potential

00:00:50

and we wiill show you how you can


n see the full SQL profile of your runnning applications of your
Applicatio
on Server ABAP.

00:01:00

Finally, we
e will show you
y some reu
use compone
ents that we have improvved for perfec
ctly running
when runn
ning on SAP HANA.

00:01:10

That will be,


b for examp
ple, the ABA
AP List Viewe
er with Integrated Data Acccess (the ALV
A with
Integrated
d Data Acces
ss) and some
e other impro
ovements.

00:01:20

But let's ju
ump to the slides and havve a look at what
w
migratio
on to SAP HA
ANA means

00:01:28

and especcially what th


hat means fo r us in this coursewhatt we will be ta
talking aboutt in this and
the upcom
ming weeks.

00:01:35

We will sta
art with the Detect
D
phase
e mentioned already: func
ctional corre ctness and, of course,
also perfo
ormance optimization pote
entials.

00:01:44

We will then in the week 3 and the


e early week 4 talk about how to optim
mize existing ABAP
coding

00:01:51

t explore the
e features off SAP HANA
A and really re
ethink and innnovate yourr
and how to
application
ns.

00:01:58

You will se
ee the slides
s a couple off more times in the upcom
ming units.

00:02:04

Okay, so now
n
let's go to the first sttep: migration to SAP HA
ANA.

00:02:10

Migration to SAP HAN


NA is nothing
g more than any
a other dattabase migraation.

00:02:18

n be some functional issu


ues when mig
grating from one databasse to anotherr database,
There can
and this iss exactly whe
ere this unit ccomes in

00:02:28

to show yo
ou tools to detect those p
potential func
ctional issues.

00:02:35

If you havve normal cod


ding, basicallly it should work
w
as before the migrattion, but as always,
a
there are some exceptions

00:02:46

u
for exa
ample, Native
e SQL coding
g with, for exxample, an EXEC
E
SQL
and this iss when you used,

statementt in the ABAP


P
00:02:56

and where
e you really relied
r
on nat ive database
e features an
nd also used them in your coding.

00:03:04

Also there
e are some is
ssues with im
mplicit DB-sp
pecific behavior, which meeans that da
atabases
have, of course,
c
algorithms in the ccoding

00:03:15

where the
ey do their op
ptimization w
when selecting and preparing the dataa as you wan
nted to have
it

00:03:21

y, for examp
ple, an ORDE
ER BY clause
e in your SQ
QL statement,
and if you don't specify

00:03:27

bles from one


e database or
o another onne. But let's take
t
a look
you mightt get differentt ordered tab
at some code
c
example
es.

00:03:37

Yes, we have
h
prepared some code
e snippets sh
howing you exactly
e
what we talked ab
bout,
exceptions,

00:03:44

e it again, ev
verything will work fine wh
hen migrating
g to HANA eexcept for tho
ose
so to state
exceptions that I will show you on the next slide.

00:03:55

And those
e exceptions are then, of course, whe
ere you have to adopt maandatory ado
options in
your ABAP
P coding when migrating
g,

00:04:05

for examp
ple, from SQL
L Server to th
he SAP HAN
NA database.

00:04:10

Jens has mentioned th


hem already for example
e, the usage of
o native SQ
QL that might or might nott
epending on
n the SQL sta
atement you used.
be a probllem, really de

00:04:19

If it is valid
d for any database, then of course, it will work als
so on SAP HA
ANA.

00:04:25

However, for example here, in thiss example, we


w have MYS
SQL coding aand this will certainly
c
not
S
HANA.
work on SAP

00:04:37

The proble
em with Native SQL here
e in that case
e with ABAP Database C
Connectivity, the ADBC,
that reallyy then gives you
y a runtime
e exception

00:04:47

and those
e are, of courrse, are not th
ally in producctive coding.
hat nice to have, especia

00:04:53

Another example here


e is a databasse-specific hint.
h
That is not
n really a p roblem. It will just not be
d by SAP HANA.
respected

00:05:04

The hint iss there, you will


w get a wa rning, but it is
i not as problematic as a runtime ex
xception.

00:05:12

Then the relying


r
on un
ndocumented
d behavior. Jens
J
has mentioned that already.

00:05:18

SAP HAN
NA uses another ordering algorithm when
w
retrievin
ng the data thhan, for exam
mple, an
Oracle Da
atabase.

00:05:25

That is no
ot really a pro
oblem. Let's ssay it like this: It's just un
ndocumentedd behavior

00:05:30

and if you have relied on that impliicit ordering, for example


e, of your SQ
QL Server dattabase or
Oracle database,

00:05:40

uble and it is especially problematic since you donn't even get a runtime
you mightt get into trou
exception that will give
e you a hint tthat there is a problem.

00:05:50

m
get som
me random orrdering and you
y have relied on a speecific ordering
g and that
But you might
gives you nonsense fo
or your appliccation

00:05:58

m
not eve
en get notice d in the first place but on
nly in your prooductive sys
stem.
and that might

00:06:04

Nonsense
e data is neve
er a good ide
ea in the bus
siness proces
ss. Not reallyy.

00:06:10

So here fo
or example, ifi I have a SE
ELECT state
ement without a specific O
ORDER BY statement,
s

00:06:16

and later on
o use that data
d
in a read
d table with binary
b
search, that mightt get you into
o trouble.

00:06:25

Then, for example, dirrect access to


o physical po
ool or clusterr tables. We have heard about
w
depooling, declustering from Jens in the first week

00:06:35

dary indices which


w
you, foor example, have only
and if you have checks for existen ce of second
d
for other databases

00:06:43

and not fo
or the SAP HANA, that al so is a mand
datory adoption that you have to do before
b
you
can migra
ate to SAP HA
ANA.

00:06:51

Maybe on
ne more last word
w
so thatt you don't ge
et into panic mode or som
mething like that,
t
it's just
on Native SQL statem
ments.

00:06:59

S
stateme
ents will run o
on any datab
base, since Open
O
SQL is standard an
nd database-So open SQL
independe
ent.

00:07:07

Just to have you on th


he safe side h
here.

00:07:11

he system, help is near.


Okay, but even if you have such p roblems in th

00:07:16

f that we have introducced new statiic code checks to really sshow you tho
ose code
Yes, and for
snippets that need ma
andatory ado
options

00:07:27

ave also intro


oduced a new
w code chec
ck tool which is not only a code check
k tool
and we ha

00:07:35

but also helps you with


h quality asssurance processes like, fo
or example, a Q-Gate an
nd so on.

00:07:41

w prioritiess for develop


pers on code
It introducces verdicts with

00:07:47

and this iss our all new ABAP Test Cockpit and this ABAP Test
T
Cockpit is natively in
ntegrated in
our ABAP
P Development Tools

00:07:56

but, of cou
urse, also av
vailable in the
e SE80.

00:08:00

Yes, and to
t mention th
his here on th
his slide, the
e availability of
o that tool iss even before
e 7.4,

00:08:09

so you can check thos


se things alre
eady before you
y migrate to SAP HAN
NA.

00:08:15

ust have a look at that too


ol directly in the system.
But let's ju

00:08:20

So the AB
BAP Test Coc
ckpit in its co
ore has Code
e Inspector th
hings,

00:08:26

so let's sta
art with the Code
C
Inspecttor, so the Co
ode Inspecto
or inspection methods.

00:08:31

Let's have
e a look with the shortcut . I'm going to
o the well-known Code Innspector.

00:08:38

In order to
o find functional issues in
n your coding
g, we have provided a gloobal check va
ariant.

00:08:48

Here I use
e the global and
a we have
e introduced FUNCTIONA
AL_DB, it is ccalled.

00:08:56

So, let's have a look at


a this FUNCT
TIONAL_DB
B check variant, and you ccan see that we have a
g when workking with this Code Inspec
ctor variant.
couple of tests running

00:09:07

ple, security checksI w


will just open thatlike critical statemeents or here,, for
For examp
example, the usage off ADBC whicch we had on
n the slide,

00:09:17

erations in Poool/Cluster Tables.


T
then also the robust programming stuff like Search DB Ope

00:09:27

Or, for exa


ample, the se
earch for pro
oblematic sta
atements, here without thhe ORDER BY
B
statementt.

00:09:35

So you se
ee we have th
hese checkss. So in principle, you wou
uld now go aand execute that or
check thatt Z-coding in
n your system
m

00:09:46

or in your namespace with this FU


UNCTIONAL_
_DB variant.

00:09:52

ke to not sho
ow that with the Code Inspector, but w
with the ABAP Test
However, we would lik
nd in its full integrated in the ABAP Development
D
Tools and E
Eclipse.
Cockpit an

00:10:02

For that, le
et me close that,
t
I just co
opied the FUNCTIONAL_
_DB name heere over. Clo
ose that, and
d
go for the ABAP Proje
ect, right-clickk,

00:10:13

ontext menu the Propertie


es. And you can see heree the ABAP
and selectt from the co
Developm
ment and here
e an entry fo
or ABAP Testt Cockpit.

00:10:22

You can of
o course, configure your system or th
he ABAP Tes
st Cockpit in your system
m to run with
a FUNCTIONAL_DB variant
v

00:10:33

an also switc
ch to that in yyour specific Eclipse insta
allation or thee ADT installation.
but you ca

00:10:41

So here th
hat is the deffault of the syystem and I will
w change that
t
with FUN
NCTIONAL_
_DB and
Apply it.

00:10:48

And in ord
der to showcase what the
ese check tools are capable of, we haave provided
d some bad
guy doing all of the stu
upid things th
hat you shou
uld not do.

00:11:00

STATIC_FUN
NCTIONAL and I'm just... I don't tell yo
ou what the
So I have a report ready called ZS
es.
report doe

00:11:14

I'm just do
oing right-clic
ck on the rep
port here in th
he Project Ex
xplorer and sselect Run As
A ABAP
Test Cockkpit.

00:11:23

And I have
e incorporate
ed the FUNC
CTIONAL_DB
B checks. Ex
xecute it and you will see
e that it
contains ATC
A
errors,

00:11:33

ABAP Tesst Cockpit errors, and I ca


an see them in the Problems view. I ccan even navigate to
them.

00:11:40

ETE ADJAC ENT DUPLIC


CATES. Let's
s just jump thhere.
So, for example, DELE

00:11:48

ent duplicatess but, well, th


here is no ordering applieed here. Of course,
c
this
So I'm delleting adjace
is very easy for me to find

00:11:58

t SELECT is directly ab
bove. Let's have
h
a look fo
or example aat the READ....BINARY
because the
SEARCH,, the same holds here.

00:12:05

I have a SELECT
S
again without an
n ORDER BY
Y and I'm using then this internal table in a READ
D
TABLE bin
nary search statement.

00:12:15

Again not a good idea because I h


have forgotten this ORDE
ER BY.

00:12:21

p at the intern
nal table and it says it's pproblematic and
a it says
Okay and last but not least, a loop
c so...becausse I'm doing...
that this iss problematic

00:12:34

Yeah, you
ur doing again the loop on
n the SELEC
CT you have above, if youu scroll just a little bit
up...

00:12:40

h
here ag ain the SELE
ECT* with the DELETE A
ADJACENT
Yes, thankk you. You have

DUPLICA
ATES and afte
erward you d
do a LOOP
00:12:47

this is also
o a code part that you sh
hould check for.
f And here
e we have thee AT NEW because
b
the
AT NEW carrid
c
and yo
ou...

00:12:57

beforehan
nd the carrid was sorted a
and now it may
m be not so
orted by the ccarrid so you
u could have
other step
p-ins of that lo
oop at this p osition.

00:13:07

You just have


h
to get rid of the AT N
NEW or add an ORDER BY clause.

00:13:12

Exactly. So
S it's very im
mportant to ha
ave a look at such code snippets

00:13:18

because they
t
can reallly get you in
nto trouble sin
nce you relie
ed on the impplicit ordering
g.

00:13:23

Okay, so much
m
about the ABAP Te
est Cockpit and
a the integ
gration in ourr ABAP Deve
elopment
Tools in Eclipse.
E

00:13:31

Exactly bu
ut there come
es only one m
more questio
on in the gam
me...sorry, thhis was the wrong
w
direction.

00:13:37

uestion is if you
y have som
me, if you could add some runtime daata to that sta
atic code
So, the qu
check beccause that static code che
ecks

00:13:46

for the fun


nctional issue
es might not find all problematic thing
gs and if you can have a report which
runs on yo
our productiv
ve system an
nd checks, fo
or example,

00:13:56

for empty SELECT...F


FOR ALL ENT
TRIES or un
nsecure ones
s, or find SQLL statements
s that are
uted
just execu

00:14:04

without an
n ORDER BY
Y clause, so you might ha
ave 100,000 of them, thiss report here
e will really
help you.

00:14:12

f 1 or 2 weeks and the result will the


en help you
You can run it on yourr productive ssystem just for
e right positio
ons and have
e a secure migration
m
pha
ase.
to gain the

00:14:24

Yes, so it really supple


ements the sstatic code ch
hecks with ru
untime inform
mation and we
w will see
ept also coming in one off the next units.
that conce

00:14:35

Okay, then thank you for unit 1. Le


et's now take
e a look at wh
hat's upcomi ng.

00:14:43

at about the performance


e of my codin
ng?
So, week 2 unit 2, wha

00:14:48

or the next unit.


u
Bye-bye .
See you fo

WEEK 2, UNIT 2
00:00:13

Hi there and welcome back to wee


ek 2, unit 2.

00:00:16

ve talked abo
out the tools to detect potential functioonal issues when
w
Hi. In the last unit we'v
NA.
migrating to SAP HAN

00:00:26

m coding?
In this unitt, we will tackle the questtion, What about the perfformance of your custom
Jasmin.

00:00:33

u Jens. So le
et me show yyou where we
e are in the storyboard.
s
W
We are still in
n the Detect
Thank you
phase.

00:00:39

ould like to migrate


m
to SA
AP HANA or you
y already migrated to S
SAP HANA
So you wo

00:00:44

and you have


h
already executed the
e functional correctness checks with the Code Ins
spector or
the ABAP Test Cockpit as we have
e shown you
u in the last unit.
u

00:00:52

selves the qu
uestion abou
ut performanc
ce and we w
will show you today the
Today we will ask ours
nce optimizattion potentia l checks thatt we have provided for yoou.
performan

00:01:02

Okay, so it's
i all about performance
e and you typ
pically ask th
he question, I have migra
ated to SAP
HANA with my custom
m coding,

00:01:11

f
And tthe answer is
s yes.
is everything running faster?

00:01:16

a
is, tha
at depends. It really depe
ends on how much databbase-oriented
d coding you
u
Well the answer
have,

00:01:24

u really execu
uted of your programs on
n the databasse.
so how much time you

00:01:29

c
only rrunning on th
he ABAP serv
ver without innteracting with the
If there is only ABAP coding
database,

00:01:35

o course, no potential forr performanc


ce improveme
ents with SA
AP HANA.
there is, of

00:01:40

The good news is we have recomm


mendations available
a
for you so perfoormance guid
delines.
t
about tha
at in a minute
e.
Jens will talk

00:01:47

And moreover, we hav


ve tools that help you to follow
f
these guidelines.

00:01:52

ns, please ca
an you introd uce the SQL
L performanc
ce rules guideelines for us?
Okay, Jen

00:01:58

Yes, of co
ourse. So the
ese guideline
es have been
n around alre
eady before S
SAP HANA.

00:02:04

So most of
o you, or som
me of you, ha
ave probably
y seen this, but
b let me exxplain in deta
ail what they
mean

00:02:10

hey now mea


an when we have
h
SAP HA
ANA.
and especcially what th

00:02:14

First of all, in the days before SAP


P HANA, all of
o these guide
elines or rulees had the sa
ame ranking
ame importance.
and the sa

00:02:26

With SAP HANA, this has changed


d a little bit. So
S some are more imporrtant and som
me are less
important..

00:02:32

Let's first of
o all take a look at the m
more important ones and they are moore important because

00:02:39

it's based on the architecture and tthe layout off SAP HANA, as we havee told you in week
w
1.

00:02:45

Okay, so let's
l
take a lo
ook and give
e you some examples
e
what we mean with those ru
ules.

00:02:54

First one: Keep result sets small. S


So this basic
cally means iff you write a SELECT sta
atement,
d only selectt the data wh
hich you wan
nt to display,
you should

00:03:04

which mea
ans apply me
eaningful WH
HERE condittion to the SQ
QL statemennt. So, for example, if
you only want
w
one line
e, you don't sselect the wh
hole table.

00:03:14

You shoulldn't do that, of course, b


but it's a good
d example he
ere.

00:03:18

Another one is minimiz


ze the amou nt of data tra
ansferred.

00:03:21

o
bring tha
at data to the
e application server that yyou really wa
ant to use in
This basiccally means only
the application server

00:03:28

n a UI, progra
am batch job
b, whatever. So how do you
y do this?
or later on

00:03:35

There's no
ormally only the columnss you need, so
s don't write
e a SELECT** statement. Just only if
you really need all of the
t columns.

00:03:44

a
the MA
ARA table, thhere are som
me columns
Instead off a SELECT * statement, if you think about
inside. Yo
ou probably don't
d
need th em all on the
e UI at the sa
ame time.

00:03:54

And of cou
urse, minimiz
ze the numb
ber of data tra
ansfers. This
s basically meeans prefer array
operationss instead of single
s
operattions.

00:04:03

So, this ca
an be once you
y do a SEL
LECT of a sa
ales order he
eader table, tthen write a loop and
then selecct, for examp
ple, the saless order item table.
t

00:04:13

This can basically


b
be written
w
in one
e SELECT statement, jus
st without a l oop, by joining those
tables.

00:04:19

b handled la
ater in week 3
3, when we show
s
you the
e new Open SQL enhanc
cements.
This will be

00:04:26

Another point here cou


uld be the IN
NSERT statem
ment, for exa
ample. So yoou do someth
hing on the
ernal table
bigger inte

00:04:35

and you want


w
to insertt into the tablle. So what we
w are seeing is, you do that, do a loop, and do
the INSER
RT statement in the loop by each line
e of this table.

00:04:46

This is mu
uch better if you
y do the IN
NSERT after the loop. Th
hat's basicallyy what we mean
m
with an
array operration.

00:04:52

Those are
e the ones that are very im
mportant when we talk about SAP HA
ANA and the
e Code-toData para
adigm.

00:05:01

What's no
ot so important anymore iis minimize search
s
overhead, for exa mple, or kee
ep
unnecessary load awa
ay from the d
database.

00:05:08

But alwayys keep in mind unnecesssary load.

00:05:13

So you ca
an, of course, put load on
n the databas
se if it makes
s sense. It's jjust a topic of
o
unnecessary load.

00:05:20

houldn't calcu
ulate someth
hing that you don't need or
o somethingg like that.
So you sh

00:05:25

Okay, so now
n
enough of these guiidelines. Let's take a look
k at the checcks we have introduced
to find pottential code snippets.
s
Jassmin.

00:05:38

Thank you
u Jens. I will show you th
hat using the tools that we
e have introdduced alread
dy in the last

unit.
00:05:44

t
about the Code In spector as well
w as the AB
BAP Test Coockpit
We have talked

00:05:49

and we ha
ave shown yo
ou that with a Code Inspector variantt called FUNC
DB.
CTIONAL_D

00:05:55

Let me jusst jump into the


t system. W
We've provid
ded somethin
ng very similaar, but for do
oing the
checks on
n the perform
mance side.

00:06:08

Let me jusst execute the Code Insp


pector, open the transaction again, annd enlarge th
hat a bit.

00:06:15

In the lastt unit we had FUNCTION


NAL_DB and now we have a Global C
Code Inspecttor variant
called PER
RFORMANC
CE_DB.

00:06:24

What's in there? In principle, the c hecks that are checking exactly the thhings that Je
ens has just
he guideliness.
showed uss to follow th

00:06:33

Here you can find perfformance ch ecks. Let me


e just open th
hat for you.

00:06:36

ple, minimize
ed result set so we have analyses of WHERE connditions, for SELECT
S
For examp
statementts, for examp
ple.

00:06:45

Then we have
h
talked about
a
the collumn storage
e in SAP HANA.

00:06:52

So the SE
ELECT * state
ement, as Je
ens just mentioned, is pro
oblematic annd it is especially
problemattic

00:07:02

if you later on don't us


se any of thosse columns that
t
you have
e selected buut only one or
o two of the
columns.

00:07:09

And yes, maybe


m
also mention
m
the Search DB Operation
O
in loops acrosss modulariza
ation units.
That is a new
n
check we
w have intro duced.

00:07:17

It is not ne
ew concernin
ng the checkk itself. Jens has
h mentioned that you hhave a SELE
ECT...END
SELECT

00:07:26

e loop and wiithin this loop


p, you have a SELECT S
SINGLE, for example.
e
so that is basically the

00:07:31

ht be problem
matic or that ccan be problematic.
That migh

00:07:35

We were not
n able to find such thin gs if the SEL
LECT...END SELECT waas in anotherr
modularization unit as the SELECT
T SINGLE.

00:07:44

ample, you have a metho


od call and within
w
this ME
ETHOD call yyou have a SELECT
S
So for exa
SINGLE.

00:07:50

w
the SEL
LECT...END
D SELECT, yo
ou are not abble to find that with old
If that metthod call is within
code inspection varian
nts.

00:07:57

w are able to
o also have th
he SELECT....END SELE
ECT and a m
method call orr function
So now we
call and within
w
that aga
ain,

00:08:05

a function call whatsoe


ever certain layers of mo
odularization. We can alsoo find that kind of
problemattic statementts now.

00:08:16

But let me
e just take thiis PERFORM
MANCE_DB check varian
nt and execuute it on a ba
ad guy we
have written for you.

00:08:23

y
custom
m coding and you would like to check ccustom codin
ng. For us,
So typically you have your
ow that you in a demo re
eport that we have specia
ally provided for that purp
pose.
we will sho

00:08:34

Okay, so let
l me just op
pen the repo
ort and it is ca
alled ZSTAT
TIC_PERFOR
RMANCE

00:08:44

like the on
ne we've see
en yesterday for functiona
al correctnes
ss. Let me jusst open that.

00:08:51

I will not te
ell you what the report is doing but I will
w just execute the ABA
AP Test Cock
kpit.

00:08:58

Yeah, but you know yo


ou have to ch
hange the ch
heck, you know this happpens always to me.

00:09:03

nding me.
Yeah, thanks for remin

00:09:05

As we've stated
s
in the last unit, you
u can specify
y the code in
nspection varriant or the ABAP
A
Test
Cockpit va
ariant in the properties
p
fo
or the ABAP project.

00:09:17

Just go to the properties, to the AB


BAP Test Co
ockpit, and he
ere I interchaange FUNCT
TIONAL_DB
FORMANCE
E_DB becausse we are no
ow interested in performaance.
with PERF

00:09:27

I apply tha
at, thanks forr reminding m
me, and I will select from the context menu Run As
A ABAP
Test Cockkpit.

00:09:38

And as sta
ated last time
e we have do
one this, you
u see, in the Problems vieew,

00:09:44

some erro
ors indicating
g what could be improved
d performanc
ce-wise.

00:09:51

So here, for
f example, the NonLoca
al Nested Re
eading DB Operations, leet me go therre.

00:09:57

You see th
hat within a form,
f
I have a SELECT SINGLE.
S
The
e question is now, where do I
execute th
his statement?

00:10:06

SELECT SINGLE
S
here
e is not that g
good becaus
se I'm not do
oing anythingg with this anymore

00:10:12

but I'm concentrating on


o non-local nested read
ding DB operations. And yyou can see here that
h
a LOOP
P statement
above, I have

00:10:25

and within
n this loop, I have
h
this PE
ERFORM sta
atement wherrein, in anothher modulariz
zation unit
here, I'm doing
d
a SELE
ECT SINGLE
E statement.

00:10:37

A similar thing
t
is the SELECT
S
state
ement that could
c
be transformed, a pproblematic SELECT
S
*
statementt,

00:10:45

so here yo
ou see I have
e SELECT * and it tells me
m that I have a certain ppercentage of fields
unused.

00:10:51

o to the ABA
AP Problem H
Help on that
Maybe it'ss not informative enough,, so let me go

00:10:59

and it tellss me actually


y I'm using...0
0? Not so mu
uch at all. Ye
eah, none of the fields.

00:11:06

Of course, it doesn't make


m
too mucch sense to select
s
all the columns if I 'm not using any later
on.

00:11:13

e go back to tthe slides.


Okay. Witth that let me

00:11:18

So we havve these stattic code checcks, the static code checks and the pperformance checks
ready.

00:11:26

stribution on how custom


m code is distributed in thee system.
So here iss a typical dis

00:11:34

So there iss some unus


sed code. Yo
ou can remov
ve that with the
t UPL and the rest can
n be
checked by
b the static code
c
checkss.

00:11:44

So exceptt for dynamic


c code, I cou ld in principle
e now spot all
a my perform
mance-critica
al things and
get ready to do the optimizations.

00:11:57

Yeah, but of course, iff you think no


ow about 100
0,000 errors in your custoom code, this is not
ot the best ide
ea
maybe no

00:12:06

to just start optimizing because it w


would take a while and maybe
m
you woouldn't beneffit from the
00, or 99,000, and only th
he last 10 wo
ould help you.
first 90,00

00:12:16

So it's a good idea to add


a runtime data here. And
A now you might you saay okay, let me
m use the
e ABAP Proffiler to find it..
SAT or the

00:12:27

But those would be on


nly stitches in
n all of this co
ode parts and not give yoou a full profile of your
d business,
server and

00:12:36

of your co
ode, the full SQL
S
profile.

00:12:41

That's exa
actly where the next sesssion comes in
n

00:12:44

where we will take a lo


ook at what w
we built for you
y to give yo
ou a full footpprint of your productive
om the SQL side.
system fro

00:12:55

Stay tuned
d and see yo
ou. Bye, Bye .

0
10

WEEK 2, UNIT 3
00:00:13

Hello and welcome to week 2, unitt 3.

00:00:17

T
we will be talking a
about the SQ
QL profile of your producttive system.
Hi there. Today

00:00:23

Let me go
o one step ba
ack and tell yyou what we talked about in the last tw
two units. We
e have
shown you static code
e checks.

00:00:31

o functional correctness
c
n you migrate to SAP HA
ANA with you
ur coding.
First, to do
checks when
And the second thing is what we to
old you abou
ut

00:00:40

s again, but tthis time on performance


p
e things. So w
where should
d I optimize
our static code checks
cks?
using stattic code chec

00:00:49

However, we also said


d that it is no
ot a good idea to then just start and doo all of the adoptions.

00:00:55

f the functiional things, but not yet for


f the perforrmance thinggs.
Certainly for

00:01:01

Let me remind you of the pie chartt diagram tha


at we have shown you yeesterday. Wh
hy we said
g
idea.
it's not a good

00:01:09

We said the static cod


de checks co
over all of ourr coding; how
wever, it mighht not be perrformancerelevant.

00:01:16

c
snippet would just ru
un in an application serveer lifetime maybe once.
So the adoption of a code

00:01:24

ally worth op
ptimizing the performance
e of that code
e snippet.
It's not rea

00:01:29

We have said that it is


s beneficial to
o include run
ntime informa
ation and to ccombine this
s information

00:01:36

ave also talked about the


e SAT, but th
hat will only give
g
you stitcches, so only a couple of
and we ha
code snip
ppets where you
y should o
optimize.

00:01:46

But you sttill don't know


w what is the
e most imporrtant thing I should
s
optimiize first.

00:01:51

For that, we
w will show you a tool to
oday that you
u can really get
g the compplete SQL pro
ofile of your
productive
e system.

00:01:59

I will also show you why you can d


do that in the
e productive system
s
withoout overhead
d killing your
business processes at the same tiime.

00:02:09

h
written down some numbers to give you a fe
eel of what iss really happening on a
Here we have
normal ER
RP system.

00:02:17

So here in
n this examp
ple with 6,000
0 concurrent users, you really
r
see theere's much is
s going
here.

00:02:26

o impressed when I got th


he number fo
or the first tim
me.
I was also

00:02:30

Just think about it. 140


0 billion reco
ords collected
d here during
g two weeks'' execution time.

00:02:40

ns 10 billion records read


d or changed
d every day and
a this by a round 1 billio
on SQL
This mean
statementts.

00:02:48

So, quite an amount of


o data which
h is created here
h
and we are all humaans. We cann
not

00:02:58

on together ju
ust in our bra
ains, so we really
r
need hhelp here to know
k
where
gather succh informatio
to optimizze.

11

00:03:04

And that'ss exactly whe


ere our new ttooling will sttep in

00:03:07

and Jasm
min, can you tell
t us a little bit about the
e new transa
action?

00:03:11

Yes, thanks Jens. So you've seen these amaz


zing numbers
s and therefoore we have come up
S
Monitor.
with the SQL

00:03:20

What thatt tool is doing


g is giving yo
ou the SQL profile
p
in yourr productive ssystem

00:03:28

and with that,


t
it will he
elp you to find
d the perform
mance optimization potenntial.

00:03:33

So really, the most important SQL s that you might


m
be intere
ested in or yyou are certainly
d in optimizing are worth looking at in order to optimize.
interested

00:03:43

Here is the availability


y written dow
wn and there are even mo
ore slides oncce you get th
he slide
y
own, where you can the availabillity matrix of the tooling.
deck on your

00:03:53

Jens will also


a
show yo
ou in a demo
o in just a sec
cond.

00:03:56

More inforrmation can even be foun


nd in this SA
AP Note or in this very intteresting and
d very nicely
written SC
CN blog

00:04:05

by a deve
elopment colleague of ou rs: The SQL Monitor Unleashed.

00:04:11

Before we
e come to the
e demo, let m
me show you
u a bit of arch
hitecture.

00:04:15

I promised
d to tell you why
w it is okayy to run that in a productive system. Y
You might sa
ay, Oh that
is killing my
m business processes I w
o do my busin
ness.
would like to

00:04:25

And of course, we are


e aware of tha
at and you can
c run the SQL
S
Monitor w
without too much
m
overhead

00:04:32

ou are execu
uting your bu
usiness proce
esses, the daatabase interrface is
and that iss because yo
working fo
or you interac
cting with the
e database,

00:04:40

and especcially with the


e application
n tables. And at the same
e time, you haave an asynchronous
job runnin
ng and the im
mportant thing
g is asynchro
onous.

00:04:49

The asyncchronous job


b is gathering
g the informa
ation for the runtime
r
mon itor, gatherin
ng the data,
and a batcch job is writting that to th
he SQL Moniitor tables.

00:04:57

And with that,


t
we have
e only a miniimal overhea
ad and you can
c run that inn your produ
uctive
system. Jens will also tell you how
w you then ge
et the informa
ation out of yyour productive system,

00:05:07

s
or dev
velopment syystem becau
use you also don't want too do the ana
alysis in the
to the Q system
productive
e system.

00:05:13

Okay, so Jens please show us a d


demo of that tool.

00:05:16

s
in, so fo
or that I switcch to the ABA
AP Developm
ment Tools.
Let's just step

00:05:21

I go to ourr development system an


nd let me jus
st open it. The transactionn is SQLM.

00:05:28

I open the
e transaction and then yo
ou see an ove
erview of this
s,

00:05:35

Oh nope, this is the SE93, I'm sorrry. So this ha


appens occasionally to m
me. Let me sw
witch to the
action here,
real transa

00:05:47

/n, yes, okkay. This hap


ppens to all o
of us, let's be
e honest. And finally heree you see the
e SQL
Monitor.

12
2

00:06:00

What do we
w have here
e? We have some admin
nistrative info
ormation up hhere on how much data
is gathere
ed,

00:06:07

when it wa
as last execu
uted, by who
om, and if it's
s at the moment active orr not and on how many
servers.

00:06:13

m to those buttons
b
wherre you can ac
ctivate it for all
a applicatioon servers or maybe only
It brings me
for specia
al application servers.

00:06:21

Yeah, ma
aybe it is good to mention
n here, if you would click now on the A
Activation bu
utton, it also
gives you a stopping time.
t

00:06:29

pically advise
e to run the S
SQL Monitor in a period of
o about two w
weeks, like the
t number
So we typ
have seen
n for the ERP
P system in tthe example,

00:06:38

because after
a
two wee
eks you don''t have any
or not too manychang
m
ges in the coding, so you
really can analyze the processes

00:06:46

w
is also
o a measuring
g frame whe
ere you really
y gather inforrmation.
and two weeks

00:06:53

Exactly. However,
H
and
d I will state tthat later on and again we
w also touchhed it already
y, you have
to iterative
ely repeat this

00:07:02

because maybe
m
in this
s two weeks of time fram
me, you don't have certainn important application
a
run.

00:07:10

arter-end run
n or year-end
d run. SSome
ething like that. So think aabout collectting all
Yeah, qua
business processes

00:07:18

ook at the da
ata. That we can do in the
e next tab heere.
and now let's take a lo

00:07:23

min has menttioned. You probably


p
don
n't want to annalyze itor yes, you
That's also what Jasm
can analyyze it in your productive ssystem

00:07:29

but you ca
an also get itt out of this ssystem and im
mport it into another one . So, what we
w now do is
we want to take a look
k at it.

00:07:37

ome to a cla ssical selecttion screen. You


Y can filterr by differentt criteria.
Display it.. Then you co

00:07:45

Let's just take


t
a look at
a our Z-codin
ng and we have prepared here, of coourse, something for
you, so Ja
asmin tends to call those reports, the bad guys.

00:07:55

There are
e some really
y bad guys in
n here and what you can do here now
w is very impo
ortant. So
you want to aggregate
e the results probably.

00:08:04

ave seen the numbers an


nd they are quite high also probably inn your system
m, so an
You've ha
aggregatio
on is a pretty
y good idea.

00:08:12

If you click here Aggre


egation By R
Request, you will get the data
d
aggregaated by the business
b
processess.

00:08:19

So, you se
ee the business processe
pect
es which hurrt you a lot frrom the perfoormance asp

00:08:25

and you can


c also give it an initial ssorting like, fo
or example, we now say the total amount of DB
execution time.

00:08:33

nally, ta da! Here


H
it is: the
e SQL Monito
or data.
So and fin

00:08:40

Many num
mbers, so it ta
akes...you ne
eed to get us
sed to it and that's the im
mportant thing
g, get you a
system an
nd try it out on
o yourself to
o know what the numbers
s mean.

13
3

00:08:51

I will give you just som


me brief exam
mples and wh
hat we get he
ere is the tottal DB time of
o this
process

00:09:00

h process is it, it's on the right side he


ere. So that's
s the processs which is called. If you
and which
analyze a classical bu
usiness syste
em without any filter,

00:09:09

it will be probably
p
VA0
01 or someth
hing like this will appear here.
h

00:09:14

And here you also see


e the DB time
e in percenta
age to the am
mount of the total time,

00:09:20

es you a goo
od feeling tha
at here much
h DB time is consumed
c
a nd an optimiization of
which give
the SQL iss here really possible.

00:09:32

So if you only
o
have 1%
% of DB time
e optimization
n of the SQL, wouldn't heelp so much at all.

00:09:39

So, imporrtant to know


w, here you ha
ave the proc
cesses and now
n
you can step down to
o the
statementt level.

00:09:48

In this scrreen now, you see the sta


atements wh
hich have bee
en executed in this busin
ness processs

00:09:56

and the go
ood thing is we
w have the information on how muc
ch every stateement inside
e this
process consumes
c
the
e DB time off these proce
esses.

00:10:06

That is the
e percentage
e right?

00:10:08

Yes, this is
i in percenta
ages. The tim
me is always
s milliseconds
s, by the wayy.

00:10:14

So this givves you a cle


ear picture he
ere that the first
f
one is probably the oone you are going for.

00:10:22

The otherr ones are no


ot of interest at this time, since we have 97%. Andd this is a SQ
QL
statementt

00:10:30

and it's he
ere inside this report. By clicking it, yo
ou can directtly jump to thhe source code.

00:10:37

Here you see you hav


ve a loop, SE
ELECT SING
GLE, which is, if you remeember the go
olden rules,
b
if you prefer the arrray operations
probably better

00:10:48

and mayb
be you can ev
ven think abo
out if the SELECT* statement is the ccorrect one.

00:10:52

Okay, and
d just by rem
moving it and writing it for example, ma
aybe with thee SELECT...FOR
ENTRIES
S, could be a good idea h ere.

00:11:03

Just shorttly one step back


b
again, sstatement lev
vel.

00:11:07

You also have the inte


ernal session
ns, which tells you how much
m
this proocess, how often this
h been exe
ecuted durin g the time fra
ame.
process, has

00:11:18

So the one with the highest numbe


ers are proba
ably those on
nes which arre executed the
t most.
ably. They are the ones th
hat are executed the mos
st.
Not proba

00:11:27

Okay, so as I stated, just take a lo


ook at it, play around, take
e a look at it,, and get a fe
eeling for it.

00:11:38

wn there too, just to see what's


w
in therre?
Can we even drill dow

00:11:41

n in that one?
? Yeah, let's take a look. So this is an
nother one, aand again dominating
Drill down
one with the
t percentag
ge

00:11:49

ment. If we take
and this time it's an IN
NSERT statem
t
a look at the numberrs and figure
es here, it's
a
again a SELECT loo
op.
probably also

00:12:00

Okay, it's a DO now, but


b yeah, butt very good coding.
c
How we really exxpect you to write
w
coding.

14
4

00:12:07

No just kid
dding. Again. prefer arrayy operations so collect th
his data insidde an internal table and
do the INS
SERT after the DO.

00:12:19

But of cou
urse those arre our bad gu
uys. I think ju
ust give you a feeling, tryy it out.

00:12:27

Go to the blog we hav


ve mentioned
d. It's a very good
g
blog to explain to yyou what you can
w the SQL Monitor.
analyze with

00:12:34

So this is one of our most


m
importan
nt tools. Justt to emphasiz
ze that. Okayy, Jasmin.

00:12:40

ank you Jens and even in


n the blog you
u can find so
o miraculouslly, Jens show
wed you
Yeah, tha
which ordering you ne
eed again,

00:12:50

h aggregatio
on he took. In
n the blog you will find in the referencces.
also which

00:12:57

You will find more info


ormation on h
how you sho
ould use these filters in givving you exa
actly the
at you would like to see.
things tha

00:13:05

Okay, so back to our pie


p chart diag
gram. You've
e seen it now
w several tim
mes and we now
n
have a
age of our wh
hole coding,
full covera

00:13:16

if we remo
oved, of courrse, the unussed code firs
st. We had th
he statical coode checks,

00:13:22

not measu
uring the dyn
namic code, of course, an
nd we can su
upplement thhe informatio
on now with
the SQL Monitor
M
Data in order to g
get the full co
overage.

00:13:30

But as me
entioned befo
ore, this onlyy holds true iff you really run it when yoou are execu
uting also all
of the stattements or all of the proccesses.

00:13:42

So for yea
ar-end reportting, monthlyy reporting, you
y may be need
n
to repeaat the measu
urement of
the SQL Monitor.
M

00:13:50

Okay, so with
w that I wo
ould like to ssay thank you
u and hand over
o
for Jenss to give you an outlook.

00:13:56

Okay, so now you hav


ve the system
m data, the live data of yo
our SQLs. Noow you know
w how to
he coding
analyze th

00:14:06

from the static


s
side with the code cchecks and now
n
you may
y ask the queestion, Wouldn't it be a
good idea
a to combine the live data
a

00:14:13

also with the


t information that I got from the sta
atic code che
eck? That's eexactly what we
w will
show you in the next unit.
u

00:14:22

uned and bye


e-bye. See yyou.
So stay tu

15
5

WEEK 2, UNIT 4
00:00:13

Welcome!! Great to have you backk for the fourtth unit of the second weeek.

00:00:17

Welcome also from my side.

00:00:19

s
you h
how to gather the SQL profile of your productive system
s
and
In the lastt unit, we've shown
analyze it using the SQ
QL Monitor t ransaction.

00:00:29

uldn't it be a good
g
idea to take this datta and comb
bine it with thee static code
e checks
Now, wou

00:00:37

that you have


h
learned in unit 2 with
h the DB_PE
ERFORMANCE variant aand compile it together in
one worklist to know also
a

00:00:47

oss a modula
arization unit,, yet just to enrich
e
the SQ
QL Monitor da
ata also
that this iss a loop acro
with the sttatic code ch
hecks

00:00:56

to make itt much easie


er for you to h
have an entry
y point here.

00:01:02

Of course
e, we have this transactio
on prepared for
f you and I guess Jasm
min can show
w you how
this workss.

00:01:09

Thank you
u Jens. So, the guy we a
are talking ab
bout is the SQ
QL Performaance Tuning Worklist
W
and
the transa
action ID is SWLT.
S

00:01:19

So let me get into the system and do Alt+F8 an


nd go for SW
WLT and aga in a selection screen
opens up..

00:01:29

Let me fill that with some informatiion. You've seen


s
something very sim ilar for the SQL Monitor,

00:01:36

o restrict on package level. That, in your


y
case, miight also be a Z-coding
so again I would like to
ample, a nam
mespace give
en to your co
ompany.
or, for exa

00:01:46

I also sele
ected I would
d like to Show
w Intersection of Results. I will not goo into the deta
ails, but that
will help me
m to enrich the
t informatiion here.

00:01:56

This is jusst for demo purposes.


p
Jen
ns has mentioned that we would like to include sttatic
informatio
on, static code check info
ormation to th
he SQL Moniitor.

00:02:06

I will start with the stattic checks. W


We have men
ntioned it sho
ould be the P
PERFORMAN
NCE_DB
n.
variant run

00:02:14

I say inclu
ude it please,, so I will use
e it and you can
c choose between
b
the Code Inspec
ctor

00:02:20

or the ABA
AP Test Coc
ckpit. Becausse we would like to promo
ote of coursee, the new to
ool, let me
just take the new tool and I have a
already prepa
ared an ATC run for you.

00:02:31

e
tha
at on the systtem using the code inspe
ection variantt PERFORM
MANCE_DB.
I already executed

00:02:37

So, I'm jusst selecting itt, a develope


er has done that
t
for me. You
Y don't seee the word developer,
d
it's called Demo Backg
ground Job ((DEMO_BG)).

00:02:47

hermore, I'm scrolling dow


wn. You can
n do some ag
ggregation annd by defaultt it's by code
e
Okay furth
position, source
s
code position, and
d message ty
ype.

00:02:58

I rather prrefer the only


y By Code Po
osition, but th
hat really doe
esn't make tooo much diffference.

00:03:06

Okay. In addition
a
to the static checcks, I would like
l
to include the SQL M
Monitor data

00:03:14

and typica
ally you would now go to your produc
ctive system, export the ddata there, an
nd import

16
6

into the qu
uality or deve
elopment sysstem the SQ
QL Monitor da
ata.
00:03:24

We only have
h
this one
e system ava
ailable so we are doing bo
oth things at the same tim
me and so I
say again, I would like
e to use it.

00:03:34

o course, aga
p
a sn
napshot for yyou.
That activvates it and of
ain, I have prepared

00:03:39

Which is the
t same tha
at I've shown
n you in the la
ast unit. Exac
ctly.

00:03:45

So even you
y could cre
eate a snapsshot here but we have see
en how to doo that in the previous
p
unit, so we
e will just select the snap
pshot we hav
ve already taken.

00:03:55

Again, calll the demo, and


a here aga
ain I have the option to filter

00:04:05

or to do th
he ordering, and
a again I w
would like to have a total DB executioon time as on
nly top
records he
ere.

00:04:13

Okay and with that info


ormation givven, I can say
y, just open the
t informatioon.

00:04:22

s again a lot of column


ns, a lot of information wh
hich might bee the first tim
me you
Now you see
execute it.

00:04:30

w complete
ely lost with all
a of those co
olumns and aall those info
ormation.
It really hit me and I was

00:04:34

ey doing here
e? What do they want from me?
What the heck are the

00:04:38

he same thing as with the


e SQLM as yyou've seen it, but you
Yes, so it's really an expert tool, th
t that.
get used to

00:04:46

And reallyy try it out and also have a look...again promoting the SCN bloog from our development
d
t
colleague telling you what
w
you can
n do with thatt tool.

00:04:56

d only briefly
y mention a ccouple of exa
amples, also the examplees that we ha
ave already
So I would
seen.

00:05:02

g, which is no
ow the differe
ence, or one of the differe
ences, betweeen the SWL
LT and the
First thing
SQL Monitor.

00:05:11

e, when I dou
uble-click on one of these
e lines, a drillldown. That is on SQL le
evel, on
I can have
statementt level, and you
y might askk, Where did
d I enter?

00:05:21

So here iss the informa


ation about e ntry points, request
r
entry
y points, takeen from the SQL
S
Monitor.

00:05:28

e lower right--hand side yo


ou have the additional
a
infformation fro
om the static
Moreover, here on the
o from the Code Inspecto
or or from the
e ATC in that case.
checks, so

00:05:38

You have met already


y TEST3, the
e very meanin
ngful operatio
ons we do thhere, and here for
example,

00:05:47

t
there is a NonLocal N
Nested Read
ding DB.
I am told that

00:05:51

Of course
e, we could have gathered
d this information already
y from the staatic code che
ecks alone,

00:05:56

but here we
w also see that
t
is the top
ation execute
ed from of coourse within my Zp-most opera
packages.

00:06:05

eally took the most time a


and it's certainly good to optimize
o
heree first because
So that re
compared
d to all of the other DB exxecutions, all others are rather
r
low.

00:06:15

So really a prioritized list where I sshall optimize


e first.

7
17

00:06:20

Okay. Now
w I can have
e a drilldown.. That is the additional
a
infformation noow, not only the
t SQL
Monitor bu
ut again the SQL,

00:06:30

the static code check information.

00:06:32

And here I have additional informa


ation given, so
s for example, it tells mee where are the
t entry
points.

00:06:40

CT statement . I can go the


ere again, yo
ou have seenn that before. That is the
So here iss the SELEC
SELECT SINGLE
S
stattement, whicch was bad because
b
it wa
as in a loop.

00:06:48

And of course, I see th


he loop right above that, but it could be
b in anotherr modulariza
ation unit

00:06:55

nformation
so where the
e actual call of that metho
od is which i s enclosing the
t loop and
and this in
the SELEC
CTcan als
so be navigatted from here
e.

00:07:08

So here you see I hav


ve a DO five ttimes again, a DO statem
ment which iss not very go
ood to do.

00:07:15

g! Yes, aweso
ome coding. So I can nav
vigate in herre. That is ou
utermost
With awessome coding
point.

00:07:23

e in and you see


s then with
hin this meth
hod, I have th
his loop...enddloop and SE
ELECT
I navigate
SINGLE within
w
there.

00:07:31

Okay. Bacck to the SW


WLT informati on. So again
n our TEST11 example.

00:07:41

I could do
o a drilldown here with the
e beloved INSERT statem
ment, withouut the array operation.
o

00:07:51

So really a bad guy off course consstructed. No..

00:07:58

Okay, so what
w
you can
n also read ffrom that list here, for exa
ample, is thiss guy here. I see the
mean reco
ord is quite high.
h

00:08:09

I do a dou
uble-click and
d you see the
e Code Inspe
ector hints to
o me that theere might be unsecure
use of FO
OR ALL ENTR
RIES.

00:08:17

We've also mentioned


d that before,, so in additio
on to the runtime monitorr data, we ha
ave here the
NTRIES
unsecure FOR ALL EN

00:08:28

while to have
e a look at tha
at, because maybe the F
FOR ALL ENTRIES table
and it might be worthw
mpty.
here is em

00:08:39

We have mentioned th
hat in the firsst unit about Runtime Che
eck Monitor aalready but here
h
just to
ain...
see all of that, will aga

00:08:51

actly the sam


me code snipp
It was exa
pet. Exactly.

00:08:54

So maybe
e a word of precaution
p
be
efore we end the demo.

00:08:58

You see we
w have the top-most
t
thin
ngs that migh
ht have potential to optim
mize

00:09:05

but as I sttated before, you need to


o have a cuto
off when you stop the opttimization.

00:09:11

You will always have the


t top 10 orr the top 20 things that yo
ou would likee to investiga
ate.

00:09:17

ave the top 10 here, you investigate them, you adopt them, yoou do someth
hing for
So you ha
performan
nce, and then
n

00:09:24

that was done,


d
for exa
ample, in thiss example. You
Y have the Optimize repport.

00:09:29

But after certain


c
iteratiions, the opt imized cases
s will also be
e in that list.

18
8

00:09:34

So think what
w
you wou
uld like to ac hieve before
e you start the
e project.

00:09:39

Otherwise
e you will go into an infini ty loop with that.
t

00:09:45

Okay, with
h that I would
d like to hand
d back to Jen
ns.

00:09:48

Yeah, bacck to the pres


sentation. Th
hank you Jas
smin.

00:09:51

So, that iss what you've


e just seen, w
working with the prioritize
ed worklist.

00:09:57

Now I justt want to reca


ap what we d
did in this De
etect phase again.
a

00:10:03

When you
u want to mig
grate to SAP HANA, first of all again, important annd mandatory step is to
find the fu
unctional issu
ues that could
d occur.

00:10:14

You've lea
arned that in unit 1. Afterw
rward, it's a very
v
good ide
ea to scan yoour productiv
ve system
with the new tool, the SQL Monitorr,

00:10:23

o
abo
out your SQL
L processes mentioned.
to get an overview

00:10:27

This is alsso very important becausse this was ye


et not available in the claassical world

00:10:32

and now you


y can really do an anallysis on that even before you do the m
migration part.

00:10:39

So information about in which rele


ease the SQL
L Monitor is available
a
is innside this course
a there is also
a
consultin
ng support by SAP for tha
at.
material and

00:10:49

All informa
ation again is
s in the mate
erial. After yo
ou've done th
he analysis, ttake the mos
st critical
performan
nce point

00:10:57

and of cou
urse, correct the function
nal issues because you want
w
to have a running sy
ystem after
the migrattion and this is exactly th en where yo
ou can migratte

00:11:06

and start this


t
iterative performance
e improveme
ent approach
h. And as Jassmin stated, use
common sense
s
there.

00:11:15

Don't optim
mize a reporrt which take s just 0.5 milliseconds on
n the databasse.

00:11:23

It makes no
n sense at all
a and just b
burns your re
esources. And
d then just coontinue until you have
the perforrmance you like.

00:11:31

Okay, that's for the De


etect phase. Let's take a look at the next unit.

00:11:37

u Jens. So next unit we w


will be talking
g about quick
k wins. Of coourse, we hav
ve used
Thank you
also these
e tools ourse
elves

00:11:47

for our SA
AP Business Suite and al so for our SA
AP internal custom
c
codinng.

00:11:55

And we ha
ave also had
d a look at alll our compon
nents that we
e previously had.

00:12:02

We will sh
how you in th
he next unit q
quick wins. For
F example, the optimizeed ABAP Listt Viewer, the
e
artist also known as ALV
A with Integ
grated Data Access.

00:12:12

And we will
w also show
w you some o
other improve
ements. Stay
y tuned.

00:12:16

Thank you
u and bye-by
ye.

19
9

WEEK 2, UNIT 5
00:00:13

Hi and we
elcome back to the last un
nit of this we
eek.

00:00:17

Hope you are ready fo


or the quick w
wins.

00:00:19

how you thing


gs like the op
ptimized ALV
V or the artist also knownn as ALV with
h Integrated
We will sh
Data Acce
ess,

00:00:27

so a renew
wed ABAP List
L Viewer, a
and some oth
her improvem
ments. Jens, please startt.

00:00:32

Here we will
w start with the transparrent optimiza
ations and as
s you can se e on the slides...What?
The slide is empty.

00:00:43

e transparent optimizatio n, that's why


y the slide is empty. Just kidding a bitt.
That is the

00:00:48

Of course, we have sh
hown you tha
at diagram be
efore so we would
w
like too remind you of the
nt optimizatio
ons.
transparen

00:00:55

Remembe
er, we have told
t
you in th
he first week,, the ABAP 7.4
7 comes wiith transparent
optimizatio
on like table buffer enhan
ncement

00:01:04

in the data
abase interfa
ace and also the protocolls that the AB
BAP uses to talk to SAP HANA, so
with the underlying database.

00:01:14

a transpare
ent optimizattion. You don't have to do
o anything cooncerning co
oding, but
So these are
you will ho
opefully see that in perforrmance.

00:01:22

Okay. Let us now com


me to the reall reuse comp
ponents as is
s the title alreeady, the opttimized ALV

00:01:31

ad of talking about the the


eory of that renewed
r
ABA
AP List View
wer, let me just go to the
and instea
system an
nd convince you
y with a syystem demo.

00:01:44

For that, I go again to my ABAP D evelopment Tools in Eclipse and I haave prepared
d a tiny little
report

00:01:52

_ALV_IDA, standing
s
for IIntegrated Data Access, and as you ccan see therre is nothing
called ZR_
in there ye
et

00:02:01

As you do
on't want to see
s me typing
g and doing all of the typos, I have crreated a sma
all template
for you.

00:02:08

w ABAP Listt Viewer, or tthe renewed ABAP List Reviewer,


R
ca n be taken frrom that
So the new
class.

00:02:17

alling a create
e statement and that guy
y here could either be a D
Data Dictiona
ary table or
I'm just ca
a Dictiona
ary view

00:02:27

or those new
n
guys tha
at we will hea
ar about in th
he next week
k, something like Core Da
ata Services
views.

00:02:34

uned for thatt in the third w


week in the third
t
unit.
But stay tu

00:02:37

Okay, wha
at the ABAP List Viewer now comes with
w is full-sc
creen mode

00:02:47

so you do
on't have to use or create yourself dyn
npros and I would
w
like to display the data
d
at the
end.

00:02:55

eady. And jus


st execute the report.
Okay. Witth that, we arre already re

20
0

00:03:03

Let me en
nlarge that a bit and whatt you can see
e here is an ALV
A table

00:03:11

and there is a large am


mount of data
a in there. We
W have talke
ed about thatt already and
d typically
pens if you're
e selecting th
he data in the
e ALV,
what happ

00:03:22

you are se
electing everrything in the
e internal table. So alread
dy this launchhing takes qu
uite a while
with the old ALV.

00:03:28

ds if I now ju
ust scroll dow
wn here. You see that is pretty
p
responnsive and tha
at is
Same hold
because whatever
w
I do
o here,

00:03:38

like scrolling or let's sa


ay I would likke to use herre on the gros
ss amount, I would like to
o do a total,

00:03:47

erything that I am doing here


h
is produ
ucing a SQL
you don't see
s it
I sum thatt one up. Eve

00:03:54

issued the
e SAP HANA
A database. A
And it's that responsive
r
because
b
HAN
NA supports me with all
of the thin
ngs that I'm doing
d
here.

00:04:04

So for exa
ample, let me
e also do an aggregation on that one,

00:04:10

or I could filter on that, on the Com


mpany Name, or just do a Group By foor that customer name.

00:04:22

So, pretty responsive isn't it?

00:04:24

ool. The goo


od thing here
e is that you really
r
see the
e power of S
SQL and wha
at it does
Yes, it's co
with the Code
C
Pushdo
own paradigm
m.

00:04:33

So all calcculations are executed on


n the database using justt SQL statem
ments.

00:04:39

And the evven better th


hing is, you h
have not seen me typing any coding. T
use the ALV
That's becau
with integrrated data ac
ccess is prod
ducing those
e SQLs for me.

00:04:50

Okay, eno
ough of the demo.
d
Let me
e show you a little bit abo
out the technniques runnin
ng behind
the scene.

00:04:58

u can see, we
e have optim
mizations bec
cause the res
sult set is minnimized.
So as you

00:05:04

So you ha
ave seen this
s in performa
ance, but I ca
an also show
w you that in tthis little diag
gram. So
what typiccally happens
s with the cla
assical ALV,

00:05:12

you have your databas


se table, whiich is here th
he SAP HANA table on thhe database,, and the
A is getting everything
g into an interrnal table
classical ALV

00:05:22

and whate
ever you wou
uld like to dissplay later on
n is not filtere
ed before it ccomes from the
t
database to the applic
cation server , but on the application
a
server itself,

00:05:31

e or in the AB
BAP layer.
so on the level of the internal table

00:05:36

A or the new approach


h is that you only fetch the data into thhe applicatio
on layer that
The new ALV
you really need.

00:05:44

And that iss exactly app


plying the Co
ode-to-Data paradigm, as
s Jens has juust mentione
ed.

00:05:49

So we see
e improved performance.
p
educed mem
mory footprintt and there is
s no
. We see a re
truncation
n on selected
d data.

00:05:57

If you wou
uld like to kno
ow more abo
out that, just go the SCN link and yeaah, so that wa
as our ALV
with Integrated Data Access.
A
Is the
ere more, Je
ens?

00:06:06

e is more and
d I really like this demo. I love to work
k with the neew ALV. This is really fun
Yes, there
and it's co
ool, that's all.

21

00:06:16

Cool is the
e right word here. Okay, let's go to the next one.

00:06:20

So we've also improve


ed our search
ype-ahead fu
unction and ffree-text sea
arch
h help with ty

00:06:29

p directly into
o a demo. I will
w close dow
wn the ALV aand...
and also let's just jump

00:06:37

e not closing down the AL


LV. No? Just the report. Yes,
Y
okay. Itt's still there for you,
Oh we are
don't panic.

00:06:44

p
a litttle report alrready but with a little morre of coding aand this is ca
alled ZR...
I've also prepared

00:06:54

Okay, aga
ain I forgot ho
ow I named my own repo
ort but luckily
y we have it iin our package

00:07:04

and of cou
urse it's SEA
ARCH_HELP
P_DEMO. So
orry for that. And
A this repoort, let me jus
st execute
it.

00:07:11

aybe I chang
ged somethin
ng already. O
Okay, now yo
ou know
You have to activate itt first. Oh, ma
also it's Ctrl+F3,

00:07:19

AP GUI ,and
d now F8 works. And whaat I now have
e here is a
you know this probably from the SA
arch field wh
here I can typ
pe things.
simple sea

00:07:30

Normally, I would go and


a now clickk on Identifie
er and take, for example, or know the identifier of
c
SAP which is an our case

00:07:38

v
very...w
what you now
w have is exa
actly you already have soome information and
one and very,
type-ahea
ad information of an identtifier

00:07:49

and here we
w see the business
b
parttners and the
eir identifiers
s and also thee e-mail add
dress.

00:07:54

So let's just assume yo


ou totally forrgot that very
y short number of 1,000,0001 or sometthing like
u don't know
w...
that or you

00:08:03

I remembe
er that conta
act I had, wha
at was her na
ame? Sarah. So let's try it.

00:08:11

And you see


s here, ah here's Sarah
h. It was this company an
nd here I gott the identifie
er.

00:08:17

So this is a very cool thing


t
and it re
eally helps you
y working and
a getting thhe results ve
ery fast

00:08:22

ood thing is you


y don't havve code so much
m
for thatt.
and the go

00:08:26

It's really easy


e
to get that and the o
only thing yo
ou have to create is a seaarch help or just
j
improve
your existing search help.

00:08:35

e using that ssearch help and let me in


ncrease the ssize of it.
So in this case, we are

00:08:40

t
that you
u see here iss the Enhanc
ced Options. Here you caan select that you want
The new thing
the propossals for the input fields

00:08:48

and the fu
ull-text search
h and you ca
an specify an
n accuracy le
evel which is,, kind of, how
w fuzzy it
can get.

00:08:58

asically all. Yo
ou have the fields and th
hey are good to go and acctivated.
That is ba

00:09:06

That's all. The other good news is that this one


e is also available for the Web Dynpro
o with the
Floorplan Manager.

00:09:16

ome to an ex
xample, we a
also have in your
y
demo sy
ystem, is thaat you have also
a
the
If I now co
search he
elps available
e here, also w
with the new ALV grid.

00:09:25

You can play


p
around with
w it and he
ere it is the same game.

22
2

00:09:29

So remem
mber our Sara
ah? Here we
e go, here is Sarah. Is it? Yeah.

00:09:38

So that's for
f type-ahea
ad and searcch help. I hop
pe you like it.

00:09:44

Back to th
he slides. Here is also a l ink in the ma
aterial to the demo on youur remote de
esktop

00:09:52

and yeah,, that what ty


ype-ahead is all in. So you have the filter and searrch features

00:09:59

and the go
ood thing is we
w also delivver our new SAP
S
GUI fields and so onn with that ty
ype-ahead
feature, so
o for example when you go to the SE
E38

00:10:07

I still hope
e you will like
e the develop
pment tools more,
m
of course, but theree may be some of you
which sticck to their classical SE38.. Please com
me to the goo
od side.

00:10:18

There is also
a
search help
h
available
e now. Okay, and more in
nformation, oof course, in our SCN
space.

00:10:25

e material. G
Good.
Links are in the course

00:10:29

e the fault-tolerant searchh in the ALV,


Yeah, mayybe let me add, you can even include

00:10:34

not with th
he full screen
n mode and tthe display mode
m
I've sho
own you thhey have to do
d a little bit
more of th
he typing not just one line
e of coding

00:10:45

but you ca
an have exam
mples around
d in the ALV
V demo reporrts in the systtem.

00:10:52

Okay, and
d with that we
e would like to close the week. So yo
ou have learnned a lot abo
out
performan
nce analysis tools,

00:11:02

the static code checks


s, starting of course with the functiona
al correctnesss checks, bu
ut then we
erformance,
went to pe

00:11:09

all about performance


p
al as well as the
t runtime analysis.
a
Youu've learned about the
. The statica
SQL Moniitor and you have seen a
about the SW
WLT,

00:11:18

SWLT is the
t SQL Perfformance Tu
uning Worklis
st, which included the infoormation of the
t static
code checck and the SQ
QL Monitor rruntime data

00:11:26

on the SQ
QL profile of your
y
product ive system.

00:11:29

And last but


b not least, I hope you l iked the quic
ck wins that you
y can get w
with what we
e have
improved..

00:11:35

The transp
parent optim
mizations, the
e ALV, and also this very cool new feaature of type-ahead and
the fault-to
olerant searc
ch

00:11:44

in case yo
ou are doing a lot of typoss when you are
a using the
e product.

00:11:47

And with that,


t
we wish
h you luck forr the week 2 assignment now at this ttime and see
e you next
week.

00:11:56

y next wee
ek when it's a
all about opttimization and what we haave impleme
ented in our
Yes, see you
ABAP serrver.

00:12:02

Bye-bye.

23
3

www.sap.c
w
com

2014 SAP SE or an SA
AP affiliate company. All rights reserved.
No
N part of this publicationn may be reproduced or transmitted in any form
or
o for any purpose withouut the express permission of SAP SE or an SAP
affiliate
a
company.
SAP
S
and other SAP prodducts and services mentio
oned herein as well as th
heir
respective
r
logos are traddemarks or registered trademarks of SAP SE (or an
a
SAP
S
affiliate company) inn Germany and other cou
untries. Please see
http://www.sap.com/corp
h
porate-en/legal/copyright//index.epx#trademarkfo
or
additional
a
trademark infoormation and notices. Som
me software products
marketed
m
by SAP SE andd its distributors contain proprietary software
components
c
of other softtware vendors.
National
N
product specifica
cations may vary.
These
T
materials are provvided by SAP SE or an SAP
S
affiliate company for
informational purposes oonly, without representatio
on or warranty of any kin
nd,
and
a SAP SE or its affiliate
ted companies shall not be
b liable for errors or
omissions
o
with respect too the materials. The only warranties for SAP SE or
o
SAP
S
affiliate company prroducts and services are those that are set forth in
n
the
t express warranty stat
atements accompanying such
s
products and servicces,
if any. Nothing herein shoould be construed as con
nstituting an additional
warranty.
w
In particular, SAP SE or iits affiliated companies have
h
no obligation to purssue
any
a course of business ooutlined in this document or any related presentattion,
or
o to develop or release aany functionality mention
ned therein. This docume
ent,
or
o any related presentatioon, and SAP SEs or its affiliated
a
companies
strategy
s
and possible futu
ture developments, produ
ucts, and/or platform
directions
d
and functionaliity are all subject to chan
nge and may be changed
d by
SAP
S
SE or its affiliated ccompanies at any time fo
or any reason without nottice.
The
T information in this doocument is not a commitment, promise, or legal
material, code, or functio
obligation
o
to deliver any m
onality. All forward-looking
g
statements
s
are subject too various risks and uncerrtainties that could cause
e
actual
a
results to differ maaterially from expectation
ns. Readers are cautioned
not
n to place undue reliannce on these forward-look
king statements, which
speak
s
only as of their dattes, and they should not be relied upon in making
g
purchasing
p
decisions.

You might also like