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: 

Error while activating Function Module

Former Member
0 Kudos

Hi all,

I created a test Function Modules. whenever I try to activate it, it gives an error

"REPORT/PROGRAM statement missing, or program type is I (INCLUDE)."

Further, if I dbl click the error, it takes me to the function group, where two include files are listed.

Any Thoughts,

Hanif

11 REPLIES 11

Former Member
0 Kudos

Hi Hanif,

Have you included subroutines (FORM ... ENDFORM) before your ENDFUNCTION statement? If you, you should put them after the ENDFUNCTION statement.

Also, you may have deleted your ENDFUNCTION statement. Make sure that you have one at the end of your function module.

Cheers,

Brad

Former Member
0 Kudos

Hi,

This error will come even if u create a report.I have also faced the same problem.

Try activating the related includes if u have used any.

Also try activating by pressing activate any way sometimes this will help out.

Thanks & Regards,

Judith.

0 Kudos

Hi,

I did not use any FORM...ENDFORM Statement nor I changed any changed any Include Files. I wrote a test FM it has two inputs param and it returns the sum of these two.

I did try Activate Anyway, but no availth, when i called it in a report, it resulted in same error.

Any idea.....

Hanif

0 Kudos

Hi Hanif,

Obviously, this function Module should belong to some function group. and I suppose you have not created that function Group. In that case, the Function Group (or one of the other function modules inside that function group)might be having some syntax-error. Please check that out.

Regards,

Anand Mandalika.

0 Kudos

Hi Hanif,

Can you post your FM code?

Please also mark this as a question.

Brad

0 Kudos

The first line of uncommented code in the functon module needs to be....



FUNCTION <function_name>.

Is this line present?

Regards,

Rich Heilman

Former Member
0 Kudos

fortunately, I have met this error before several hours.

I think when activate, you didn't choose all the associated file, so occur this error.

Please have a check in the file list when activate.

0 Kudos

Check your main program. Let us say your function group is ZZMM. Then your main program name will be SAPLZZMM. Now if you look into this main program it should look somewhat like this.


*******************************************************************
*   System-defined Include-files.                                 *
*******************************************************************
  INCLUDE LZZMMTOP.                          " Global Data
  INCLUDE LZZMMUXX.                          " Function Modules

*******************************************************************
*   User-defined Include-files (if necessary).                    *
*******************************************************************
* INCLUDE LZZMMF...                          " Subprograms
* INCLUDE LZZMMO...                          " PBO-Modules
* INCLUDE LZZMMI...                          " PAI-Modules

INCLUDE LZZMMF01.

In here, the include LZZMMUXX, will contain further includes, one for each function module assigned to that function group and it should look like this


*****************************************************************
*   THIS FILE IS GENERATED BY THE FUNCTION LIBRARY.             *
*   NEVER CHANGE IT MANUALLY, PLEASE!                           *
*****************************************************************
INCLUDE LZZMMU01.   "YOUR_FUNCTION_MODULE_NAME

Now you will get this error message typically if you are missing the following statement in the main program

INCLUDE LZZMMTOP. " Global Data

or within this include, there must be this line as its first line.


FUNCTION-POOL ZZMM.                         "MESSAGE-ID ..

If any of the above is missing, I would say first check your TOP include and see if the statement FUNCTION-POOL is there.

If you still get an error, go to SE38, enter the name of your main program and do a check main program. If you don't get any syntax errors, then activate the program there itself.

Let us know how it goes.

Srinivas

0 Kudos

activate the function group and then activate the function module.

its because the function group is not active you are getting this message.

Regards

Raja

0 Kudos

Thanks

Srinivas Adavi, Durairaj Athavan Raja zhenglin gu and all others who replied to this message.

Many replies were relevant to the problem. I did not need to change any thing in the code, Idea of opening the main program in SE38 worked fine, I activated the top most object (Function Module), and it get acticated.

Thanks again.

0 Kudos

Good to hear the issue is resolved.

From next time onwards when you post a question do not uncheck <b>mark it as question</b> option.

Regards

Raja