2012 Jun 05 9:27 PM
I am writing an ABAP which sends out emails in an html format with a few standard paragraphs in it and then some data I am looping though. Everything works great – however I would like to find a way to “house” these standard paragraphs somewhere so I don’t have to include this in text elements in the ABAP. I tried storing it in SO10 and the text is retrieved however any of the paragraph breaks are ignored and the sentences run together. Does anyone have any suggestions or is the only want to do this through text elements? Just as an fyi, this is the type of e-mail code I am using
send_request = cl_bcs=>create_persistent( ).
send_request->set_priority( i_priority = '1' ).
document = cl_document_bcs=>create_document(
i_type = 'HTM'
i_text = t_email_body
i_subject = email_subject ).
send_request->set_document( document )
2012 Jun 05 10:26 PM
Hi,
Here you indicate your code to send the HTML, but the interesting part is how do you convert your "standard text" (SO10) into HTML? For that, you may use CONVERT_ITF_TO_HTML function module.
Regards,
Sandra
2012 Jun 05 10:26 PM
Hi,
Here you indicate your code to send the HTML, but the interesting part is how do you convert your "standard text" (SO10) into HTML? For that, you may use CONVERT_ITF_TO_HTML function module.
Regards,
Sandra
2012 Jun 05 10:34 PM
Good question and I should have included this. I create the Standard Text with SO10 and then I read it with the function READ_TEXT.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'ST'
language = 'EN'
name = p_mytext
object = 'TEXT'
TABLES
lines = i_tline
Does CONVERT_ITF_TO_HTML read from SO10 and if not then where would I store these "Standard Paragraphs". Also do you have some sample code at all by any chance. thx for your help!
2012 Jun 05 10:46 PM
You must keep READ_TEXT which reads the standard text, which is in ITF format (see by debug your i_tline data object). Moreover, add IMPORTING HEADER = ls_header. You have to convert the ITF into HTML by using the function module CONVERT_ITF_TO_HTML.
You should get something like that, more or less:
DATA lt_htmlline TYPE TABLE OF htmlline.
CALL FUNCTION 'CONVERT_ITF_TO_HTML'
EXPORTING
I_HEADER = ls_header
I_HTML_HEADER = space
TABLES
T_ITF_TEXT = i_tline
t_html_text = lt_htmlline.
CONCATENATE LINES OF lt_htmlline INTO t_email_body.
Sandra
Message was edited by: Matthew Billingham - minor correction
2012 Jun 06 3:07 PM
Thank you very much! I just have one more problem and that is how it is converting the Line spacing. It is double spacing the lines and I am assuming this is the because of the Paragraphs html codes. Do you have any suggestions on what I can do to fix this?
Text in SO10
Hello,
This is Line 1.
This is Line2.
This is Line 3
HTML From Convert Function
<P>Hello,</P>
<P></P>
<P>This is Line 1.</P>
<P>This is Line 2.</P>
<P>This is Line 3.</P>
It is coming out double spaces as follows
Hello,
This is Line 1.
This is Line 2.
This is Line 3.
2012 Jun 06 4:05 PM
Hi,
Here the HTML is correct. So I guess the issue is from the software that renders the HTML.
Sandra
2012 Jun 06 4:53 PM
2014 Feb 19 6:59 AM
2014 Feb 19 9:14 AM