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

Call sapscript form from an OO class method?

Hi,

I'm trying to call a sapscript from a class method like:

method mymethod.

call function 'OPEN_FORM'.....

call function 'START_FORM'......

call function 'WRITE_FORM'....

.....

endmethod.

The layout and the fixed texts comes out correctly and I can print the form;

BUT

All the variable fields are lost!

In a normal program I define:

data: mymara type mara.

perform: fill_mymara.

call function 'WRITE_FORM'

...and mymara is available in the script and I can use it like:

&mymara-matnr&

But If I do the same inside a method..... NOTHING!

So the question:

Do you know I can I pass the data to a form from a OO class method?

Many thanks,

Lorenzo

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Jun 28, 2005 at 01:52 PM

    Where are you declaring your variable fields, in the method?, in the the class definintion?, in the main program?

    SAPscript is a little picky about that. You may want to try declaring them in the class definintion in the Public section or in the main program itself.

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hello Lorenzo & Rich,

      I am having exact requirement except that the output type i.e RAW_DATA_INTERFACE in OPEN_FORM is I (IDOC) for me.

      All my variables declared in the method are not getting printed but those STATIC variables of the class mentioned as ZCL_CLASS=>FIELD1 are printed correctly.

      How did you manage to print the normal variables ? Did you define them outside of CLASS definition / implementation ?

      I am not sure I can add the variable definitions outside class as my class is generated from SE24 and i have no idea how to navigate to the source code.

      Really appreciate your replies.

      Thanks

      BR

      Nilesh

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.