Application Development 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: 

Use of Changing and table parameters in the FM

Former Member
0 Kudos
2,004

Hi,

Can any body pl stell me the Use of Changing and table parameters in the FM .

Please give some examoples with coding.Urgent

Thanks

9 REPLIES 9

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Kudos
792

Hi,

Changing and Tables paramters both act IMPORT and EXPORT parameters.

<b>That is you can use them to pass the data to the function module and also get the data from the function module.</b>

<b>Only difference</b> is TABLES parameters are always internal tables where as changing parameters can be Innternal tables or any data of any type.

Regards,

Sesh

0 Kudos
792

Thanks for your answer.

Please tell me how to use cahnging parameter.

In changing parameter one pass by value option is there.

Basically in which case we need to pass the variable in changing parameter.

How the cahnging parameter will work ....please gv an example.

THANKS

former_member588853
Active Contributor
0 Kudos
792

HI,

The changing parameter.

For example , if you are adding two fields and putting in third field.

Now you need to use third fields and find percentage and you need to get value in the same third field itself then you can take it as changing parameter..

Table parameter.

for example you have a mara internal table and you want to add deletion flag 'X' in delete column of same internal table.

for material 1 you need to add 'X' and material 2 you need to add space.

You can take this as table parameter.

rewards if useful,

regards,

nazeeer

former_member189059
Active Contributor
0 Kudos
792

Changing - values can be changed and changed values are returned to the caller

Tables - always changing, but data is two dimensional (ie: an internal table)

tables cannot be passed as import / export parameters

Former Member
0 Kudos
792

hi

changing and tables are the keywords used for passing the values

to a FM.

tables : used for passing database tables as parameter.

changing : used for passing the values.

Former Member
0 Kudos
792

Changing are used for variables which conatin value in both calling program and FM where as tables are used for internal tables it is also contain value which will be remain same in program and FM.

Rewards if useful...

Minal

varma_narayana
Active Contributor
0 Kudos
792

Hi..

Find the Exact purpose:

For Eg We want to Call a FM that takes the Matno , stock , Received qty then returns the Updated Stock.

Import: MatNo , ReceivedQty (These are only imported to the FM )

Changing : Stock (It is Imported as well as exported)

Tables: is also same as Changing i.e Imported as well as exported. But it is only meant for passing INTERNAL TABLES.

<b>reward if Helpful.</b>

0 Kudos
792

Thanks ofr ur answer,

Can u please tell me the use of exception parameter in the FM with example.

Thanks

former_member189059
Active Contributor
0 Kudos
792

If an error occurs in the program such as divide by 0, a non existing file etc, SAP would throw a dump to the calling program

however, if you define an exception and throw it in your FM, the calling program can catch that exception and handle it

To catch the exception, the program calling the function module can check sy-subrc

if there was an error, it will be set the the error number (as defined in the exceptions parameters)

else sy-subrc will be 0 in case of no errors