Skip to Content
author's profile photo Former Member
Former Member

Error: ENDMETHOD missing, when using a FORM on a BSP Event handler

Hello,

In my ONREQUEST event I have the following FORM

FORM REPLACE_STRING USING STRING TEMPLATE NEW.

CALL FUNCTION 'SDIT_REPLACE_STRING'

EXPORTING

IN_STRING = STRING

NEW = NEW

TEMPLATE = TEMPLATE

IMPORTING

OUT_STRING = STRING.

ENDFORM. "REPLACE_STRING

However when running a check on the code I get the error:

"Statement ENDMETHOD is missing"

Is it not possible to use a FORM in the event handler in a BSP?

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Mar 10, 2004 at 10:49 AM

    OnRequest, OnInit and so on are methods of you BSP Context so this will ever work. Why don't you create

    a method in your application class??

    Regards Matthias

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 10, 2004 at 04:19 PM

    Craig:

    You may want to change the name of the variable "STRING" to something else. "STRING" is an ABAP data type; use as a parameter / variable name may be confusing the compiler, thus causing the error message.

    Regards,

    D.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 10, 2004 at 04:41 PM

    Your problem is that your BPS page is actually an ABAP OO class. All the event handlers are actually methods of this class. Therefore anything you program in these event handlers has to follow the rules for ABAP OO. Forms are not really valid constructs inside ABAP OO Methods. What you are trying to do is similar to trying to declair a new form within an existing form.

    Form Test1.

    Form Test2.

    endform.

    endform.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.