SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation → ABAP Programming Guidelines → Architecture → Data Storage →Using Shared Objects
Background
Access to shared objects is regulated by lock mechanisms. The individual locks are stored as administrative information with the area instances in the shared memory and are set and evaluated when they are accessed using area handles.
Rule
Shared buffer and exclusive buffer are suitable application scenarios for shared objects.
The access to shared objects should be wrapped in loader and broker classes.
Details
How locks work depends on how shared objects are used as follows:
General shared memory programming is not possible. The current lock logic does not enable you to set specific locks for the following requirements:
Although the lock logic makes the first two points technically possible, they are not practical because most accesses would be rejected.
Wrapping
It is recommended that application programs do not access the shared objects memory directly. Instead (read) accesses to the shared objects should be wrapped in a wrapping class, whose methods are accessed by the individual programs. The area constructor class can be used as the wrapping class, for example.
Wrapping has the following advantages: