Skip to Content
0
Former Member
Dec 07, 2015 at 10:24 AM

Template text on dynpro to be sent by mail

61 Views

Hi,

this is my first question in SCN so don't hesitate to tell me if it's placed in the wrong place.

We have following scenario which isn't working fine because it causes wrong formatting:

We have a dynpro where we want to display a long text (the goal is to send an e-mail at the end). The long text is a template text on entering the screen and this template we get by using a text module by SAP smart forms. We put this text module in a custom control using the method set_text_as_stream from class cl_gui_textedit. When the user is done with editing the text we want to send this text by e-mail. So we read the text with method get_text_as_stream from class cl_gui_textedit. And here we have the problem with the wrong formatting of the text module after the user changed it. We use the function module CONVERT_STREAM_TO_ITF_TEXT to convert the text to ITF to get more information about the formatting which was made in the custom control. After that we try to interprete this ITF-text to get a clean formated e-mail text. But our experience shows that the e-mail text isn't always right formated. For example when have a carriage return in the template text we lose this when we interprete the ITF-text and two words which were initial separated by the carriage return stick together.

As a conclusion: Do you know a way to avoid this formatting problems? If you know a better way to solve our scenario (template text on a dynpro which is sent by e-mail) please tell me and I'll try to adapt it.

Thanks.

Manuel