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

Doubt in Function Module

teja_divya
Participant
0 Likes
2,324

Hello People !!

I am new to sap ABAP World. while i am learning Function modules in SAP ABAP, i have got some doubts about tables tab in the function module.

I understood follwoing things

import tab : here we pass the input

source code : we put our logic to get the output here

export : output is stored in this varialbes

But i did not understand 'TABLES' Tab over here Properly. I read some documents about it ,but still not understood properly.

Can anyone help me in understanding this  with the simple example ???

Regards,

Teja

1 ACCEPTED SOLUTION
Read only

former_member202818
Active Contributor
0 Likes
2,262

Hi Teja,

Which used to declare internal table parameters for function module.

But it is now obsolete.

Regards

Sreekanth

10 REPLIES 10
Read only

former_member202818
Active Contributor
0 Likes
2,263

Hi Teja,

Which used to declare internal table parameters for function module.

But it is now obsolete.

Regards

Sreekanth

Read only

0 Likes
2,262

Thnks Sreekanth for your information.

Read only

0 Likes
2,262
  • TABLES parameters are table parameters. Table parameters are obsolete CHANGING parameters that are typed as standard tables with a header line. If an internal table without a header line or a table bodyis passed as an actual parameter to a formal parameter of this type, an empty local header line is generated in the function module. If an internal table with a header line is used as an actual parameter, both the table body and the header line are passed to the function module. Pass by value is not possible in formal parameters defined using TABLES. Formal parameters defined with TABLES can be replaced by formal parameters defined with CHANGING. A local work area can be created for the internal table in the function module by using the addition LIKE LINE OF itab of the DATA statement.
Read only

0 Likes
2,262

Sreekanth , can you help me by giving an example for this ?

Read only

0 Likes
2,262

Pass by value is not possible in formal parameters defined using TABLES.

Did u get this point?

we don't have an option to choose 'Pass by value' for Tables parameter.

Actual parameter- The variable passing to FM

Formal Parameter- The variable name defined in FM

Pass by value- Passing a copy of actual parameter to formal parameter

Pass by reference- Passing a reference(like pointer) to formal parameter.(So that the changes from FM will affect the actual parameter)

Since TABLES obsolete we can define a table parameter in Import or Export list.

Remember here we require a table type(can be created from se11) to define a table parameter.

Read only

Former Member
0 Likes
2,262

If you want to pass select-option (via selection screen) to call a function module then TABLE tab is used to declare a variable.

Or you can pass internal table data to function module...

Read only

0 Likes
2,262

Thanks Avirat!!

Read only

ipravir
Active Contributor
0 Likes
2,262

Hi Teja,

In FM.

If you want SET / GET inforamtion in TABLE tab.

Just pass the structure in Associated Type Field, the parameter itself work as a table in FM.

Regards.

Praveer.

Read only

vinodkumar_thangavel
Participant
0 Likes
2,262

Hi,

The IMPORT shall have single Import parameters,

    EXPORT shall have single export parameters and

    TABLES shall have multiple parameters .

Regards,

Vinodkumar.

Read only

Former Member
0 Likes
2,262

Hi Teja,

if you want to pass multiple lines of data to your FM or your FM returns multiple lines of data then this TABLES tab is used.

For better understanding, you can execute standard FM's in se37 then you will get an idea how it works.

Thanks & Regards

Richa