This website is not affiliated with, sponsored by, or approved by SAP AG.

Shared Objects Wrapper

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Shared Objects Wrapper

Postby chris55 » Mon Feb 01, 2016 12:18 pm

Any shared objects experts out there?

I want to wrap up the various stages of shared objects management into a generic method. So the method would have the following components:

Code: Select all
* obtain area handle and write lock
CALL METHOD AREA=>ATTACH_FOR_WRITE
        EXPORTING INST_NAME = INST_NAME
        RECEIVING HANDLE    = OB_HANDLE.

* link root class to area handle
CREATE OBJECT OB_ROOT AREA HANDLE OB_HANDLE.

* link area instance to root class object
CALL METHOD OB_HANDLE->SET_ROOT
        EXPORTING ROOT = OB_ROOT.


The instance name, area class name and root class name would be passed into the method, and it would return a handle to OB_ROOT. I just can't get it to work. A lots of problems with typing etc. Any suggestions?

Thanks,
Chris.
chris55
 
Posts: 274
Joined: Wed Apr 02, 2003 8:29 am
Location: England, Middlesbrough

Re: Shared Objects Wrapper

Postby Gothmog » Wed Feb 03, 2016 4:46 am

I don't think there's a common superclass or interface to the various OB_ROOT classes - you'll have to be very generic in the method parameter definition (TYPE REF TO OBJECT) to return the reference.
What typing problems are you encountering exactly?
68 74 74 70 3a 2f 2f 74 69 6e 79 75 72 6c 2e 63 6f 6d 2f 62 64 6f 37 6d 77 67
Gothmog
 
Posts: 1941
Joined: Wed Sep 12, 2007 4:46 am
Location: Probably not home

Re: Shared Objects Wrapper

Postby chris55 » Thu Feb 04, 2016 5:31 am

Hi Gothmog,

I used the TYPE REF to OBJECT for typing the formal parameters, but the basic problem is the AREA HANDLE specification in the CREATE OBJECT statement. The AH reference must be a class that is Shared Memory-Enabled, and you can't use a dynamic specification, so without a great deal of messing about and convoluted code it - downcast operators and all sorts of stuff - it seems very difficult to accomplish. This defeats the object of trying to simplify the whole thing. Reluctantly, I've had to give up on it. Thanks for your thoughts on it.
chris55
 
Posts: 274
Joined: Wed Apr 02, 2003 8:29 am
Location: England, Middlesbrough

Re: Shared Objects Wrapper

Postby chris55 » Mon Feb 22, 2016 7:03 am

As a follow-up to the subject of shared objects: they are application server specific. Has anyone had any experience of shared memory in a multi-server system? There's something about "propagating" shared memory across servers in some discussion boards but nothing is explained. What are the implications of a multi-server environment?

Thanks,
Chris.
chris55
 
Posts: 274
Joined: Wed Apr 02, 2003 8:29 am
Location: England, Middlesbrough


Return to ABAP

Who is online

Users browsing this forum: Google Adsense [Bot] and 12 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.