cancel
Showing results for 
Search instead for 
Did you mean: 

HTML to Smartform/SapScript

Former Member
0 Kudos

Hi there,

I have the request to implement a Smartform with an input parameter type string that contains html code. This code should be printed in the main window as formatted text with format based only on the html code and not on the smartform style...

Any idea???

Thank you very much!

Davide Provasi

Edited by: davide provasi on May 18, 2010 4:38 PM

Accepted Solutions (1)

Accepted Solutions (1)

Sandra_Rossi
Active Contributor
0 Kudos

SAP is not able to render exactly an HTML (and probably CSS?), it's very complex to do! SAP is only able to convert an ABAP list or text or ITF or RTF to HTML, but not from HTML to any format. Moreover Smart Form and SAPscript forms have many limitations so they couldn't support all HTML features.

First, you need an external software. Second, what do you want to do exactly with the "print version of the HTML", what is the context?

The only workaround I know is working, if you run it interactively (?) you may use MS Word to load the HTML and print it on any of the frontend printer (if you run it in background, you should implement a Windows RFC server to do the same thing).

You may also purchase external softwares that are certified by SAP to work with their XDC interface (search SDN articles).

Former Member
0 Kudos

I was thinking about something more simple, like a function module to trasnfrom html into a table based on TLINE structure...

I can develop it selecting just few formatting tags and ignoring the others and convert them to peragrph types.

Do you know any helpfull function I can use?

Sandra_Rossi
Active Contributor
0 Kudos

I don't know any function module to do that.

If you know (or keen to learn) XSLT or simple transformations (CALL TRANSFORMATION), it would be rather easy. You may also use iXML APIs (CL_IXML and so on). Search SDN for more information.

You'll maybe have to convert the HTML into XML if the HTML is not "strict", i.e. not fully compatible with XML (for example newline tags <BR> instead of <BR/>).

Note that you may be disappointed if HTML contains tables for example, you won't be able to render them correctly.

Answers (0)