Application Development and Automation 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: 
Read only

Display in HTML format

Former Member
0 Likes
2,758

Hi All,

I want to display the contents of internal table in HTML format, i'm using FM www_itab_to_html. but i'm getting html code after this execution rather than displaying the contents in HTML format is there any other FM i have to use after this conversion to display the contents in html format.

Thanks&Regards

Raghavendra

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,147

You can use Class CL_GUI_HTML_VIEWER for displaying the ITAB with HTML on SAP screen.

You will have to work with a CONTAINER and the Class (just like ALV with Class).

8 REPLIES 8
Read only

FredericGirod
Active Contributor
0 Likes
2,147

Hi,

there is sample of code for displaying HTML in container in the transaction : DWDM.

Regards

Frédéric

Read only

0 Likes
2,147

also check out the package SDYNAMICDOCUMENTS for advanced use of HTML within SAPGUI

Regards

Raja

Read only

Former Member
0 Likes
2,147

Hi,

Please Try this out. After converting itab data

to HTML, do the below.

1) First donwload the itab to some file like below.

CALL FUNCTION 'WS_DOWNLOAD'

EXPORTING

FILENAME = 'C:\TABLEVIEW.HTM'

TABLES

DATA_TAB = HTMLVIEW.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

2) Then call the function module

CALL FUNCTION 'WS_EXECUTE'

EXPORTING

COMMANDLINE = 'c:\tableview.htm'

PROGRAM = 'C:\PROGRA1\INTERN1\IEXPLORE.EXE'.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

This opens in a Explorer. Hope this will help you.

Thanks & Regards,

Siri.

Read only

Former Member
0 Likes
2,147

Hi Srilataha,

it's workin thanks .

Regards

Raghavendra

Read only

0 Likes
2,147

Hi Raghavendra,

I forgot to mention, after coming out of the program.

If you want, you can delete the file using below

function module programitically.

CALL FUNCTION 'WS_FILE_DELETE'

EXPORTING

FILE = V_FNAME

  • IMPORTING

  • RETURN =

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

If you feel it is helpful kindly award some points.

Thanks & Regards,

Siri.

Read only

Former Member
0 Likes
2,148

You can use Class CL_GUI_HTML_VIEWER for displaying the ITAB with HTML on SAP screen.

You will have to work with a CONTAINER and the Class (just like ALV with Class).

Read only

0 Likes
2,147

Cyril,

Do you have an example of how to display an ITAB using CL_GUI_HTML_VIEWER? I am guessing it is through method LOAD_DATA, but I am unsure the parameters.

Just as a side note, I am trying to develop a standard header for our ALV reports using the HTML header functionality. So if you have any experience with that, it woudl be much appreciated.

Read only

Former Member
0 Likes
2,147

Hi Raghavendra,

i guess you can use the "Call transformatin ID" command to convert internal table data into HTML format .

Regards,

Kali Pramod