<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: how to convert table content into html format? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-content-into-html-format/m-p/4746039#M1113221</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank u&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Dec 2008 09:20:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-12-03T09:20:54Z</dc:date>
    <item>
      <title>how to convert table content into html format?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-content-into-html-format/m-p/4746032#M1113214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to convert internal data into HTML format is there any function module or piece of code to download content into HTML.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank u,&lt;/P&gt;&lt;P&gt;Shabeer Ahmed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Nov 2008 10:00:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-content-into-html-format/m-p/4746032#M1113214</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-14T10:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert table content into html format?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-content-into-html-format/m-p/4746033#M1113215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Check this code...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  ytest_table_html.
*---------------------------------------------------------------------*
*          T Y P E S D E C L A R A T I O N
*---------------------------------------------------------------------*

TYPES:BEGIN OF ty_sflight,
        carrid TYPE s_carr_id,         " Airline Code
        connid TYPE s_conn_id,         " Connection Number
        fldate TYPE s_date,            " Flight Date
        price  TYPE s_price,           " AirFare
        currency TYPE s_currcode,      " Currency
      END OF ty_sflight.

*-ALL related Declarations

DATA:
  t_header TYPE STANDARD TABLE OF w3head WITH HEADER LINE,   "Header
  t_fields TYPE STANDARD TABLE OF w3fields WITH HEADER LINE, "Fields
  t_html TYPE STANDARD TABLE OF w3html,                      "Html
  wa_header TYPE w3head,
  w_head TYPE w3head.

DATA:
  it_sflight TYPE TABLE OF ty_sflight,      " Flights Details

  it_fcat TYPE lvc_t_fcat WITH HEADER LINE. " Fieldcatalog

*---------------------------------------------------------------------*
*        S T A R T - O F - S E L E C T I O N
*---------------------------------------------------------------------*

START-OF-SELECTION.

  SELECT * FROM
    sflight
    INTO CORRESPONDING FIELDS OF TABLE it_sflight
    UP TO 20 ROWS.

*---------------------------------------------------------------------*
*        E N D - O F - S E L E C T I O N
*---------------------------------------------------------------------*
END-OF-SELECTION.

*-Populate Fieldcatalog
  it_fcat-coltext = 'Airline Code'.
  APPEND it_fcat.
  it_fcat-coltext = 'Connection Number'.
  APPEND it_fcat.
  it_fcat-coltext = 'Flight date'.
  APPEND it_fcat.
  it_fcat-coltext = 'Airfare'.
  APPEND it_fcat.
  it_fcat-coltext = 'Currency'.
  APPEND it_fcat.

*-Fill the Column headings and Properties

  LOOP AT it_fcat.
    w_head-text = it_fcat-coltext.
*-Populate the Column Headings
    CALL FUNCTION 'WWW_ITAB_TO_HTML_HEADERS'
      EXPORTING
        field_nr = sy-tabix
        text     = w_head-text
        fgcolor  = 'black'
        bgcolor  = 'green'
      TABLES
        header   = t_header.
*-Populate Column Properties
    CALL FUNCTION 'WWW_ITAB_TO_HTML_LAYOUT'
      EXPORTING
        field_nr = sy-tabix
        fgcolor  = 'black'
        size     = '3'
      TABLES
        fields   = t_fields.

  ENDLOOP.

*-Title of the Display
  wa_header-text = 'Flights Details' .
  wa_header-font = 'Arial'.
  wa_header-size = '2'.

*-Preparing the HTML from Intenal Table
  REFRESH t_html.

  CALL FUNCTION 'WWW_ITAB_TO_HTML'
    EXPORTING
      table_header = wa_header
    TABLES
      html         = t_html
      fields       = t_fields
      row_header   = t_header
      itable       = it_sflight.

*-Download  the HTML into frontend

  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      filename                = 'C:\Flights.htm'
    TABLES
      data_tab                = t_html
    EXCEPTIONS
      file_write_error        = 1
      no_batch                = 2
      gui_refuse_filetransfer = 3
      invalid_type            = 4
      no_authority            = 5
      unknown_error           = 6
      header_not_allowed      = 7
      separator_not_allowed   = 8
      filesize_not_allowed    = 9
      header_too_long         = 10
      dp_error_create         = 11
      dp_error_send           = 12
      dp_error_write          = 13
      unknown_dp_error        = 14
      access_denied           = 15
      dp_out_of_memory        = 16
      disk_full               = 17
      dp_timeout              = 18
      file_not_found          = 19
      dataprovider_exception  = 20
      control_flush_error     = 21
      OTHERS                  = 22.

  IF sy-subrc &amp;lt;&amp;gt; 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

