Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

html tags in abap

Former Member
0 Kudos

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

5 REPLIES 5

Former Member
0 Kudos

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

0 Kudos

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

0 Kudos

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.

w3schools - XSLT Tutorial

Best of luck and I hope this helps!

0 Kudos

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

0 Kudos

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.