Skip to Content

Syntax error in master program of a function group Z_XXX

Oct 07, 2017 at 02:20 PM


avatar image

Hello Experts,

I have been facing a strange issue with one of the function group (lets say Z_XXX).
There are many function modules created under this function group and all the calls of these function modules are throwing dump.
Later on, when I tried to activate the function group from SE80, it is throwing a syntax error in one of the auto generated include :

As the above screen shot suggest that the function must be concluded with an END-FUNCTION,however the concern is this is a SAP Standard code.
The function modules inside this function group have been called in so many user exit and the system is throwing dump for the same issue, below is the ST22 dump analysis sceenshot:

This is creating a global issue but I am not able to find a way to solve the same.
Is there anybody who faced a similar issue? Or can you guide me on the same?

Thanks and Regards,


issue2.png (82.8 kB)
issue.png (234.3 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Best Answer
Sandra Rossi Oct 07, 2017 at 03:18 PM

Ignore the generated includes, the error is not there. Only take into account the source code of your own function modules, ENDFUNCTION is missing in one of these function modules, or something like that.

There's an incorrect nesting: before the statement "FUNCTION", the control structure introduced by "FUNCTION" must be concluded with "ENDFUNCTION".

For instance, do a global text scan of FUNCTION in the whole function group, to identify whether this is something abnormal.

Remember the hierarchy of includes in the function group (for instance function group named ZAZA below):

SAPL<fugrname> : top include containing the main includes
    INCLUDE LZAZATOP. " contains FUNCTION-POOL and global declarations
        DATA ... " global variables
    INCLUDE LZAZAUXX. " contains the list of all function module includes
        INCLUDE LZAZAU01. " contains code of one function module
            FUNCTION Z<fmname1>.
        INCLUDE LZAZAU02. " contains code of one function module
            FUNCTION Z<fmname2>.
    INCLUDE LZAZAF01. " contains code of Subroutines
    INCLUDE LZAZAO01. " contains code of PBO-Modules
    INCLUDE LZAZAI01. " contains code of PAI-Modules

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Hi Sandra,

Thanks for the answer! I tried to look into all the function modules whether they are enclosed with FUNCTION - ENDFUNCTION block and it seems like they are!




There can be many reasons why you don't see it. Maybe you did an INCLUDE somewhere, unwantedly or at the wrong place. Check whether other developers are working on this function group and did not activate (ask them to activate). Make sure all includes are active -> in SE80, select the function group and select Activate in the context menu.

You could also investigate what happened to the function group (version management/content of transport requests) since last time everything was okay.


Any kind of syntax error will result in the dump. For formatting errors it could be an extra or missing ENDIF, or ENDLOOP, or ENDFORM etc. Since this is a user exit, it contains your code. Only you can figure this out. Go into one of the function modules and use the syntax check of the whole program.

Saikat Chakraborty Oct 12, 2017 at 08:20 AM

Thanks everyone! The issue got resolved.
There was an issue with the function module of this particular function group and that was not properly enclosed with END FUNCTION.


10 |10000 characters needed characters left characters exceeded
Ankit Mahajan Oct 09, 2017 at 07:07 AM


Try this two things :

1. Check if you have function-pool as the first statement in the top include, there must not by any code before this.

Also even if you missed a endif or endloop then SAP gives error like you showed in screenshot.

Check this as well.

2. Try to rebuild object list and then activate the code.


Ankit Mahajan

10 |10000 characters needed characters left characters exceeded
Raymond Giuseppi
Oct 09, 2017 at 06:25 AM

Look first at your includes for syntax error

  • Your FMs
  • Your TOP Include
  • Any include declared after the XX include of the FM

Then, and if nothing found, try to repair your function group from SE80 context menu or SE37 menu.

10 |10000 characters needed characters left characters exceeded