Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Dynamic Export table of a function Module

Former Member
0 Likes
981

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

3 REPLIES 3
Read only

asik_shameem
Active Contributor
0 Likes
656

Just declare the associate type as "ANY TABLE" in the exporting parameter.

FUNCTION ZTEST.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  EXPORTING
*"     REFERENCE(IT_TAB) TYPE  ANY TABLE
*"----------------------------------------------------------------------

Read only

Former Member
0 Likes
656

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

Read only

0 Likes
656

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