Sie sind auf Seite 1von 22

ABAP Shared Objects

25th June 2014

Copyright 2013 Accenture All Rights Reserved. Accenture, its logo, and Accenture High Performance Delivered are trademarks of Accenture.

Todays Agenda
As a result of this session, you will be able to:

Understand the concepts of ABAP Shared Objects


Decide when (not) to use ABAP Shared Objects
Define shared memory areas
Store data in shared memory areas
Access data in shared memory areas
Adapt shared memory areas for your needs
Monitor shared memory areas

Copyright 2013 Accenture All Rights Reserved.

What is Shared Memory ?


The shared memory is a memory area on an application server,
which is accessed by all of this servers ABAP programs. Before
shared objects were implemented, ABAP programs could access
this memory area using the EXPORT and IMPORT statements
exclusively with the SHARED BUFFER or SHARED MEMORY
additions, and instances of classes or anonymous data objects
existed exclusively in the internal session of an ABAP program.
With the implementation of shared objects with Release 6.40, the
shared memory was enhanced with the shared objects memory
that stores shared objects.

Accenture 2013. All Rights Reserved.

What is Shared Memory ?


Different kinds of main memory on an application server
Session Memory
Bound to a single user session
Cannot be accessed by a different user session
Guarantees user isolation

Shared Memory (SHM)


Shared across session boundaries
No user isolation
Requires access control in a business application context

Application development has longed for buffering data in shared memory for
a long time

Accenture 2013. All Rights Reserved.

Data Access without Buffering

Copyright 2013 Accenture All Rights Reserved.

Data Access with Buffering by Copy

SAP ILM

Copyright 2013 Accenture All Rights Reserved.

Data Access with in Place Buffering

Copyright 2013 Accenture All Rights Reserved.

Benefits for Application Programming


Significant boost in overall performance due to
Reduced memory consumption
Data is kept only once in memory

SAP DART

Reduced runtime costs


Data is aggregated only once
Fast access at main memory speed
In place aggregation for arbitrary data structures including strings, internal tables,
SAP BW
and references
Extract

Reduced
maintenance
costs due to
Informational
Transform
datamodel
for allin contrast to solutions based on IMPORT / EXPORT
Load programming
Simplified
reporting needs

Workbench navigation

Data is aggregated only once


Ported to ABAP Shared Objects
Saves 3 MB session memory per user
About 100 times faster at first access

Copyright 2013 Accenture All Rights Reserved.

Areas and Area Instances

SAP DART

An area is the template for area instances in the shared memory.


Several area instances can be created from one area instance,
differing from each other in name. Moreover, there can be several
versions of an area instance (area instance versions), which differ
from each other by a version
SAP BW identifier. All area instance versions of
the sameExtract
area instance
name make up an area instance. In the
Informational
Transform
simplest case
(without
versioning),
an area instance consists of a
data
for all
Load
needs
single area instancereporting
version.

Copyright 2013 Accenture All Rights Reserved.

Areas and Area Instances


Shared object memory
Part of the shared memory
Customizable by profile parameter
Shared object areas
Organizational units (type)
Defined at design time
Identified by unique name
Shared object area instances
Content stored at runtime
Unique name within the area
Single-instance area addressed by
default name
Copyright 2013 Accenture All Rights Reserved.

10

Area Classes and Area Handles


When an area is defined in Transaction SHMA, a global and final area
class with the same name is generated as a subclass of
CL_SHM_AREA. Class CL_SHM_AREA itself is a direct subclass of
CL_ABAP_MEMORY_AREA.
In an ABAP program, an area is accessed exclusively using the
methods of the generated area class. There are static methods for
binding an ABAP program (or its internal session) to area instances in
the shared memory (attach methods).
Binding creates an instance of the area class as an area handle, and
creates a lock at the same time. The ABAP program can access the
bound area instance version using the area handle and thus access the
shared objects that are stored there. The area handle also contains the
methods for deleting the connection or the lock (detach methods).

Copyright 2013 Accenture All Rights Reserved.

11

Area Instances and Objects

Copyright 2013 Accenture All Rights Reserved.

12

Design Time Support

Copyright 2013 Accenture All Rights Reserved.

13

Definition of a Shared Memory Area

Copyright 2013 Accenture All Rights Reserved.

14

Abstract Area Class

Copyright 2013 Accenture All Rights Reserved.

15

Drivers Locking Concept

Copyright 2013 Accenture All Rights Reserved.

16

Attaching to an Area Instance

Define

Copyright 2013 Accenture All Rights Reserved.

17

Example: Write Access

Copyright 2013 Accenture All Rights Reserved.

18

Detaching from an Area Instance

Copyright 2013 Accenture All Rights Reserved.

19

Example: Detach from Write Access

Copyright 2013 Accenture All Rights Reserved.

20

Shared Objects Area Monitor

Copyright 2013 Accenture All Rights Reserved.

21

Questions?

Q&A

Copyright 2013 Accenture All Rights Reserved.

22

Das könnte Ihnen auch gefallen