‎2010 Sep 04 9:16 AM
Hi Friends,
I have a requirement where fields of Export table of my function Module is dynamic. It is like the Fields to be expoerted by the Function Module would be stored in a seperate Z table
The Z table would contain the records as follows .
Table Name FieldName
=========
MARA MATNR
MARC WERKS
.....
......
and So on..
. How can I define my Export table in Function module dynamically so that the structure of my Export Function Module would be same as that of the Fieldnames in Z table..
Thanks
‎2010 Sep 04 10:39 AM
Just declare the associate type as "ANY TABLE" in the exporting parameter.
FUNCTION ZTEST.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" EXPORTING
*" REFERENCE(IT_TAB) TYPE ANY TABLE
*"----------------------------------------------------------------------
‎2010 Sep 06 12:38 PM
Hi Asik ,
Thanks for answering .
My function module is going to be called Remotely . Hence I can not define the Table with 'TYPE ANY'.
Regards
‎2010 Sep 06 12:45 PM
Consider using XML table as the exporting parameter. First serialize data on the calling site and deserialize on the target side. This way you can pass generic data via RFC.
Pelase refer this blog http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/580. [original link is broken] [original link is broken] [original link is broken]
Regards
Marcin