<?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 Send It to Html with header in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-it-to-html-with-header/m-p/4632202#M1090812</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;i use the fm WWW_ITAB_TO_HTML to send internal table to html ,&lt;/P&gt;&lt;P&gt;the problem is that i dont get the header i now that there is Fm:&lt;/P&gt;&lt;P&gt;WWW_ITAB_TO_HTML_HEADERS that i put there the header , but i saw the documentation of the fm and i have to s&lt;STRONG&gt;end every Colman name manually&lt;/STRONG&gt; there  is a way to do it dynamic ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Oct 2008 09:54:52 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-10-21T09:54:52Z</dc:date>
    <item>
      <title>Send It to Html with header</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-it-to-html-with-header/m-p/4632202#M1090812</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;i use the fm WWW_ITAB_TO_HTML to send internal table to html ,&lt;/P&gt;&lt;P&gt;the problem is that i dont get the header i now that there is Fm:&lt;/P&gt;&lt;P&gt;WWW_ITAB_TO_HTML_HEADERS that i put there the header , but i saw the documentation of the fm and i have to s&lt;STRONG&gt;end every Colman name manually&lt;/STRONG&gt; there  is a way to do it dynamic ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2008 09:54:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-it-to-html-with-header/m-p/4632202#M1090812</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-21T09:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Send It to Html with header</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-it-to-html-with-header/m-p/4632203#M1090813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2008 11:16:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-it-to-html-with-header/m-p/4632203#M1090813</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-21T11:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: Send It to Html with header</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-it-to-html-with-header/m-p/4632204#M1090814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ferry ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take a look the below code that Jose send to me maybe it helps .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: send_request  TYPE REF TO cl_bcs,
      document      TYPE REF TO cl_document_bcs,
      recipient     TYPE REF TO cl_cam_address_bcs,
      bcs_exception TYPE REF TO cx_bcs,
      sent_to_all   TYPE os_boolean,
      lt_tab        TYPE TABLE OF makt,
      lt_fields     TYPE TABLE OF w3fields,
      lt_html       TYPE TABLE OF w3html.
 
PARAMETER mailid TYPE adr6-smtp_addr.
 
SELECT * FROM makt UP TO 10 ROWS INTO TABLE lt_tab WHERE spras = 'E'.
 
CALL FUNCTION 'WWW_ITAB_TO_HTML'
  TABLES
    html   = lt_html[]
    fields = lt_fields
    itable = lt_tab.
 
TRY.
    send_request = cl_bcs=&amp;gt;create_persistent( ).
    document = cl_document_bcs=&amp;gt;create_document(  i_type    = 'HTM'
                                                  i_text    = lt_html
                                                  i_subject = 'Table' ).
    send_request-&amp;gt;set_document( document ).
    recipient = cl_cam_address_bcs=&amp;gt;create_internet_address( mailid ).
    send_request-&amp;gt;add_recipient( EXPORTING i_recipient = recipient
                                           i_express   = 'X' ).
    send_request-&amp;gt;set_send_immediately( 'X' ).
    send_request-&amp;gt;send( EXPORTING i_with_error_screen = 'X'
                        RECEIVING result              = sent_to_all ).
    COMMIT WORK.
 
  CATCH cx_bcs INTO bcs_exception.
    EXIT.
ENDTRY.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2008 08:53:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-it-to-html-with-header/m-p/4632204#M1090814</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-22T08:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: Send It to Html with header</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-it-to-html-with-header/m-p/4632205#M1090815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Arona,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for yuor Replay,&lt;/P&gt;&lt;P&gt;my problem is how to add the Header of the colman to HTML,&lt;/P&gt;&lt;P&gt;in your program it move only the body of the table i need the &lt;STRONG&gt;colman name&lt;/STRONG&gt; to .&lt;/P&gt;&lt;P&gt;i need it for sending mail with internal table at the end .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt; Ferry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2008 11:19:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-it-to-html-with-header/m-p/4632205#M1090815</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-22T11:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: Send It to Html with header</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-it-to-html-with-header/m-p/4632206#M1090816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ferry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It appears to me that these Func modules are bit simillar to our&lt;/P&gt;&lt;P&gt;ALV FMs. We have to pass 1) a &lt;STRONG&gt;data table&lt;/STRONG&gt; and 2) Either a &lt;STRONG&gt;header table&lt;/STRONG&gt; (like our field catalog) or a &lt;STRONG&gt;DDIC structure name&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In our internal table the no of fields is going to be constant( unless u use a dynamic int table ). So we can build the header &lt;/P&gt;&lt;P&gt;manually as we do for field catalog table in ALV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;btw are u using a dynamic internal table??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Jose.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2008 14:49:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-it-to-html-with-header/m-p/4632206#M1090816</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-22T14:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: Send It to Html with header</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-it-to-html-with-header/m-p/4632207#M1090817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Josh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for Replay!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes i want to use dynmic internal table .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2008 14:58:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-it-to-html-with-header/m-p/4632207#M1090817</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-22T14:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: Send It to Html with header</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-it-to-html-with-header/m-p/4632208#M1090818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 " get for fields for your itab
  i_ref_descr ?= cl_abap_typedescr=&amp;gt;describe_by_data( ITAB ).
  i_details[] = i_ref_descr-&amp;gt;components[].

  data : v_head TYPE w3head.

  loop at i_details into wa_details.
     select single * from dd04t into wa_dd04t
            where rollname = wa_details-name.
     if sy-subrc eq 0.
       v_head-text = wa_dd04t-SCRTEXT_M.

