ABAP Shared Objects

download ABAP Shared Objects

of 22

Transcript of ABAP Shared Objects

  • 8/18/2019 ABAP Shared Objects

    1/22

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

    ABAP Shared Objects 25 th June 2014

  • 8/18/2019 ABAP Shared Objects

    2/22

    2

    Today’s 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.

  • 8/18/2019 ABAP Shared Objects

    3/22

    3© Accenture 2013. 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 server’s ABAP programs. Beforeshared objects were implemented, ABAP programs could accessthis memory area using the EXPORT and IMPORT statements

    exclusively with the SHARED BUFFER or SHARED MEMORYadditions, and instances of classes or anonymous data objectsexisted exclusively in the internal session of an ABAP program.

    • With the implementation of shared objects with Release 6.40, theshared memory was enhanced with the shared objects memorythat stores shared objects.

  • 8/18/2019 ABAP Shared Objects

    4/22

    4© 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 sessionGuarantees 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 fora long time

  • 8/18/2019 ABAP Shared Objects

    5/22

    5

    Data Access without Buffering

    Copyright © 2013 Accenture All Rights Reserved.

  • 8/18/2019 ABAP Shared Objects

    6/22

    6

    SAP ILM

    Data Access with Buffering by Copy

    Copyright © 2013 Accenture All Rights Reserved.

  • 8/18/2019 ABAP Shared Objects

    7/227

    Data Access with in Place Buffering

    Copyright © 2013 Accenture All Rights Reserved.

  • 8/18/2019 ABAP Shared Objects

    8/228

    SAP BW

    Informat ionaldata for al l

    repor t ing needs

    ExtractTransform

    Load

    SAP DART

    Significant boost in overall performance due toReduced memory consumption

    Data is kept only once in memory

    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,and references

    Reduced maintenance costs due to Simplified programming model in contrast to solutions based on IMPORT / EXPORT

    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

    Benefits for Application Programming

    Copyright © 2013 Accenture All Rights Reserved.

  • 8/18/2019 ABAP Shared Objects

    9/229

    SAP BW

    Informat ionaldata for al l

    repor t ing needs

    ExtractTransform

    Load

    SAP DARTAn 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 severalversions of an area instance (area instance versions), which differfrom each other by a version identifier. All area instance versions ofthe same area instance name make up an area instance. In thesimplest case (without versioning), an area instance consists of a

    single area instance version.

    Areas and Area Instances

    Copyright © 2013 Accenture All Rights Reserved.

  • 8/18/2019 ABAP Shared Objects

    10/2210

    Areas and Area Instances

    Copyright © 2013 Accenture All Rights Reserved.

    Shared object memoryPart of the shared memoryCustomizable by profile parameter

    Shared object areasOrganizational units (type)Defined at design timeIdentified by unique name

    Shared object area instances

    Content stored at runtimeUnique name within the areaSingle-instance area addressed bydefault name

  • 8/18/2019 ABAP Shared Objects

    11/2211

    Area Classes and Area Handles

    Copyright © 2013 Accenture All Rights Reserved.

    When an area is defined in Transaction SHMA , a global and final areaclass with the same name is generated as a subclass ofCL_SHM_AREA. Class CL_SHM_AREA itself is a direct subclass ofCL_ABAP_MEMORY_AREA.

    In an ABAP program, an area is accessed exclusively using themethods of the generated area class. There are static methods forbinding an ABAP program (or its internal session) to area instances inthe 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 thebound area instance version using the area handle and thus access theshared objects that are stored there. The area handle also contains themethods for deleting the connection or the lock (detach methods).

    http://help.sap.com/saphelp_nw04s/helpdata/en/13/dc853f11ed0617e10000000a114084/content.htmhttp://help.sap.com/saphelp_nw04s/helpdata/en/13/dc853f11ed0617e10000000a114084/content.htm

  • 8/18/2019 ABAP Shared Objects

    12/2212

    Area Instances and Objects

    Copyright © 2013 Accenture All Rights Reserved.

  • 8/18/2019 ABAP Shared Objects

    13/22

    Design Time Support

    13Copyright © 2013 Accenture All Rights Reserved.

  • 8/18/2019 ABAP Shared Objects

    14/2214

    Definition of a Shared Memory Area

    Copyright © 2013 Accenture All Rights Reserved.

  • 8/18/2019 ABAP Shared Objects

    15/2215

    Abstract Area Class

    Copyright © 2013 Accenture All Rights Reserved.

  • 8/18/2019 ABAP Shared Objects

    16/2216

    Drivers Locking Concept

    Copyright © 2013 Accenture All Rights Reserved.

  • 8/18/2019 ABAP Shared Objects

    17/22

    17

    Attaching to an Area Instance

    Copyright © 2013 Accenture All Rights Reserved.

    Define

  • 8/18/2019 ABAP Shared Objects

    18/22

    18

    Example: Write Access

    Copyright © 2013 Accenture All Rights Reserved.

  • 8/18/2019 ABAP Shared Objects

    19/22

    19

    Detaching from an Area Instance

    Copyright © 2013 Accenture All Rights Reserved.

  • 8/18/2019 ABAP Shared Objects

    20/22

    Example: Detach from Write Access

    20Copyright © 2013 Accenture All Rights Reserved.

  • 8/18/2019 ABAP Shared Objects

    21/22

    21Copyright © 2013 Accenture All Rights Reserved.

    Shared Objects Area Monitor

  • 8/18/2019 ABAP Shared Objects

    22/22

    Questions?

    Q&A

    22Copyright © 2013 Accenture All Rights Reserved