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

Function module Error

Former Member
0 Likes
3,208

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
Read only

Former Member
0 Likes
1,966

Hi

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

Try repairing the function group .

Regards

Kalpana

12 REPLIES 12
Read only

Former Member
0 Likes
1,966

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

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,966

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

Read only

Former Member
0 Likes
1,966

For more info, see any existing function module,

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

Read only

Former Member
0 Likes
1,967

Hi

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

Try repairing the function group .

Regards

Kalpana

Read only

0 Likes
1,966

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.

Read only

0 Likes
1,966

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

Read only

0 Likes
1,966

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"

Read only

0 Likes
1,966

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

Read only

0 Likes
1,966

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

Read only

0 Likes
1,966

Hi,

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

Thanks,

Subashini

Read only

Former Member
0 Likes
1,966

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.

Read only

Former Member
0 Likes
1,966

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