|Home • Trainings • Quiz • Tips • Tutorials • Functional • Cert Q's • Interview Q's • Jobs • Testimonials • Advertise • Contact Us|
HTML viewer in ABAP
By Ankit Doshi, TCS
This is a simple tutorial
which shows how to use the html text viewer to display the HTML contents on the
viewer can be used to display the preview of the HTML emails that are being sent
or it can be even used to display websites.
is used to display the HTML viewer.
to create a HTML Viewer:
a module pool screen with container.
reference variable for container (cl_gui_custom_container) and html
viewer(cl_gui_html_viewer) in your ABAP program.
DATA : ref_cont TYPE REF
objects for the reference variables in step#2
the method load_data of the class cl_gui_html_viewer and pass the html code to
it and it will return a URL.(variable w_url and table ts_data are of type char,
see the example given below for data declarations)
the method SHOW_URL to display the html content on screen.
In this example a
selection screen is displayed to user which takes SAP User ID as input and finds
the user name through a function module.
A custom HTML email is
created to reply the user about the invoice query that user had submitted.
This HTML email will take
the name entered by the user on the selection screen incorporate it in the HTML
email and display the HTML email to the user using the HTML viewer.
Enter the SAP User id in
the below selection screen.
On executing the above
report we get the following output.
The above screen shows us
the preview of the HTML that we created and greets the user in the HTML email
whose sap user id was entered on the selection screen.
Please send us your feedback/suggestions at webmaster@SAPTechnical.COM
©2006-2007 SAPTechnical.COM. All rights reserved.
product names are trademarks of their respective companies. SAPTechnical.COM
is in no way affiliated with SAP AG.
Graphic Design by Round the Bend Wizards