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 module basics

Former Member
0 Likes
493

hi all,

please tell me significance of the tabs in function module:

1)import

2)export

3)changing

4)tables

what needs to be entered here??and effects??

3 REPLIES 3
Read only

Former Member
0 Likes
467

You can specify the types of interface parameters in function modules in the same way as the parameter interfaces of subroutines.

<b>Import parameters</b>: These must be supplied with data when you call the function module,

unless they are flagged as optional. You cannot change them in the function module.

<b>Export parameters</b>: These pass data from the function module back to the calling program.

Export parameters are always optional. You do not have to receive them in your program.

<b>Changing parameters</b>: These must be supplied with data when you call the function module,

unless they are flagged as optional. They can be changed in the function module. The changed values are then returned to the calling program.

<b>Tables parameters</b>: You use these to pass internal tables. They are treated like CHANGING

parameters. However, you can also pass internal tables with other parameters if you specify the parameter type appropriately.

You can specify the types of the interface parameters, either by referring to ABAP

Dictionary types or elementary ABAP types. When you call a function module, you must

ensure that the actual parameter and the interface parameters are compatible.

Interface parameters are, by default, passed by value. However, they can also be

passed by reference. Tables parameters can only be passed by reference. You can

assign default values to optional importing and changing parameters. If an optional

parameter is not passed in a function module call, it either has an initial value, or is set to

the default value.

Exceptions are used to handle errors that occur in function modules. The calling

program checks whether any errors have occurred and then takes action accordingly.

Have a look at below links.

http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/content.htm

http://help.sap.com/saphelp_nw2004s/helpdata/en/d1/801f02454211d189710000e8322d00/frameset.htm

I hope it helps.

Best Regards,

Vibha

*Please mark all the helpful answers

Read only

Former Member
0 Likes
467

Hi kunal,

1. We give some inputs to the FM,

and it gives some output.

2. When we want to give some inputs (some variables etc)

then we should put/declare them in IMPORT tab in se37.

When we expect some output/variables from fm,

we declare in EXPORT TAB in se37.

3. When some internal table has to be passed to the fm,

then TABLES tab.

4. When some variables which can be passed,

and the FM can change it as per the requirement,

then CHANGING tab has to be used.

regards,

amit m.

Read only

former_member189629
Active Contributor
0 Likes
467

HI Kunal,

1) Import: these are the values you send to the function module for processing. From the calling program, these will be exported into the function module and the FM imports them into itself

2) Export: processed data which is returned by the FM to the calling program

3)Changing: data which is changed by the FM. CHANGING is used for output parameters which are changed in the subroutine.

Note: for all the above, the data type must be specified

4)Tables: Only internal tables that are passed using tables parameters can be passed exclusively by reference.