generate HTML output from SMARTFORM and send it as email body

Rate this post

There was a standard process in our system which sends a text as the body of a mail, after a certain operation is completed. For this program a change had been done so that the program could send a custom SMARTFORM as a PDF attachment beside to the text body. This change had been done as a repair in a program. So far so good, everything was working fine.
After then a requirement from the client was arisen. They wanted to see the attached PDF document inside the body of the mail. First we tried to populate the body text from the RAW format of SMARTFORM. Unfortunately the formats in the PDF, like tables, fonts, headings etc was not reflected in HTML body of the mail. With a bit detailed search on Google we found out that there are different Output Format options for SMARTFORM. And one of them is XSF Output+HTML which we should use in order to get a proper HTML output besides XSF(SMARTFORMS standard output). You can do this either changing the default output format of from the SMARTFORMS->Global Settings->Form Attributes->Output->Output Format to XSF Output + HTML or changing it from the code that triggers the smartform as we did in the below code. Using the second method we could get the HTML data in XMLOUTPUT of the returning structure.

You may also like

  • add metadata to PDF document in ABAP (0)
    Recently we have encountered a security problem during sending PDF documents to external mail addresses. Working on the issue we detected that the reason why we can not send PDF […]
  • convert smartforms into PDF format and download to your local (0)
    For print-outs many technologies has been put into service by SAP till today. ABAP'ers in my generation have mostly encountered with SmartForm technology. Before SmartForm there used to be […]
  • transport SO10 standard text objects (0)
    In smartforms and sapscript technologies standard texts are used for outputting fixed texts like company information, address or other templates. These standard texts are created from SO10 […]