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: 

Function module not recognizing IMPORT param

Former Member
0 Kudos

Hi abapers,

IMPORT parameter: I_ZZZZZ was declared in a custom Function module, but when it is referenced in one of the Function modules INCLUDE, it doesn't seem to recognize. Here is the error during syntax-check:

"Field "I_ZZZZZ" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement. "DATA" statement."

Please note I've activated the complete Func. group using SE80 as some have suggested on this Forum, and have also activated the "INCLUDE".

Appreciate your thoughts!

Thankyou

Edited by: ABAP JUNOON on Dec 18, 2008 6:21 PM

8 REPLIES 8

former_member181995
Active Contributor
0 Kudos

I_ZZZZZ is defined local in custom FM,and It will be reconize only, once this FM has been used in some program.

the defination of I_ZZZZZ is not exist in Data dictionary.

0 Kudos

It shouldn't give a syntax error in this case. Do you agree?

0 Kudos

Actually i'm not sure what you are trying to do!

Can you please paste your piece of code where you are geting this error?

Former Member
0 Kudos

Hi

I think the parameters declared in the Function Module interface Import/Export are local to the Function-End Function construct. If you need to use any of these variables outside you should declare a global variable in the top include (Global data section) populate it within the FM and then use it wherever needed OR if calling a subroutine from within the FM pass the parameters in the subroutine interface.

Thanks

Sharath

Former Member
0 Kudos

Hey Amit, here is the deal:

Function Group: PACK contains the following INCLUDES:

LZPACKF01

LZPACKTOP

LZPACKUXX

ZPACKDATA

Function Module: ZDLV_PACK_0001 contains the following IMPORT parameters:

I_ZZZZZ

I_ZPA01

I_ZPA02

Source code of main FM: ZDLV_PACK_0001 :

perform reset_vars_itab.

Souce code of INCLUDE LZPACKF01 contains the above FORM

FORM reset_vars_itab.

IF NOT I_ZZZZZ IS INITIAL. <========== THis is where Function mod. is failing

  • Refresh internal tables

CLEAR: var1, var2, var3, var4.

REFRESH: tab1, tab2, tab3, tab4.

ENDIF.

ENDFORM.

Edited by: ABAP JUNOON on Dec 18, 2008 7:26 PM

0 Kudos

I_ZZZZZ is a local parameter within the FM, so you can use that within Function .. EndFunction only. Either you should have defined that as Global at the beginning. Now if you really want to use that to clear, you need to bring the code within that form to inside Fuinction itself.

0 Kudos

>

> Function Module: ZDLV_PACK_0001 contains the following IMPORT parameters:

> I_ZZZZZ

> I_ZPA01

> I_ZPA02

>

> Source code of main FM: ZDLV_PACK_0001 :

> perform reset_vars_itab.

>

> Souce code of INCLUDE LZPACKF01 contains the above FORM

> FORM reset_vars_itab.

>

> IF NOT I_ZZZZZ IS INITIAL. <========== THis is where Function mod. is failing

> * Refresh internal tables

> CLEAR: var1, var2, var3, var4.

> REFRESH: tab1, tab2, tab3, tab4.

> ENDIF.

>

> ENDFORM.

As i already said in my first reply I_ZZZZZ is a local parameter for your FM,it can't access outside of FM anyway.

Even if you declear I_ZZZZZ in your include its value would always be initial,untill and unless you call FM in your Include.

At line:

IF NOT I_ZZZZZ IS INITIAL. "<========== Call here FM

Former Member
0 Kudos

Just an FYI - this FM exist in one of the instances perfectly working for past several yrs and we're trying to re-create in a different instance.

I_ZZZZZ is an import param for the FM, and will be available for all includes within F.group.

Edited by: ABAP JUNOON on Dec 18, 2008 8:50 PM