Skip to Content

Convert HTML to plain text?


for a multipart e-mail I want to convert HTML into plain text in ABAP. This means e.g. to remove the <tags> and replace <br>, <p> with CR/LF and more.

Do I have to reinvent this coding on my own or can I use something?

Thanks very much for any ideas!

Best regards,


Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Nov 11, 2003 at 05:25 PM

    Hallo Oliver,

    Probably in the end you will have to do some inventing yourself. Let me give some bits and pieces.

    Probably as first step, put in the CR/LF sequences.


    OF ' sequences.

    WHILE line CP '<>*'.

    offset = sy-fdpos.

    IF line CA '>'. ENDIF.

    length = sy-fdpos + 1.

    CONCATENATE line0(offset) linelength(*) INTO line.


    CONDENSE line.

    However, I am not sure if you will be totally happy with such output. It is not bad. Have used it myself once before.

    As final idea, consider an HTML encoding, just to be sure 😊

    line = CL_HTTP_UTILITY=>ESCAPE_HTML( line ).

    bye, brian

    Add a comment
    10|10000 characters needed characters exceeded

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.