Page 1 of 1

Universal, generic IDoc to replicate Z-tables

Posted: Thu Oct 31, 2013 6:49 am
by kerum
Hello experts,

I'm looking for solution to replicate many own tables with IDocs.
The standard way is to create segment and IDoc type separate for every table.
My question, is there more generic approach possible?
For example some kind of universal IDoc type which could be used to replicate various tables?
I've looked on BW data extractors but they are to complicated for me and I must probably
also generate separate for every table.

The perfect solution would be empty IDoc container with exit (coding) possibility in Input/Output.

Do you have an idea for it?

Regards,
k.

Re: Universal, generic IDoc to replicate Z-tables

Posted: Thu Oct 31, 2013 7:17 am
by Rich
Create an idoc that contains a field for a structure name and an xstring,

Then using the following classes, convert the data outbound

cl_Abap_Conv_Out_CE,
cl_Abap_View_OffLen,

Populate the idoc structure with the structure (or table name), and the xstring with the result of the Out class.

On the inbound side use cl_Abap_Conv_In_CE to reconstruct the work area and populate it with the data followed by a dynamic insert to insert the data into the specified table.