*-Display the HTML file

  CALL METHOD cl_gui_frontend_services=&amp;gt;execute
    EXPORTING
      document               = 'C:\Flights.htm'
      operation              = 'OPEN'
    EXCEPTIONS
      cntl_error             = 1
      error_no_gui           = 2
      bad_parameter          = 3
      file_not_found         = 4
      path_not_found         = 5
      file_extension_unknown = 6
      error_execute_failed   = 7
      synchronous_failed     = 8
      not_supported_by_gui   = 9
      OTHERS                 = 10.

  IF sy-subrc &amp;lt;&amp;gt; 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Nov 2008 10:13:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-content-into-html-format/m-p/4746033#M1113215</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-14T10:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert table content into html format?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-content-into-html-format/m-p/4746034#M1113216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Following Function Modules are used to convert internal table data to HTML Table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;WWW_ITAB_TO_HTML_HEADERS is used to populate column headings.
   WWW_ITAB_TO_HTML_LAYOUT is used to populate column cell properties.
   WWW_ITAB_TO_HTML is used to convert internal table data to HTML.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ranga&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Nov 2008 10:16:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-content-into-html-format/m-p/4746034#M1113216</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-14T10:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert table content into html format?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-content-into-html-format/m-p/4746035#M1113217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What ever function modules are used it above code are obsolete so any replacement for this function modules?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank u,&lt;/P&gt;&lt;P&gt;Shabeer ahmed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Nov 2008 10:23:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-content-into-html-format/m-p/4746035#M1113217</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-14T10:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert table content into html format?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-content-into-html-format/m-p/4746036#M1113218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;Ranga swamy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Those function modules are obsoleted in Ecc6.0 so any replacement to this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank U,&lt;/P&gt;&lt;P&gt;Shabeer Ahmed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Nov 2008 10:26:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-content-into-html-format/m-p/4746036#M1113218</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-14T10:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert table content into html format?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-content-into-html-format/m-p/4746037#M1113219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then use this code....&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  ytest_table_html1.
*----------------------------------------------------------------*
*        D A T A   D E C L A R A T I O N
*----------------------------------------------------------------*

*-HTML Table
DATA:
  t_html TYPE STANDARD TABLE OF w3html WITH HEADER LINE,
                                       " Html Table

*- Declare Internal table and Fieldcatalog
  it_flight TYPE STANDARD TABLE OF sflight WITH HEADER LINE,
                                       " Flights Details
  it_fcat TYPE lvc_t_fcat WITH HEADER LINE.
                                       " Fieldcatalog
*-Variables
DATA:
  v_lines TYPE i,
  v_field(40).

*-Fieldsymbols
FIELD-SYMBOLS: &amp;lt;fs&amp;gt; TYPE ANY.

*----------------------------------------------------------------*
*        S T A R T - O F - S E L E C T I O N
*----------------------------------------------------------------*
START-OF-SELECTION.

  SELECT *
    FROM sflight
    INTO TABLE it_flight
    UP TO 20 ROWS.
*----------------------------------------------------------------*
*        E N D - O F - S E L E C T I O N
*----------------------------------------------------------------*
END-OF-SELECTION.

*-Fill the Column headings and Properties
* Field catalog is used to populate the Headings and Values of 
* The table cells dynamically 
  CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
    EXPORTING
      i_structure_name       = 'SFLIGHT'
    CHANGING
      ct_fieldcat            = it_fcat[]
    EXCEPTIONS
      inconsistent_interface = 1
      program_error          = 2.

  DELETE it_fcat WHERE fieldname = 'MANDT'.

  t_html-line = '&amp;lt;html&amp;gt;'.
  APPEND t_html.
  CLEAR t_html.
  t_html-line = '&amp;lt;thead&amp;gt;'.
  APPEND t_html.
  CLEAR t_html.
  t_html-line = '&amp;lt;tr&amp;gt;'.
  APPEND t_html.
  CLEAR t_html.
  t_html-line = '&amp;lt;td&amp;gt;&amp;lt;h1&amp;gt;Flights Details&amp;lt;/h1&amp;gt;&amp;lt;/td&amp;gt;'.
  APPEND t_html.
  CLEAR t_html.
  t_html-line = '&amp;lt;/tr&amp;gt;'.
  APPEND t_html.
  CLEAR t_html.
  t_html-line = '&amp;lt;/thead&amp;gt;'.
  APPEND t_html.
  CLEAR t_html.

  t_html-line = '&amp;lt;table border = "1"&amp;gt;'.
  APPEND t_html.
  CLEAR t_html.

  t_html-line = '&amp;lt;tr&amp;gt;'.
  APPEND t_html.
  CLEAR t_html.
