1

I found a rich text editor which is quite easy to use in normal abap.

CL_BTF* will show all the stuff, I mean.

However, it seems to be a little bit buggy.

1) It behaves buggy with cr/lf's and < br >'s. When I receive the string, the editor ( it is type of html ), doubles cr/lf by not removing cr/lf's and replaceing them by < br >'s. No problem, I do it myself later.

2) It seems to be quite unperformant 4 editors on one dynpro take almost 5 seconds before the dynpro is shown via "CALL SCREEN".

Does anybody know a better option?

Suncatcher
  • 10,355
  • 10
  • 52
  • 90
icbytes
  • 1,831
  • 1
  • 17
  • 27

1 Answers1

2

I have used extensively another control, which can be programmed via the class CL_GUI_RTF_EDITOR (it was used by the "SAPscript text editor", before SAP switched to Microsoft Word).

I can't tell you whether this RTF editor is less or more buggy than "your" BTF editor (CL_GUI_BTFEDITOR if it's the class you are talking about), because I don't know this BTF class.

But I can tell you that CL_GUI_RTF_EDITOR has a weird behavior for some of its features. No idea concerning the performance. Note that it took me some time to understand how it worked, what were the limitations, and how to countervene them.

If you want to test the performance of the RTF editor, here is a very short example you may adapt :

DATA editor_id TYPE i.
DATA ed TYPE REF TO cl_gui_rtf_editor.

PARAMETERS dummy TYPE flag.

at SELECTION-screen output.
CREATE OBJECT ed
EXPORTING
  parent                 = cl_gui_container=>screen0
EXCEPTIONS
  OTHERS                 = 4.

CALL METHOD ed->create_editor
EXPORTING
  LEFT               = 1
  top                = 1
  height             = 500
  WIDTH              = 600
 ascii_text         = 'X'
CHANGING
  editor_id          = editor_id
EXCEPTIONS
  OTHERS             = 5 .

CALL METHOD ed->create_field
EXPORTING
  p_name     = 'HUGO'
  p_value    = 'mon texte'
  p_width    = 2000.

By the way, maybe another solution is to reuse a classic HTML text editor and embed it into a web browser (CL_GUI_HTML_VIEWER class). The web browser is one provided by Microsoft, so maybe it's better designed.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
  • Hey, Sandra. Do You know some other reports which use this appearently only for internal sap usage created texteditor ? Your example reacty really weird, and also no toolbar is available.... but I will continue to check, how good this class really is, because it is a lot faster, than btf IN PBO at least... – icbytes Aug 06 '18 at 11:13
  • The RTF editor was used by the old SAPscript editor. Use the transaction code I18N to switch to it (the default editor is MS Word). You may display the editor via transaction SO10 for instance. – Sandra Rossi Aug 06 '18 at 12:27
  • Ok, imagine, I am able to Invoke WORD... how can I put a text into it and get it out of it again.... Does SAP offer proxies/toolsets/utilities to do , what they do ? – icbytes Aug 06 '18 at 12:31
  • If you want to embed MS Word into SAP GUI, I recommend using DOI (Desktop Office Integration). Demo programs `SAPRDEMO_WORD_NOTEPAD` and `SAPRDEMOWORD97INTEGRATION`. More info: https://help.sap.com/saphelp_nw70/helpdata/en/e9/0be775408e11d1893b0000e8323c4f/frameset.htm and specifically search "word processor interface" – Sandra Rossi Aug 06 '18 at 13:08
  • An embedded word is too much. How about that option with the webbrowser ? Or embedding it into a sap-gui ? Will I need to download a proper free editor, register this one in the OLE and then I am able to call it ? Where are these steps documented ? I would like to try this approach and try to improve performance... – icbytes Aug 09 '18 at 11:55
  • OLE? So you mean a free Windows text editor software, which was developed using OLE. Difficult task to find one. Instead, it's more simple to find a rich text editor in javascript and display it using CL_GUI_HTML_VIEWER (choose a lightweight editor). Or insist on CL_GUI_RTF_EDITOR, add a nice external toolbar (CL_GUI_HTML_VIEWER / you may find it easier to use a wrapper named "[Dynamic Documents](http://help.sap.com/saphelp_nw70/helpdata/en/f0/edd938d8dbe93de10000000a11405a/frameset.htm)" -> classes CL_DD_*). – Sandra Rossi Aug 09 '18 at 14:47
  • Yes, I meant OCX. It is no problem for me to write a rich text editor in .net, will take about 1 minute. Maybe 5 minutes more to export those methods,wich allow setting/getting the editor's text. I would like to know, which steps inside SAP i would have to do, if I decide to register my own editor inside sap. – icbytes Aug 09 '18 at 14:56
  • 1
    I've never done it. If you look at the SAP control classes, they do it always the same way which looks "simple" (inheriting from cl_gui_control, pass the ProgId to the super constructor, calling methods call_method, set_property, etc.) I've also heard about transaction SOLE, I guess it's useful sometimes and there are some SAP notes which explain more about the exact use case. – Sandra Rossi Aug 10 '18 at 17:33
  • Do You have links to them at hand? – icbytes Aug 10 '18 at 18:05
  • 1
    i took the first 3 results for "SOLE" and BC-FES* components : 75594 - Troubleshooting: ABAP/4 - OLE Automation Controller ; 79280 - Automation: Understanding the Typeinfo ; 67304 - Problems with Excel97 in ABAP/4 Automation Client – Sandra Rossi Aug 10 '18 at 18:57