Skip to Content

WYSIWYG HTML Editor

I was lately trying to find an HTML WYSIWYG editor for ABAP, but I failed. I though or this was not needed so far, or the solution was not posted anywhere. So I’ve tried several times and thanks to NICEdit and this tread on SCN I found the way to make HTML WYSIWYG editor for ABAP.

My editor use CL_GUI_HTML_VIEWER to display NICEdit in container, and then thanks to POST method I put changes back to SAP. ZCL_HTML_EDITOR class,  raises an event whenever someone click on save button in the editor, so you can easily handle it and then use new HTML for your purposes. Video bellow shows the demo of usage.

NUGG with class and demo program + HTML file with editor can be found here http://abapblog.com/articles/tricks/103-wysiwyg-html-editor-in-abap

Enjoy!

16 Comments
You must be Logged on to comment or reply to a post.
    • Hello Peter,

      I was once told, "There are not stupid questions, only stupid answers." Hopefully my answer will not be considered as stupid 🙂

      My editor can be used in SAP GUI for Windows, don't know if BTF editor can, if it does then I would be glad if you could post some examples for me to try it. On my system I could not find any, but I may be looking in wrong place, as I see that BTF is linked to BSP pages?

      The main purpose of my development was to allow to have editor on one screen together with other GUI elements like ALV, and to allow users to do edit of mail body which comes out of SAP.

      Cheers

      Łukasz

  • Hi Łukasz,

    Can you help me with ZCL_HTML_EDITOR class? I need handle special characters like 燂, but CL_GUI_HTML_VIEWER class escape special characters with #.

    Thanks!

    • Hi,

      ADJUST_HTML_DATA method of CL_GUI_HTML_VIEWER class, is not able to adjust NiceEdit HTML, including <meta http-equiv="content-type" content="text/html; charset=utf-8">.

      Without this tag, the post event don't be able to return special characters. After edit HTML file including this tag manually, my report works as expected.

      Systems non unicode works well without meta tag.

      Regards

  • /
      • Hi Lukasz,

        Following is code with height & width parameters are used, but still it is not effective (SAP_BASIS Rel. 754 sp0000)

        htmleditor->show(
        iv_html |test <a href="http://abapblog.com">ABAPblog.com QWRQEWR QE QRWQER QWERWQER WQERQWERWEQR</a><br>test2|
        iv_height 800
        iv_width  = 800 )

         

        Thanks,

        Sathees

        • Hello maybe too late but we never know, i have same problem than you, editor was appearing very small.

          The problem was in class ZCL_HTML_EDITOR, method SHOW, I added two CONDENSE statement and know it works fine.

          Edit%20of%20show%20method

          Edit of show method

           

          Before concatenation result in "800 px" while we want "800px" whitout space.

          /
          Edit%20of%20show%20method