Ansicht
Dokumentation

ABENSHM_AREA_INSTANCE_HANDLE - SHM AREA INSTANCE HANDLE

ABENSHM_AREA_INSTANCE_HANDLE - SHM AREA INSTANCE HANDLE

Vendor Master (General Section)   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.
SAP E-Book

- Area Handles

Creating Area Handles

Area handles are instances of the area class of an area. An individual area handle is created using one of the following static methods from the area class, whereby an associated area lock is set:

There is also the method MULTI_ATTACH to create multiple area handles at once. These methods return a reference to a created area handle. Each area handle is bound to exactly one area instance version. This area instance version has a certain state, depending on the method used.

Binding an area handle to an area instance version is equivalent to setting one of the following area locks on the area instance:

Creating Area Instance Versions

The method ATTACH_FOR_WRITE creates a new area instance version if existing locks allow it. By specifying a name, different area instances of an area can be created with their own versioning each. If no name is specified, the content of constant CL_SHM_AREA=>DEFAULT_INSTANCE is used as the default value. It is recommended that explicit and unique names are always used. Until the binding is removed, the bound area instance version can be accessed for changes in the current internal session.

Changing Area Instance Versions

The method ATTACH_FOR_UPDATE does one of the following, if existing locks allow it:

  • In areas with versioning, it creates a new version as a copy of the active area instance version.
  • In areas without versioning, it binds the area handle to an existing active area instance version.

When a name is specified, an area instance is selected. If no name is specified, the content of the constant CL_SHM_AREA=>DEFAULT_INSTANCE is used as the default value. Until the binding is removed, the bound area instance version can be accessed for changes in the current internal session.

Reading Area Instance Versions

The method ATTACH_FOR_READ binds the area handle to an existing area instance version if existing locks allow it. When a name is specified, an area instance is selected. If no name is specified, the content of the constant CL_SHM_AREA=>DEFAULT_INSTANCE is used as the default value. Until the binding is removed, the bound area instance version can be accessed for reads in the current internal session.

Detaching Area Handles

The following instance methods of the area class remove the binding of an individual area handle:

  • DETACH_COMMIT removes a change lock and confirms the changes that were made.
  • DETACH_ROLLBACK removes a change lock without confirming the changes that were made.

In addition, there are the static methods, DETACH_AREA and DETACH_ALL_AREAS, are used to remove multiple bindings at once. Once the binding between an area handle and the area instance version is removed, the area handle is inactive and can no longer be used. Removing a binding also removes the corresponding area lock and might change the state of the relevant area instance version.

Additional Methods

The methods of the area handles mentioned above are normally used when working with shared objects. There are also additional methods also exist for special applications. Transaction SHMM provides a program-independent user interface for such methods.

  • Invalidating versions
The methods INVALIDATE_INSTANCE or INVALIDATE_AREA can be used to set one or more active area instance versions to "obsolete". This prevents new read locks from being set for this version, while existing read locks are retained.
  • Deleting versions
The methods FREE_INSTANCE or FREE_AREA can be used to set one or more active or obsolete area instance versions to "expired". This removes all read locks and no new read locks can be set on these versions.
  • Information about area instances
The method GET_INSTANCE_INFOS returns information about all area instances of an in an internal table.
  • Information about area handles
The methods GET_LOCK_KIND, IS_VALID, IS_ACTIVE_VERSION, IS_SHARED, HAS_ACTIVE_PROPERTIES, and GET_DETACH_INFO return information about locks and the state of an area handle.
  • Explicit call of the area constructor
The method BUILD can be used to call the area constructor of an area explicitly in the current internal session. This method is a standardized mechanism for building area instances.





SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up   Vendor Master (General Section)  
This documentation is copyright by SAP AG.

Length: 7655 Date: 20240426 Time: 050718     sap01-206 ( 106 ms )