‎2009 Oct 06 2:10 PM
Hi,
so, it's not possible to use REF TO DATA in a database table, which's logical.
However, I'd like to save data generically. I heart of the possibility to use the description classes (abap_struct_descr etc.) to create a raw string or something, which can be saved in a database table. With this string, you can later recreate the structure/table/class/...
So, I searched for something like this about an hour now and I don't know how I can achieve, what I want.
Does anybody have an idea or a good link or something?
Thanks a lot in advance!
Kind Regards,
Michael
‎2009 Oct 06 2:16 PM
Hai,
You save generic data in the database table if the field type is RAW.
Check it.
Regards,
Venkat
‎2009 Oct 06 2:16 PM
Hai,
You save generic data in the database table if the field type is RAW.
Check it.
Regards,
Venkat
‎2009 Oct 06 2:17 PM
Ok, thanks, and how can I create RAW-data in my program out of a table, a structure or something then? I didn't find a proper method in the descriptor classes.
Thanks so far
‎2009 Oct 06 2:20 PM
You can use the EXPORT / IMPORT with database for generic purpose. Table INDX has the field type LRAW which saves your data. When ever you want to get back the data you can use the IMPORT. You need to make sure, your structure remains same while Export and Import other wise, IMPORT would fail.
Like:
EXPORT tab = itab
TO DATABASE indx(XY)
FROM wa_indx
CLIENT cl
ID 'TABLE'.
Regards,
Naimesh Patel
‎2009 Oct 06 2:28 PM
Hi,
ok, I looked that up. But it seems that I had to create a new table with some attributes. I heart of another way (like serializing an object to a RAW which can be inserted in just one field of my own table). I think, the EXPORT/IMPORT method creates a lot of overhead!?
So, there is no way using the descriptor classes, is it?
‎2009 Oct 06 2:59 PM
Hi Michael,
I think you are looking for [persistent objects|http://help.sap.com/saphelp_nw70/helpdata/en/d2/7849bbbec911d4b2e80050dadfb92b/content.htm]
Or what is your goal in business terms? You have an object and want to save it's current state so that it can be re-used in a follow-up transaction?
But this can not be accomplished fully generic.
The RTTS classes CL_ABAP_.._DESRC determine the description of the class definition, the result will never change depending on the current state of the object.
Regards,
Clemens
‎2009 Oct 06 3:06 PM
Ok, my project is as follows:
I've got a distribution list type with parameters. The relationship between a distribution list and a parameter is n : m. Each parameter has got an attribute DATA_ELEMENT. My program will look up the domain values of the data element, so that we have a list of possible values. Then, you can assign values to a certain distribution list (which has got n parameters).
So, a value is assigned to a distribution list and a parameter. And its type depends on which parameter it's assigned to. Therefore, I've got the type saved in another table.
Well, at the moment, it's just a data element and a domain, so the values are strings each, but this can change soon, so that I want to accomplish a dynamic version.
Hopefully, that's clarified my problem a bit. Maybe I told you a lot of unusual information 😕
Thanks so far for your time!!