method IF_SHM_BUILD_INSTANCE~BUILD.
data: lr_area TYPE REF TO ZCL_ROOT_SHMA_USE,
lr_root type REF TO ZCL_ROOT_SHMA,
lr_exp type REF TO cx_root.
try.
lr_area = ZCL_ROOT_SHMA_USE=>attach_for_write( ).
CATCH cx_shm_error INTO lr_exp.
RAISE EXCEPTION TYPE cx_shm_build_failed
EXPORTING
previous = lr_exp.
ENDTRY.
CREATE OBJECT lr_root AREA HANDLE lr_area.
lr_area->set_root( lr_root ).
lr_area->detach_commit( ).
endmethod.
Report A-
TRY.
zcl_root_shma_use=>build( ).
CATCH cx_shma_not_configured. “ SHM Administration: Area Property Is Not Configured
CATCH cx_shma_inconsistent. “ SHM Administration: Inconsistent Attribute Combination
CATCH cx_shm_build_failed. “ Constructor Run Failed
ENDTRY.
TRY.
DATA(lr_area) = zcl_root_shma_use=>attach_for_update(
* inst_name = cl_shm_area=>default_instance
* attach_mode = cl_shm_area=>attach_mode_default
* wait_time = 0
).
CATCH cx_shm_inconsistent. “ Different Definitions Between Program and Area
CATCH cx_shm_no_active_version. “ No active version exists for an attach
CATCH cx_shm_exclusive_lock_active. “ Instance Already Locked
CATCH cx_shm_version_limit_exceeded. “ No Additional Versions Available
CATCH cx_shm_change_lock_active. “ A write lock is already active
CATCH cx_shm_parameter_error. “ Passed parameter has incorrect value
CATCH cx_shm_pending_lock_removed. “ Shared Objects: Waiting Lock Was Deleted
ENDTRY.
DATA lr_root TYPE REF TO zcl_root_shma.
TRY.
lr_root ?= lr_area->get_root( ).
CATCH cx_shm_already_detached.
ENDTRY.
DATA wa_kunnr TYPE range_vbeln.
DATA gt_kunnr TYPE TABLE OF range_vbeln.
wa_kunnr-sign = ‘I’.
wa_kunnr-option = ‘EQ’.
wa_kunnr-low = ‘12345’.
wa_kunnr-high = ‘9009000’.
APPEND wa_kunnr TO gt_kunnr.
lr_root->lt_kunnr = gt_kunnr.
lr_area->set_root( lr_root ).
lr_area->detach_commit( ).
Report B-
TRY.
DATA(lr_area) = zcl_root_shma_use=>attach_for_read( ).
CATCH cx_shm_inconsistent. " Different Definitions Between Program and Area
CATCH cx_shm_no_active_version. " No active version exists for an attach
CATCH cx_shm_read_lock_active. " Request for a Second Read Lock
CATCH cx_shm_exclusive_lock_active. " Instance Already Locked
CATCH cx_shm_parameter_error. " Incorrect parameter passed
CATCH cx_shm_change_lock_active. " A Change Lock Is Already Active
ENDTRY.
DATA LR_ROOT TYPE REF TO zcl_root_shma.
TRY.
LR_ROOT ?= LR_AREA->get_root( ).
CATCH cx_shm_already_detached. " Handle Already Released
ENDTRY.
DATA GT_kunnr type TABLE OF RANGE_VBELN.
GT_kunnr = LR_ROOT->lt_kunnr.
LR_AREA->detach_area( ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
9 | |
8 | |
6 | |
5 | |
4 | |
4 | |
4 | |
3 | |
3 | |
3 |