Passing an object instance to a function module

de Valensart Schoenmaeckers, Patrick Patrick.DeValensartSchoenmaeckers at pmintl.com
Fri Jun 4 12:26:11 EDT 2004


Hi fellow workflowers.
 
I am currently writing a function module that will be called from various
object methods, to which I need to pass the object instance of the calling
method.
I have done it the following way:
 
In the method:
DATA: objtype TYPE swo_objtyp,
           objkey TYPE swo_typeid.
...
SWC_GET_OBJECT_TYPE self objtype.
MOVE object-key TO objkey.
 
Then I call my function module passing objtype and objkey as import
parameters and instantiate a new object there with:
DATA: object TYPE swc_object.
...
SWC_CREATE_OBJECT object objtype objkey.
 
But I was now wondering whether:
1. Will this work (not yet possible to get data to allow me trying this in
my brand new dev system)?
2. Is this the most clever, efficient, etc. way to do it? I first thought
about doing it with macros SWC_OBJECT_TO_PERSISTENT and
SWC_OBJECT_ROM_PERSISTENT, but at some stage I go confused with this
persistent versus runtime thing and just gave up... :-(
 
Thanks in advance for the feedback!
 
Patrick de Valensart
Project SWISS - FRICEW Team
Philip Morris International Management S.A.
 


More information about the SAP-WUG mailing list