Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

store an object into database table without using persistence class

Former Member
0 Likes
1,378

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
935

Hi Karthik,

Check SHMA shared memory access.

You can download the document...

http://www.google.co.in/url?sa=t&rct=j&q=sdn%20shma&source=web&cd=2&cad=rja&ved=0CDMQFjAB&url=http%3...

5 REPLIES 5
Read only

Former Member
0 Likes
936

Hi Karthik,

Check SHMA shared memory access.

You can download the document...

http://www.google.co.in/url?sa=t&rct=j&q=sdn%20shma&source=web&cd=2&cad=rja&ved=0CDMQFjAB&url=http%3...

Read only

0 Likes
935

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

Read only

0 Likes
935

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.

Read only

former_member219762
Contributor
0 Likes
935

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.

Read only

Former Member
0 Likes
935

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