11-06-2013 4:29 PM
Guys,
I am creating html files using html tags in abap code resulting complex html tags in the report.
Is there any alternative wherein can I create a html template pass the data and generate htm file?
Any help is appreciated.
REgards,
Harsha
11-06-2013 5:03 PM
Harsha,
Absolutely. You can create an XSLT Stylesheet and then use abap command CALL TRANSFORMATION. You can add in the HTML tags you need.
If you are hosting a dynamic web page, a better option is to use a BSP application to do the transformation.
Best,
Eric
11-07-2013 4:03 AM
HI Eric,
Thanks for the reply.
Let me explain you what the code is doing -
from the itab, I am attaching html tags and downloading in the application server, then
using unix/java (system cmd) sending email to Microsoft outlook email client.
Thought of giving CSS tags instead of html, but it does not work on MS Outlook, works only
the browsers.
Could you give me some example of XSLT, is it possible to give font name, size etc?
Regards,
Harsha
11-07-2013 3:21 PM
Harasha,
Thanks for the extra info, that helps.
If you are sending email from SAP, use the business communication services API - that is far easier than system commands (unless your system is too old for that class).
CL_BCS - Generic Business Tools for Application Developers
I'm afraid any discussion of XSLT would get complicated quickly - but I can point you to some learning materials. To create one in SAP, right-click a package in the ABAP workbench and navigate to Create > Other (1) > Transformation.
Best of luck and I hope this helps!
11-09-2013 6:19 AM
Eric Peterson,
Thanks for you the info, I have gone thru w3schools and also worked on xml conversion using xslt. But, will the transformation be as flexible as htm tags in abap code? Can I define the different fonts, colors and size in a single row?
Anyway, let me also check. I have just downloaded some material on BC api.
Any help is really appreciated.
REgards,
Harsha
11-11-2013 2:33 PM
I believe you can...I've never used the transformations but I know you can change XML to XML, or ABAP to XML.
There is also a class CL_IXML to parse and render XML text but I would recommend that as a second choice, it is slower and more labor-intensive than writing a transformation.