cancel
Showing results for 
Search instead for 
Did you mean: 

CL_GUI_SAPSCRIPT_EDITOR / Instantiation example

Former Member
0 Kudos

Hello,

I am trying to instantiate the SAPScript-Editor manuelly. But I don't know how to set the parameters of the constructor. Has anybody a report with example.

Thanks.

Regards. Lars.

Accepted Solutions (0)

Answers (1)

Answers (1)

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

This is like any other frontend control. You need to put it inside of a container, you must create a custom control in your dynpro and instaniate that. Here is an example, where the editor is implemented in a docking container. It is the same principal.



report zrich_0001.


parameters: p_check type c.

start-of-selection.

at selection-screen output.

  data: docking type ref to cl_gui_docking_container,
        ss_editor type ref to cl_gui_sapscript_editor.
  data: repid type sy-repid.

  repid = sy-repid.

  check docking is initial.

  create object docking
              exporting repid     = repid
                        dynnr     = sy-dynnr
                        side      = docking->dock_at_left
                        extension = 1700.

  create object ss_editor
    exporting
      parent            = docking.

Regards,

Rich Heilman

Former Member
0 Kudos

HI

I am facing the same challenge here. Your sample code works fine as far as it creates the control but it does not let me insert any text. Plus every click on a button produces the error "An unsupported operation was attempted".

Any clues as to what code I might add to make this work?

Cheers

AB
Contributor
0 Kudos

Hi Markus,

A long time since you asked the question - but in case others look for this in the future...

To load some text into the SAPSCRIPT editor, I've used FM READ_TEXT to read the text object and then the method set_text_by_header. This loads the editor with some text and automatically converts from ITF to RTF.

To save some text from the editor, use the method get_text_from_editor, which converts from RTF back to ITF. Then I've used the FM SAVE_TEXT to save the text.

Kind Regards

Andrew Barnard