‎2010 Mar 22 9:52 AM
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
‎2010 Mar 22 11:23 PM
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)
‎2010 Mar 22 2:09 PM
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
‎2010 Mar 22 10:47 PM
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
‎2010 Mar 22 11:23 PM
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)
‎2010 Mar 23 9:03 AM