What would be the best way to serialize informations about SAP RFC Function Module parameters (i.e. parameter names and parameter values) with which the function was called in SAP (with parameter 'DESTINATION' provided as SAP JCO SERVER) and then captured in JCo?
The point is that the serialization should be done in Jco (using Java) and then this data would be send back to SAP and saved in a Z-Table in SAP, so that later using this entries in SAP Table it will be possible to "reserialize" this data in ABAP and call again the given funcion with exactly the same parameters and values.
To make it easier to understand, I will give an example:
Step 1. We call RFC FM in ABAP:
CALL FUNCTION 'remotefunction'
DESTINATION jco_server
EXPORTING e1 = exp1
* IMPORTING i1 =
TABLES t1 = tab1.
Step 2. We catch this function call in Jco and need to serialize the information about the parameters with which the function was called and save it in a SAP table, for example:
String ImportParList = function.getImportParameterList().toXML().toString(); //serialization of import parameters
String ExportParList = function.getExportParameterList().toXML().toString(); //serialization of export parameters
String TableParList = function.getTableParameterList().toXML().toString(); //serialization of table parameters
String ParList = ImportParList + ExportParList + TableParList;
//Call function to save content of variable "ParList" in a SAP table
Step 3. Using ABAP we need to select the data from SAP table and "reserialize" (e.g. using CALL TRANSFORMATION FM in ABAP) to be able to recall again the FM "remotefunction" with the same parameters and values as earlier.
To sum it up:
A. Is there maybe any standard Java method in Jco for such serialization (better than manually converting this to xml/JSON and saving as String)?
B. How to deal with deep ABAP structures, e.g. tables in which subsequent tables are nested? Also convert it to XML/JSON just like the rest?
C. Do you have any other ideas how to perform this process better than what I presented?
Thanks in advance!