Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Shared Objects: How to store and read multiple instances

Former Member
0 Likes
753

Hi,

Can we store multiple instances of Shared Objects in memory and read the desired instance.

e.g

If i execute the below program twice then also it will create only a single instance in the memory.

Can we create a memory object with a key and then read the instance with the object with key

data: handle type ref to ZCL_SHM_AREA_XX,

      root   type ref to ZCL_SHM_AREA_ROOT_XX.

handle = ZCL_SHM_AREA_XX=>attach_for_write( ).

create object root AREA HANDLE handle.

handle->set_root( root ).

handle->detach_commit( ).

Hi,

Can we store multiple instances of Shared Objects in memory and read the desired instance.

e.g

If i execute the below program twice then also it will create only a single instance in the memory.

Can we create a memory object with a key and then read the instance with the object with key

data: handle type ref to ZCL_SHM_AREA_XX,

      root   type ref to ZCL_SHM_AREA_ROOT_XX.

handle = ZCL_SHM_AREA_XX=>attach_for_write( ).

create object root AREA HANDLE handle.

handle->set_root( root ).

handle->detach_commit( ).

1 REPLY 1
Read only

Former Member
0 Likes
523

Hi Patrick,

When calling attach_for_write you can pass "inst_name" parameter this will create a unique instance

When reading again you can give the same "inst_name".

Regards