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

Function Modue with Dynamic Table as parameter

Former Member
0 Likes
3,210

We can create a dynamic internal table in a report with Field Symbols : <itab> Type Standard Table. Can we also create a Z-Function module in se37 with this table as its parameter?If so how?

6 REPLIES 6
Read only

Former Member
0 Likes
1,379

I doubt that, beacuse you nee dto define teh reference structure in type.Which is a data dictionary structure.

Read only

0 Likes
1,379

That precisely is my problem. Is there any way that I can give some dynamic reference there?

Read only

Kiran_Valluru
Active Contributor
0 Likes
1,379

Hi.,

I think it is not possible as FM table parameter is Static type., Instead you create an importing parameter table_name of type DD02L-tabname and inside FM use Field Symbols and create dynamic table for table_name.

hope this helps u.,

Thanks & Regards,

Kiran

Read only

ravi_lanjewar
Contributor
0 Likes
1,379

Hi,

Yes, You can pass generic internal table as the table parameter to the function module.



FUNCTION ZTEST.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  TABLES
*"      T_OUTTAB
*"----------------------------------------------------------------------
   Field symbols <gt_table>.type any table.
   data: lr_data    type ref to data.

    get reference of t_outtab into lr_data.

    assign lr_data->* to <gt_table>.

" Your source dode

ENDFUNCTION.

while creating function module pass the table parameter without define the type to function module.

For it processing required OOP knowledge.

Kind Rgds

Ravi

Read only

0 Likes
1,379

you can use generic table as parameter by using type as just table

Read only

Former Member
0 Likes
1,379

yes you can create and in F.M you can do it as giving import and export parameters variables and also the status in programme

thanking you.