*-Populate HTML columns from Filedcatalog
  LOOP AT it_fcat.

    CONCATENATE '&amp;lt;th bgcolor = "green" fgcolor = "black"&amp;gt;'
        it_fcat-scrtext_l
        '&amp;lt;/th&amp;gt;' INTO t_html-line.
    APPEND t_html.
    CLEAR t_html.

  ENDLOOP.

  t_html-line = '&amp;lt;/tr&amp;gt;'.
  APPEND t_html.
  CLEAR t_html.

  DESCRIBE TABLE it_fcat LINES v_lines.
*-Populate HTML table from Internal table data
  LOOP AT it_flight.
    t_html-line = '&amp;lt;tr&amp;gt;'.
    APPEND t_html.
    CLEAR t_html.
*-Populate entire row of HTML table Dynamically
*-With the Help of Fieldcatalog.
    DO v_lines TIMES.

      READ TABLE it_fcat INDEX sy-index.
      CONCATENATE 'IT_FLIGHT-' it_fcat-fieldname INTO v_field.

      ASSIGN (v_field) TO &amp;lt;fs&amp;gt;.

      t_html-line = '&amp;lt;td&amp;gt;'.
      APPEND t_html.
      CLEAR t_html.

      t_html-line = &amp;lt;fs&amp;gt;.
      APPEND t_html.
      CLEAR t_html.

      t_html-line = '&amp;lt;/td&amp;gt;'.
      APPEND t_html.
      CLEAR t_html.

      CLEAR v_field.
      UNASSIGN &amp;lt;fs&amp;gt;.

    ENDDO.

    t_html-line = '&amp;lt;/tr&amp;gt;'.
    APPEND t_html.
    CLEAR t_html.
  ENDLOOP.
  t_html-line = '&amp;lt;/table&amp;gt;'.
  APPEND t_html.
  CLEAR t_html.
*-Download  the HTML into frontend

  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      filename                = 'C:\Flights.htm'
    TABLES
      data_tab                = t_html
    EXCEPTIONS
      file_write_error        = 1
      no_batch                = 2
      gui_refuse_filetransfer = 3
      invalid_type            = 4
      no_authority            = 5
      unknown_error           = 6
      header_not_allowed      = 7
      separator_not_allowed   = 8
      filesize_not_allowed    = 9
      header_too_long         = 10
      dp_error_create         = 11
      dp_error_send           = 12
      dp_error_write          = 13
      unknown_dp_error        = 14
      access_denied           = 15
      dp_out_of_memory        = 16
      disk_full               = 17
      dp_timeout              = 18
      file_not_found          = 19
      dataprovider_exception  = 20
      control_flush_error     = 21
      OTHERS                  = 22.

  IF sy-subrc &amp;lt;&amp;gt; 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

*-Display the HTML file

  CALL METHOD cl_gui_frontend_services=&amp;gt;execute
    EXPORTING
      document               = 'C:\Flights.htm'
      operation              = 'OPEN'
    EXCEPTIONS
      cntl_error             = 1
      error_no_gui           = 2
      bad_parameter          = 3
      file_not_found         = 4
      path_not_found         = 5
      file_extension_unknown = 6
      error_execute_failed   = 7
      synchronous_failed     = 8
      not_supported_by_gui   = 9
      OTHERS                 = 10.

  IF sy-subrc &amp;lt;&amp;gt; 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;none of the above function modules r obsolete...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Nov 2008 10:31:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-content-into-html-format/m-p/4746037#M1113219</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-14T10:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert table content into html format?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-content-into-html-format/m-p/4746038#M1113220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;those FM are obsoleted Ecc6.0 . No any replacements I think so.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Nov 2008 10:35:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-content-into-html-format/m-p/4746038#M1113220</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-14T10:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert table content into html format?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-content-into-html-format/m-p/4746039#M1113221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank u&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 09:20:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-content-into-html-format/m-p/4746039#M1113221</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-03T09:20:54Z</dc:date>
    </item>
  </channel>
</rss>

