‎2007 Jun 13 2:27 PM
Hi all,
i have to save an instance in memory because i need the information later.
The Programm goes like this:
1) Get instance1
2) call sap-classes and methods
3) create instance2
4) Call function to show instance2
5) Start BDT functions. And at this point i loose my information about instance1
how can i write the instance1 into "global memory" for accessing all data all the time?
Thanks
stefan
‎2007 Jun 13 2:32 PM
Have you heard about Shared Memory Objects? This is a new concept implemented in NetWeaver 2004, and enhanced in NetWeaver 7.0. It is pretty straight forward to use and really powerful.
http://help.sap.com/saphelp_nw2004s/helpdata/en/14/dafc3e9d3b6927e10000000a114084/frameset.htm
Regards,
Rich Heilman
‎2007 Jun 14 7:15 AM
Hi,
that sounds good but i don't define classes i only use the sap classes to create instances. and i want the instance to stay reachable via memory or as a global durably instance that exists in the SAP methods, functions and untill the end of my programm.
Thank you
Stefan
‎2007 Jun 14 7:25 AM
Hi Stefan,
I think you are not using BDT, so this will not help.
Thanks and warm regards,
Smita.
‎2007 Jun 14 7:30 AM
Hi Smitha,
Yes and no. I don't use BDT but i call a sap function that starts the BDT and i need my instance at DSAVE. After store the obejct i return to my programm.
But then it's too late
Thanks for your help
Stefan
‎2007 Jun 13 2:37 PM
Hi,
Is you application using BDT? If yes, then you can use BDT_INSTANCE_SELECT with pop option. You can use push and pop to push one instance and pop other one.
Thanks and warm regards,
Smita.
‎2007 Jun 14 8:13 AM
Stefan,
I think what you can try is to serialize the instance to write it to a string in XML format and export/import this string and deserialize.
I never tried, but this approach should work.
Check these blogs:
/people/tobias.trapp/blog/2006/10/06/xml-processing-in-abap-part-9-150-abap-processing-using-xslt
/people/patrick.baer/blog/2005/03/01/abap-serialization--part-ii-serialization-of-arbitrary-data
/people/thomas.jung3/blog/2005/04/21/webservice-navigator-page-for-abap-and-java
Best regards,
Peter
Message was edited by:
Peter Inotai
‎2007 Jun 14 9:03 AM
Hi Stefan,
If you want to save an instance of a class in memory, you can use persistent classes.
Generally ABAP programs work with data and objects that are valid at
runtime. They are transient i.e. temporary and disappear when program ends.
To store this data permanently and independently of the program context,
i.e. persistently, it must be stored in the database. This means instances of
global classes can be written to database tables.
Persistent Services in ABAP Objects can be used to write the current attribute
values of objects defined as persistent to associated transparent tables.
On request, these values can be imported from the tables and assigned to an
object previously defined as persistent.
To use persistent services for objects, their types must be created as
persistent classes in Class Builder.
Send me your mail ID so that I can pass you a document on creation of persistent classes.
Award points if found useful.
Regards
Indrajit.
‎2007 Jun 15 7:41 AM
the following statement just worked fine
EXPORT P_DATUM to MEMORY id 'G_DATUM'.
Later in other coding:
IMPORT ...from memory id
Thanks all