‎2011 Mar 21 6:47 PM
Hi All,
I am using create_document method to send email that comprises of listing internal table as email body. However since the data of internal table varies in length the formatting does not look good. Is there a way to achieve the output in a table format?
|Plant|Material |Description |Batch
|ABCD|MAT1 |Descritption1234 |BATCH1
|ABCD|MAT1 |Descritption1 |BATCH2
Thanks for you help.
‎2011 Mar 21 6:54 PM
If you send the content as text, simply wrapp your data with html <table> tag. This way formating of columns can be controlled by means of tag attributes.
Regards
Marcin
‎2011 Mar 21 6:54 PM
If you send the content as text, simply wrapp your data with html <table> tag. This way formating of columns can be controlled by means of tag attributes.
Regards
Marcin
‎2011 Mar 21 7:39 PM
Hello Marcin,
Thanks for your quick reply. I looked at the documenation but was not much of help.
Appreciate if you can copy a small example which can help me understand.
Thank you once again.
‎2011 Mar 22 11:10 AM
Some draft
data body type string.
data l_htmlext type soli_tab,
"create html format string
concatenate body '<html><body><table>' into body.
loop at itab1.
"here add table content within rows (<tr>) and cells (<td>)
concatenate body '<tr><td>' itab1-field1 '</td><td>' itab1-field2 '</td></tr>' into body.
endloop.
"close table
concatenate body '</table>' into body.
"here add your other tables
"...
"now close html format
concatenate body '</body></html>' into body.
"transfer to table type
call function 'SCMS_STRING_TO_FTEXT'
exporting text = body tables ftext_tab = l_htmltext.
"Set your document to accept html body
document = cl_document_bcs=>create_document( i_type = 'HTM'
i_text = l_htmltext ... ).
Regards
Marcin