2013 Jun 17 11:40 AM
Hi,
I have a z class with some attributes and methods. I created an object to the class and now I want to store this object into database for future use. I mean, I want to dump the object that is in heap memory to database table as it is. and want to retrieve it whenever required with the help of a GUID or a unique identifier that I insert along with object. I am using a relational database.
I understand that I can do it with the help of persistent class but for that I will have to create so many custom tables, views etc., and also map.
want to hear from experts if there is any other alternative to do the same, just as we store a variety files in db by dumping them into index type tables by using export/import.?
Thanks & Regards,
Karthik
2013 Jun 17 1:25 PM
Hi Karthik,
Check SHMA shared memory access.
You can download the document...
2013 Jun 17 1:25 PM
Hi Karthik,
Check SHMA shared memory access.
You can download the document...
2013 Jun 17 6:16 PM
Hi Yakub,
Thanks for your response. using this shared memory concept, The shared memory object now “lives” in SAP memory, and will remain there until the SAP instance goes down. But my objective is to store the object persistently. even when the server is restarted etc..,
In java, we can convert an object to bytearray using serialization and insert that byte array into database table. Using de-serialization, we can reconstruct the object. I want to know if we have any such feasibility in SAP to do the same.
Thanks & Regards,
Karthik
2013 Jun 18 1:55 PM
Hi Karthik,
Sorry it took a little long on how to achieve your requirement here it is with code.
http://scn.sap.com/thread/876355
The thread discusses your exact requirement.
you can convert an instance into XML and store it and retrieve it again.
Cheers.
2013 Jun 17 6:34 PM
Hi Karthik,
All good aspects of java are including in sap .I hope this will help you
http://help.sap.com/abapdocu_70/en/ABAPCALL_TRANSFORMATION.htm
http://scn.sap.com/people/patrick.baer/blog/2005/02/24/abap-serialization--part-i-quick-n-easy
Regards,
Sreenivas.
2013 Jun 18 6:25 PM
Hi Yakub and Sreenivas,
Even I thought of doing the same. i.e., to convert object data to xml and then dump it into database.
And yes, I got my answer. Thank you.
Regards,
Karthik