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 object in Database

Former Member
0 Likes
716

Hi All,

Was wondering if its possible to store an object of data type any in a database field?? And if so how?

Thanks David

1 ACCEPTED SOLUTION
Read only

Sandra_Rossi
Active Contributor
0 Likes
667

Or simply use ABAP statement CALL TRANSFORMATION 'ID' to transform variable to XML, or XML to variable (and define database field as STRING, to contain the XML string)

4 REPLIES 4
Read only

Former Member
0 Likes
667

Hi David,

You should take a look at how to persist classes in ABAP OO - SAP Help -> [The Persistence Service|http://help.sap.com/saphelp_nw04/helpdata/EN/f5/a36828bc6911d4b2e80050dadfb92b/frameset.htm].

Edited by: Ferenc Peter on Mar 22, 2010 3:09 PM

Read only

mvoros
Active Contributor
0 Likes
667

Hi,

I am not sure what exactly you need. But if you want to be able to store a field of any type in DB then one way how to do it is to use XML. I use it in one of my tools and it works fine. Basically, I have a simple table with fields KEY and CONTENT. The field CONTENT has type STIRNG. There are two standard XSLTs: CONVERT_XML_INT_TO_EXT and CONVERT_XML_EXT_TO_INT. They convert data in any type to XML and back. It does not work for objects. Actually, it does not dump and it generates a valid XML but you can't use it for serialization/deserialization of objects.

Cheers

Read only

Sandra_Rossi
Active Contributor
0 Likes
668

Or simply use ABAP statement CALL TRANSFORMATION 'ID' to transform variable to XML, or XML to variable (and define database field as STRING, to contain the XML string)

Read only

Former Member
0 Likes
667

Exactly what i was looking for Sandra.

Thanks David