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

PERFORM statment in INCLUDE program

Former Member
0 Likes
2,125

Dear Friends

I have main program and I'm using include program,

In the include program, i want to use PERFORM statement and place subroutine program in the same include program, is it possible?

i was tried so many times,

but syntax error coming as follows,

Incorrect nesting: Before the statment "FORM" , the structure introduced by "IF" must be concluded with "ENDIF".

when I placed subroutine in the main program it's working properly

please suggest me what can i do or any helpful words.

Thanks in Advance.

9 REPLIES 9
Read only

Former Member
0 Likes
1,283

Hi,

There may be an open IF .

Use endif before FORM.

Read only

Former Member
0 Likes
1,283

Hi Nelson,

Incorrect nesting: Before the statment "FORM" , the structure introduced by "IF" must be concluded with "ENDIF".

Your error clearly specifies that the IF statement is not closed with ENDIF. Close it with ENDIF.

Hope this helps you.

Regards,

Chandra Sekhar

Read only

Former Member
0 Likes
1,283

Hi

Regarding your error, it's clearly suggest that you have to close your if statement.

so close it than check it.

Regards

Nikunj Shah

Read only

0 Likes
1,283

Frends

Thanks for your reply

but problem is not the IF or ENDIF statement

because when i comment the subroutine part and PERFORM statement , that error missing.

it may be other case.

Read only

Anirudha
Associate
Associate
0 Likes
1,283

Hi,

I tried and it worked. Could you please include similar code snippet in the message.

Regards

Anirudha

Read only

vinod_vemuru2
Active Contributor
0 Likes
1,283

Hi,

Probably u r placing the cursor at wrong place. Write ur PERFORM statement in ur include, double click on that, It will ask where to create. Here select main program and enter. Now it will introduce

FORM...

ENDFORM

in the end of the main program. Now try to activate ur program(Select all the includes and main program at the same time and activate)

It will solve the issue.

Thanks,

Vinod.

Read only

0 Likes
1,283

Frends

this is the sample code


PERFORM TEST_AB.
*&---------------------------------------------------------------------*
*&      Form  TEST_AB
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM TEST_AB .

ENDFORM.                    " TEST_AB

if place in Main program its working, but i want to placed in the same Include program.

Read only

Former Member
0 Likes
1,283

Still not answered, thread closed

Read only

0 Likes
1,283

Hy Nelson!!!

Wait!! ......just remember one thing that FORM ..ENDFORM should be after the END-OF-Selection.

so you are writing as..

START-OF-SELECTION.

include program.

edn-of-program.

so that form is coming in between Start-of-selection and end-of-selection...

just put that form ....Endform inside the main progam after end-of-selection your issue will be solved..

regards

sas