Skip to Content
avatar image
-1
Former Member

Syntax error in master program of a function group Z_XXX

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,

Saikat!

issue2.png (82.8 kB)
issue.png (234.3 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    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
            FUNCTION-POOL ZAZA.
            DATA ... " global variables
        INCLUDE LZAZAUXX. " contains the list of all function module includes
            INCLUDE LZAZAU01. " contains code of one function module
                FUNCTION Z<fmname1>.
                ...
                ENDFUNCTION.
            INCLUDE LZAZAU02. " contains code of one function module
                FUNCTION Z<fmname2>.
                ...
                ENDFUNCTION.
        INCLUDE LZAZAF01. " contains code of Subroutines
        INCLUDE LZAZAO01. " contains code of PBO-Modules
        INCLUDE LZAZAI01. " contains code of PAI-Modules
        ...
    

    Add comment
    10|10000 characters needed characters exceeded

    • 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.

  • avatar image
    Former Member
    Oct 12, 2017 at 08:20 AM
    -1

    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.
    Regards,

    Saikat.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 09, 2017 at 07:07 AM

    Hi,

    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.

    Regards,

    Ankit Mahajan

    Add comment
    10|10000 characters needed characters exceeded

  • 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.

    Add comment
    10|10000 characters needed characters exceeded