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

Error: Before the statement "FORM", conclude with "ENDFUNCTION

Former Member
0 Likes
5,844

Hi All,

I'm using this exit :EXIT_SAPLVEDA_001.

In this exit include zxvedu03 is used.

I have written a perform in this include zxvedu03 :

perform abc.

I have written the code

form abc.
                                         endform.

in include ZXVEDF01.

I have called this

includeZXVEDF01

in the last line of include zxvedu03.

Now i'm getting error :

Incorrect nesting: Before the statement "FORM", the structure  
introduced by "FUNCTION" must be concluded with "ENDFUNCTION".

I have even tried to create include from perform statement and then inserted code and vise versa too but results are same.

Please suggest how can i revolve this error.

Thanks.

1 ACCEPTED SOLUTION
Read only

deepak_dhamat
Active Contributor
0 Likes
3,446

hi ,

you said

in include ZXVEDF01.

I have called this includeZXVEDF01

you should not do this way .

you are calling ZXVEDF01 in ZXVEDF01 (include ) which is same .

Regards

Deepak.

Hi All,

I'm using this exit :EXIT_SAPLVEDA_001.

In this exit include zxvedu03 is used.

I have written a perform in this include zxvedu03 :

perform abc.

I have written the code

form abc.
                                         endform.

in include ZXVEDF01.

I have called this

includeZXVEDF01

in the last line of include zxvedu03.

Now i'm getting error :

Incorrect nesting: Before the statement "FORM", the structure  
introduced by "FUNCTION" must be concluded with "ENDFUNCTION".

I have even tried to create include from perform statement and then inserted code and vise versa too but results are same.

Please suggest how can i revolve this error.

Thanks.

13 REPLIES 13
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
3,446

First of all it should be included on the top. Secondly why are you creating a separate include..? Any particular reason...?

Nabheet

Read only

0 Likes
3,446

I used it in the top but issue is not solved.

This is as per the requirement required such changes.

Read only

Former Member
0 Likes
3,446

Hi,

There is no need to write the Include statement "includeZXVEDF01" inside zxvedu03.

Regards,

Srini.

Read only

Former Member
0 Likes
3,446

Write you form.....endform after ENDFUNCTION statement

Regards

Praveen

Read only

0 Likes
3,446

I cannot write my form endform statement after endfunction the Function endfucntion is in standard FM .

Read only

0 Likes
3,446

Hi,

Can you please paste your code.

With Regards,

Sumodh.P

Read only

0 Likes
3,446

Hi,

This is my code of include ZXVEDU03:

if ( contrl-sndsad in rl_var2 ) or ( contrl-sndsad in rl_var1 ).

*** Uncommented below perform
  perform contract_determine using contrl-sndsad segment
                                                 dxvbak
                                                 dxvbap
                                                 dxvbadr
                                                 dd_flag_k.
endif.
***
***statements**
include zxvedf01.

Code in includeZXVEDF01 :

form contract_determine using    p_cntrl_sndsad p_segment type edidd
                                                p_dxvbak   structure wa_dxvbak
                                                p_dxvbap   structure wa_dxvbap
                                                p_dxvbadr  structure wa_dxvbadr
                                                p_d_flag_k structure wa_d_flag_k.


*** statements**
endform.

Note: Include ZXVEDU03 is in EXIT_SAPLVEDA_001 and ZXVEDF01 is in ZXVEDU03.

EXIT_SAPLVEDA_001-> ZXVEDU03->ZXVEDF01

Read only

0 Likes
3,446

ZXVEDF01 is in ZXVEDU03

That's your problem: it should not be in there. It should be included outside the FUNCTION...ENDFUNCTION.

Include it in: lxvedf00.

Edited by: Maen Anachronos on Nov 19, 2010 12:48 PM

Read only

deepak_dhamat
Active Contributor
0 Likes
3,447

hi ,

you said

in include ZXVEDF01.

I have called this includeZXVEDF01

you should not do this way .

you are calling ZXVEDF01 in ZXVEDF01 (include ) which is same .

Regards

Deepak.

Read only

0 Likes
3,446

Hi all,

The problem is solved .

I have used a dynamic calling of the include and it worked.

PERFORM contract_determine(ZXVEDF01) USING contrl-sndsad segment
                                                 dxvbak
                                                 dxvbap
                                                 dxvbadr
                                                 dd_flag_k.

Thanks all for the replies.

Read only

0 Likes
3,446

So now you have a floating INCLUDE...

Do it properly: put your FORM routine in the include i mentioned.

Read only

0 Likes
3,446

Hi Maen,

I inserted the include in the include mentioned by you.

The perform does not even require any floating call.

It worked.

Thanks.

Read only

Former Member
0 Likes
3,446

i think you actually are creating a routine inside the function...

you exit is:

FUNCTION.

include zx.....

ENDFUNCTION.

if in that include you are calling another one, both includes are inside the main exit funcion...

so, i think the solution is to put your code in another funcion instead of declaring a form routine.

( this answer came late for 3 minutes )

regards, Sebastian

Edited by: Sebastian Bustamante on Nov 19, 2010 1:14 PM