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: 

SYNTAX Problem in User-Exit (Perform/Form)

Former Member
0 Kudos

Hi,

i use this User-Exit:


FUNCTION EXIT_SAPLAD15_010.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  IMPORTING
*"     VALUE(I_DLISRC) LIKE  AD01DLIA-DLISRC
*"     VALUE(I_KOKRS) LIKE  TKA01-KOKRS
*"  TABLES
*"      T_COVP STRUCTURE  COVP OPTIONAL
*"      T_COSPA STRUCTURE  COSPA OPTIONAL
*"      T_COSSA STRUCTURE  COSSA OPTIONAL
*"      T_COVPR STRUCTURE  COVPR OPTIONAL
*"      T_COSRA STRUCTURE  COSRA OPTIONAL
*"      T_V_COFP STRUCTURE  V_COFP OPTIONAL
*"      T_FMSUA STRUCTURE  FMSUA OPTIONAL
*"      T_CKF_DIP_CUSTOMER_EXIT STRUCTURE  CKF_DIP_CUSTOMER_EXIT
*"       OPTIONAL
*"      IT_OBJECTS STRUCTURE  AD01OBJ OPTIONAL
*"----------------------------------------------------------------------


  INCLUDE ZXAD1U10.


ENDFUNCTION.

*----------------------------------------------------------------------*
*   INCLUDE ZXAD1U10                                                   *
*----------------------------------------------------------------------*
CASE I_DLISRC.
  WHEN '0001'. "Istkosten
    PERFORM DP90.
  WHEN '0021'. "Plankosten
    PERFORM DP80.
ENDCASE.
*
************************************************************************
FORM DP80.
*
BREAK-POINT.
*
ENDFORM.                                                    "DP90
************************************************************************
FORM DP90.
*
BREAK-POINT.
*
ENDFORM.                                                    "DP90
************************************************************************

I get this syntax-error:

Incorrect nesting: Before the statement "FORM", the structure

introduced by "FUNCTION" must be concluded by "ENDFUNCTION

Isn't it possible to use own Forms in includes of exits?

Thanks, Regards Dieter

1 ACCEPTED SOLUTION

Former Member
0 Kudos

If you define your FORMS like that in the include, then you've basically defined them between FUNCTION...ENDFUNCTION which isn't allowed.

Define your FORMS in include zxad1zzz.

5 REPLIES 5

Former Member
0 Kudos

If you define your FORMS like that in the include, then you've basically defined them between FUNCTION...ENDFUNCTION which isn't allowed.

Define your FORMS in include zxad1zzz.

prasoon_sahay
Participant
0 Kudos

Go to attributes tab of Function Module EXIT_SAPLAD15_010

Double click on program name SAPLXAD1

Write your form endform in INCLUDE ZXAD1ZZZ. " Subprograms and Modules

Former Member
0 Kudos

Hi,

Write your Form DP80 ....Endform and Form DP90...Endform in in include zxad1zzz.

as in user-exit after endfunction not allow to write form.

Regards,

kunjan

Former Member
0 Kudos

when you do this:

function.

  include zx
endfuncion.

include ZXAD1U10 
form aaa.

endform.

the abap engine see this:

function.
  form aaa. " this is because the incorrect nesting error apperars

  endform.
endfuncion.

so, you can do two things:

1° put your include sentence in the top of the function group, not inside the exit.

2° try with dinamyc sencentes include (zx...) perform (routine).

raymond_giuseppi
Active Contributor
0 Kudos

Most (near every) exit function group main program have include for this purpose, the most useful are

(for an exit FG Xnnn)

- ZXnnnTOP for your global data

- ZXnnnZZZ for your form (and modules)

Regards,

Raymond