Container Persistence

Kjetil Kilhavn KJETILK at statoil.com
Tue Aug 30 05:38:58 EDT 2005


I think (but am not sure) it is correct to say that you need the
conversion if you create your own program to manipulate object
references, be it inserting object references in a container or reading
object references from a container.

You can only call object methods and access object attributes with
runtime objects. When you create an object in your own program you get a
runtime object. To add that object reference in a table (e.g.
SWW_CONTOB) you must first convert it to a persistent reference.
Likewise, a generic and quick way to create a runtime object from an
object reference is to convert it from a persistent to a runtime
reference. 

Another example is if you want to call e.g. function module
SAP_WAPI_WORKITEMS_TO_OBJECT - the object type and object key are from
the persistent object reference. You can either "convert by hand" the
key, or you can create the runtime object and convert the reference. The
latter is not easier, but it makes it easier to discover copy&paste
errors caused by someone (not you or me of course) forgetting to change
the key definition when they copy the program to use it for another
object type.
-- 
Kjetil Kilhavn, Statoil KTJ IT BKS   -   who appreciates it if you
delete company disclaimers when you reply to this message


-----Original Message-----
From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
Of Mark Pyc
Sent: 30. august 2005 10:59
To: SAP Workflow Users' Group
Subject: Re: Container Persistence

G'day Alon,

You don't need to use them too often at all. I've done it productively
maybe twice?? If you debug you can see if the container is persistent or
not. Persistent means it's in a state ready to be stored in the DB, so
objects are listed with Object Type and Key. When it's in runtime mode
objects will have an instance ID rather than a key.

There is only one place that I did it (receiver type FM or maybe the
Change Doc object key adjustment FM) and it was in an older release.
Basically you needed to convert from Persistent to Runtime, fiddle the
contents and then convert back to Persistent.

Have fun,
Mark

  

On 8/30/05, Alon Raskin <araskin at 3i-consulting.com> wrote:
> Hi Everyone,
> 
> I was wondering if anyone has any experience with the container 
> persistence macros. I have seen them used in Alternate Binding FMs but

> never truly understood when is the right time to use them. And in 
> which direction I should be converting (ie. To runtime or to
persistent).
> 
> I would appreciate anyone's input....
> 
> Alon


-------------------------------------------------------------------
The information contained in this message may be CONFIDENTIAL and is
intended for the addressee only. Any unauthorised use, dissemination of the
information or copying of this message is prohibited. If you are not the
addressee, please notify the sender immediately by return e-mail and delete
this message.
Thank you.



More information about the SAP-WUG mailing list