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

PRoblem with Funtion Module

Former Member
0 Likes
1,203

Hello...

I am facing a problem in Function Module. I am using Tables in FM. When I create a subroutine in separate include and try to call that table in that Subroutine it gives me error table not found. I have seen many FM using tables and calling them in separate include without specifically declaring the table.

Please guide.. I am not able to find my mistake...

Thanks & Regards

Ankur

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,165

hi,

this is because all the function module parameters are local by default.so these parameters will NOT be visible in any further includes.

To MAKE all the parameters visible in all includes & we should make them global(instead of local)

in se37 change,

go to menu

EDIT->INTERFACE->GLOBALIZE PARAMETERS.

if you click on this , all the parameters change to GLOBAL.SO you can access them in any includes.

then activate it.

regards

srikanth

Hello...

I am facing a problem in Function Module. I am using Tables in FM. When I create a subroutine in separate include and try to call that table in that Subroutine it gives me error table not found. I have seen many FM using tables and calling them in separate include without specifically declaring the table.

Please guide.. I am not able to find my mistake...

Thanks & Regards

Ankur

7 REPLIES 7
Read only

Former Member
0 Likes
1,165

no for each and every FM there is Global Declaration include program like this exp.

<b>include lgraptop. " Global Data</b>

regards

Prabhu

Read only

0 Likes
1,165

ya...coz when u access the field...that variable is accessed locally and unless u declare it then and ther it'll throw that error...

it's like SCOPE in 'C'...

reward points if it helps

regds

gunjan

Read only

Former Member
0 Likes
1,165

Hi Ankur,

You can declare the tablename in the TOP include of your function module.This TOP Include will usually have Tables and Data declarations.

You can find the TOP Include from the function pool.Function pool name will be given on the FM attributes screen.

If this is useful, award points pls..

Thanks.

Regards,

Bharadwaj

Read only

Former Member
0 Likes
1,165

Hi,

As Prabhu already stated: You'll need to add an include statement somewhere in the declarations part of the function group (where your FM is located).

Most often the TOP include is used for this.

Suppose your include has the name ZMYINCLUDE01 and there-in your TABLES statement is located.

Look for the TOP include (starting with letter "L" and ending with text "TOP". Open this one and put the statement "include ZMYINCLUDE01." into it.

Once activated your TABLES statement has been declared globally and you do not have to put it somewhere else anymore.

Regards,

Rob.

Read only

Former Member
0 Likes
1,166

hi,

this is because all the function module parameters are local by default.so these parameters will NOT be visible in any further includes.

To MAKE all the parameters visible in all includes & we should make them global(instead of local)

in se37 change,

go to menu

EDIT->INTERFACE->GLOBALIZE PARAMETERS.

if you click on this , all the parameters change to GLOBAL.SO you can access them in any includes.

then activate it.

regards

srikanth

Read only

Former Member
0 Likes
1,165

Hi,

goto

se37...........Enter FM Name ( Change Mode ).

1)edit>interfaces->Globlize Parameter

this to make the parameter global within the includes of the function Module.

local parameter is good. in that case u have to pass the tables in the table option of the perform to make the parameter available in the include of the FM ; since forms are present in the Include of the FM.

Mark Helpfull Answers

Regards

Read only

0 Likes
1,165

Hello

Problem solved

thanks Manoj