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

what is problem with this code?

Former Member
0 Likes
605

FUNCTION ZTEST.

data: disp_alv type as4flag value 'X' .

perform test using disp_alv.
form test using value(disp_alv) type as4flag .
endform. 

ENDFUNCTION.

here is simple test function.

and shows error

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

introduced by "FUNCTION" must be concluded by "ENDFUNCTION" . . . . . . '

it means should I put 'form' outside of function?

or 'form' is not available inside function as itself?

Reagrds.

Lee

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
578

Hi,

Put the form declaration after ENDFUNCTION.

Something like this.

FUNCTION ZTEST.

*"----


""Local Interface:

*"----


PERFORM EDIT.

&----


*& Form edit

&----


  • text

----


ENDFUNCTION.

FORM EDIT.

ENDFORM. "edit

Award points if it was helpfull..

Thanks and Regards

Manish

4 REPLIES 4
Read only

Former Member
0 Likes
578

Hi,

Write the following statements in other include of the function pool

form test using value(disp_alv) type as4flag .

endform.

You are not supposed to write this before endfunction.

Regards,

Anji

Read only

Former Member
0 Likes
579

Hi,

Put the form declaration after ENDFUNCTION.

Something like this.

FUNCTION ZTEST.

*"----


""Local Interface:

*"----


PERFORM EDIT.

&----


*& Form edit

&----


  • text

----


ENDFUNCTION.

FORM EDIT.

ENDFORM. "edit

Award points if it was helpfull..

Thanks and Regards

Manish

Read only

Former Member
0 Likes
578

form test using value(disp_alv) type as4flag .

endform.

write this code in separate include.while double clicking the perform test using disp_alv.system will automatically create the include.

or write the code without any perform.

Read only

Former Member
0 Likes
578

write a form...endform inside an include,you can never write a form inside a function module.you can only call a subroutine.

plz reward with points if helpful.