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 Error

Former Member
0 Kudos

Hi,

I created FM using Se37. I didn't put any code inside that FM. But While Activating that FM i am getting error like "program SAPLYMATERIAL "Report/Program statement missing, or program type is include". If i double click that program name then it's going to this code

*******************************************************************

  • System-defined Include-files. *

*******************************************************************

INCLUDE LYMATERIALTOP. " Global Data

INCLUDE LYMATERIALUXX. " Function Modules

*******************************************************************

  • User-defined Include-files (if necessary). *

*******************************************************************

  • INCLUDE LYMATERIALF... " Subprograms

  • INCLUDE LYMATERIALO... " PBO-Modules

  • INCLUDE LYMATERIALI... " PAI-Modules

If i try to activate this telling me syntax error "The main program of the function "YMAT" does not begin with FUNCTION_POOL". Kind of strange....... B'cos i didn't write any code in FM. Why i am getting this error?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

It seems to be an issue with the function group you used.

Try repairing the function group .

Regards

Kalpana

12 REPLIES 12

former_member181962
Active Contributor
0 Kudos

Hi Subhashini,

When you create a FMyou need to create it with reference to a function group.

the function group will have a main program attached to it and there will be several include in it(One for global data , one for the form rouitines etc).

So when you have the code and see if you get the error still.

Regards,

Ravi

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Something went wrong when creating the function group. You can delete it and try creating it again or you can check that all of your code matches mine.

The SAPLYMAT should look like....

*******************************************************************
*   System-defined Include-files.                                 *
*******************************************************************
  INCLUDE LYMATTOP.                          " Global Data
  INCLUDE LYMATUXX.                          " Function Modules

*******************************************************************
*   User-defined Include-files (if necessary).                    *
*******************************************************************
* INCLUDE LYMATF...                          " Subprograms
* INCLUDE LYMATO...                          " PBO-Modules
* INCLUDE LYMATI...                          " PAI-Modules

The LYMATTOP include should have ....



FUNCTION-POOL YMAT.                         "MESSAGE-ID ..

Regards,

Rich Heilman

former_member181962
Active Contributor
0 Kudos

For more info, see any existing function module,

Go to got0->Main program for any function module.

Former Member
0 Kudos

Hi

It seems to be an issue with the function group you used.

Try repairing the function group .

Regards

Kalpana

0 Kudos

Hi,

Exactly My function is looks like Urs. ALso I created Function group & linked that Function Group to FM. But still it's giving me error.

0 Kudos

First make sure that the TOP include is activated.

If it is then something is wrong. I would start over. Delete the function group. Go to SE80, pull the listbox down to "Function Group", enter the name and hit enter. System will ask you if you want to create it, say yea, and give a description. Click save, enter dev class.

Now you have you funciton group. Go ahead and activate it, by right clicking on the function group name and "Activate". Select the TOP include as well as the main program and click green check. Now all should be activated, now start adding function modules.

Regards,

Rich Heilman

0 Kudos

Ok i will try this. But When i create FM as YMAT1, If i save this telling me warning that " Function Module name is reserved for SAP"?..

Is that ok. or b'cos this it's causeing the error "Report/Program statment missing Error"

0 Kudos

Are you creating a function group or just a function module? In my example, I was creating the group YMAT. This is within the customer name space. If you are creating a funciton module, you need ot use Z_ or Y_.

Regards,

Rich Heilman

0 Kudos

Go to SE38 and enter your main program SAPLYMATERIAL. Click activate there. Then in the menu, Utilities-->Update Navigation Index.

Now go to SE37 and check if your function module is active. Try activating it again, if not.

Srinivas

0 Kudos

Hi,

Thanks guys. Now it's activating Without any errors. I activated through SE80. Great help guys.

Thanks,

Subashini

Former Member
0 Kudos

Initially delete the FM which u have created. Recreate a new FM from SE37. While creating the FM attach a valid function group and save the FM. It automatically creates various include programs. Try activating the main program.

This will solve ur problem.

former_member188685
Active Contributor
0 Kudos

Function Group Problem, There is some other Programs having some problem, because of that you are getting this message.

try to Correct that FM.

then you will not get any errors.

regards

vijay