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 "cx_shm_external_reference" exception

florian_halder
Participant
0 Likes
1,341

Hi all,

i need to store an external reference in a shared object. I have a method of the class A which has a reference as import parameter. Is it possible to store this reference in a stored object so that i have access to this reference from another class B?

With the following code i get the "cx_shm_external_reference" exception, when calling detach_commit() method.

DATA: lo_handle TYPE REF TO zcl_server_shared_obj,
        lo_root TYPE REF TO zcl_server_shared_obj_root.

  TRY.
      lo_handle = zcl_server_shared_obj=>attach_for_write( ).
      CREATE OBJECT lo_root AREA HANDLE lo_handle.
      lo_handle->set_root( lo_root ).

      lo_root->go_server = io_server.

      CALL METHOD lo_handle->detach_commit.

    CATCH cx_shm_exclusive_lock_active
      cx_shm_version_limit_exceeded
      cx_shm_change_lock_active
      cx_shm_parameter_error
      cx_shm_pending_lock_removed

      cx_shm_wrong_handle
      cx_shm_already_detached
      cx_shm_secondary_commit
      cx_shm_event_execution_failed
      cx_shm_external_reference
      cx_shm_completion_error
      .

  ENDTRY.

Thanks, Florian

Edited by: Florian Halder on Jun 4, 2009 1:26 PM

1 ACCEPTED SOLUTION
Read only

GrahamRobbo
SAP Mentor
SAP Mentor
866

Shared objects have to be self-contained. You cannot have references that point outside the shared object.

Cheers

Graham Robbo

1 REPLY 1
Read only

GrahamRobbo
SAP Mentor
SAP Mentor
867

Shared objects have to be self-contained. You cannot have references that point outside the shared object.

Cheers

Graham Robbo