Skip to Content
avatar image
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 comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    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 comment
    10|10000 characters needed characters exceeded

    • Former Member

      Well I am pretty new to BSP's and I've not had much luck with the examples of doing a method in my application class.

      Any suggestions on how to get started?

  • avatar image
    Former Member
    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 comment
    10|10000 characters needed characters exceeded

  • 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 comment
    10|10000 characters needed characters exceeded