*-Fill Column Headings

    CALL FUNCTION 'WWW_ITAB_TO_HTML_HEADERS'
      EXPORTING
        field_nr = sy-tabix
        text     = v_head-text
      TABLES
        header   = t_colhdr.
     endif. 
  endloop.


  CALL FUNCTION 'WWW_ITAB_TO_HTML'
    EXPORTING
      table_header = wa_header
    TABLES
      html         = i_html
      fields       = i_fields
      row_header   = i_colhdr
      itable       = i_output.     

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2008 15:33:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-it-to-html-with-header/m-p/4632208#M1090818</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2008-10-22T15:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: Send It to Html with header</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-it-to-html-with-header/m-p/4632209#M1090819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ferry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the below example...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here i hav used a dynamic int table ( u can specify any DB table and any two of its fields as parameters )&lt;/P&gt;&lt;P&gt;and used the same code (as in the other thread).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now first 10 records(only the two specified fields) of the specified DB table is sent as mail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPE-POOLS abap.

PARAMETERS : table  TYPE tabname   DEFAULT 'MAKT' ,
             field1 TYPE fieldname DEFAULT 'MATNR',
             field2 TYPE fieldname DEFAULT 'MAKTX',
             mailto TYPE adr6-smtp_addr.

DATA : lt_comp_tab    TYPE abap_component_tab WITH HEADER LINE,
       tab_ref        TYPE REF TO data,
       line_ref       TYPE REF TO data,
       line_type      TYPE REF TO cl_abap_structdescr,
       tab_type       TYPE REF TO cl_abap_tabledescr,
       data_describer TYPE REF TO cl_abap_datadescr.

DATA: lo_send_request TYPE REF TO cl_bcs,
      lo_document      TYPE REF TO cl_document_bcs,
      lo_recipient     TYPE REF TO cl_cam_address_bcs,
      lo_exception     TYPE REF TO cx_bcs,
      lv_sent_to_all   TYPE os_boolean,
      lt_fields        TYPE TABLE OF w3fields WITH HEADER LINE,
      lt_header        TYPE TABLE OF w3head   WITH HEADER LINE,
      lt_html          TYPE TABLE OF w3html   WITH HEADER LINE,
      ls_tab_header    TYPE w3head.

FIELD-SYMBOLS : &amp;lt;table&amp;gt; TYPE table,
                &amp;lt;line&amp;gt;  TYPE ANY,
                &amp;lt;field&amp;gt; TYPE ANY.

lt_comp_tab-name =  field1.
lt_comp_tab-type ?= cl_abap_datadescr=&amp;gt;describe_by_data( field1 ).
APPEND lt_comp_tab.

lt_comp_tab-name =  field2.
lt_comp_tab-type ?= cl_abap_datadescr=&amp;gt;describe_by_data( field2 ).
APPEND lt_comp_tab.

line_type ?= cl_abap_structdescr=&amp;gt;create( lt_comp_tab[] ).
tab_type  ?= cl_abap_tabledescr=&amp;gt;create( line_type ).

CREATE DATA : tab_ref  TYPE HANDLE tab_type,
              line_ref TYPE HANDLE line_type.

ASSIGN tab_ref-&amp;gt;*  TO &amp;lt;table&amp;gt;.
ASSIGN line_ref-&amp;gt;* TO &amp;lt;line&amp;gt;.

SELECT * FROM (table) INTO CORRESPONDING FIELDS OF TABLE &amp;lt;table&amp;gt; UP TO 10 ROWS.

MOVE 'Genetated List' TO ls_tab_header-text.
MOVE 'Arial'          TO ls_tab_header-font.
MOVE '2'              TO ls_tab_header-size.

LOOP AT lt_comp_tab.
  MOVE lt_comp_tab-name TO lt_header-text.
  SELECT SINGLE reptext FROM dd04t INTO lt_header-text WHERE rollname   = lt_header-text
                                                         AND ddlanguage = sy-langu.
  MOVE : sy-tabix         TO lt_header-nr,
         'orange'         TO lt_header-bg_color.
  APPEND lt_header.
ENDLOOP.

CALL FUNCTION 'WWW_ITAB_TO_HTML'
  EXPORTING
    table_header = ls_tab_header
  TABLES
    html         = lt_html[]
    fields       = lt_fields[]
    row_header   = lt_header[]
    itable       = &amp;lt;table&amp;gt;.

TRY.
    lo_send_request = cl_bcs=&amp;gt;create_persistent( ).
    lo_document = cl_document_bcs=&amp;gt;create_document( i_type    = 'HTM'
                                                    i_text    = lt_html[]
                                                    i_subject = 'Table' ).
    lo_send_request-&amp;gt;set_document( lo_document ).
    lo_recipient = cl_cam_address_bcs=&amp;gt;create_internet_address( mailto ).
    lo_send_request-&amp;gt;add_recipient( EXPORTING i_recipient = lo_recipient
                                              i_express   = 'X' ).
    lo_send_request-&amp;gt;set_send_immediately( 'X' ).
    lv_sent_to_all = lo_send_request-&amp;gt;send( 'X' ).
    COMMIT WORK.

  CATCH cx_bcs INTO lo_exception.
    EXIT.
ENDTRY.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Jose.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2008 15:54:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-it-to-html-with-header/m-p/4632209#M1090819</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-22T15:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Send It to Html with header</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/send-it-to-html-with-header/m-p/4632210#M1090820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Josh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!!!&lt;/P&gt;&lt;P&gt;Thanks for your  patience  &lt;STRONG&gt;You Are amazing&lt;/STRONG&gt; &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt; , &lt;/P&gt;&lt;P&gt;Plz write the same solution in abap objects so i can close the post   .&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2008 16:09:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/send-it-to-html-with-header/m-p/4632210#M1090820</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-22T16:09:19Z</dc:date>
    </item>
  </channel>
</rss>

