<?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: BCS Classes in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bcs-classes/m-p/2661493#M614006</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 have develop this code to send multiple HTML attachments using CL_BCS class&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Form f_send_html_mail.
  data: send_request       type ref to cl_bcs.
  data: document           type ref to cl_document_bcs.
  data: sender             type ref to cl_sapuser_bcs.
  data: recipient          type ref to if_recipient_bcs.
  data: exception_info     type ref to if_os_exception_info,
  bcs_exception            type ref to cx_document_bcs.

  data i_attachment_size type sood-objlen.
  data v_status          type bcs_stml.
  data v_request_status  type bcs_rqst.

  data : v_desc like sopcklsti1-obj_descr.

      concatenate 'Doc-' pdocno into v_desc.
      condense v_desc no-gaps.
      submit yttcr0001 exporting list to memory
               with p_docno = pdocno
               and return.

    call function 'LIST_FROM_MEMORY'
      tables
        listobject = report_list
      exceptions
        not_found  = 1
        others     = 2.

    call function 'WWW_HTML_FROM_LISTOBJECT'
      exporting
        template_name = 'WEBREPORTING_REPORT'
      tables
        html          = report_html
        listobject    = report_list.

    describe table objbin lines tab_lines.
    v_lines = tab_lines + 1.

    loop at report_html.
      move report_html to it_attach1.
      append it_attach1.
    endloop.

  send_request = cl_bcs=&amp;gt;create_persistent( ).
  try.
      document = cl_document_bcs=&amp;gt;create_document(
                                    i_type    = 'RAW'
                                    i_text = it_content[]
                                    i_subject = subject ).
      if not attach_name1 is initial.
        call method document-&amp;gt;add_attachment
          exporting
            i_attachment_type    = attach_ext1
            i_attachment_subject = attach_name1
            i_att_content_text   = it_attach1[].
      endif.
     "&amp;lt;&amp;lt;&amp;lt; if you want multiple attachment then use this
      if not attach_name2 is initial.
        call method document-&amp;gt;add_attachment
          exporting
            i_attachment_type    = attach_ext2
            i_attachment_subject = attach_name2
            i_att_content_text   = it_attach2[].
      endif.

      call method send_request-&amp;gt;set_document( document ).
      sender = cl_sapuser_bcs=&amp;gt;create( sy-uname ).

      call method send_request-&amp;gt;set_sender
        exporting
          i_sender = sender.

      loop at it_recipient.
        translate it_recipient-smtp_addr to lower case.
        recipient = cl_cam_address_bcs=&amp;gt;create_internet_address( it_recipient-smtp_addr ).
        call method send_request-&amp;gt;add_recipient
          exporting
            i_recipient  = recipient
            i_express    = ' '
            i_copy       = ' '
            i_blind_copy = ' '
            i_no_forward = ' '.
      endloop.
      move : 'E' to v_request_status.
      v_status = v_request_status.
      call method send_request-&amp;gt;set_status_attributes
        exporting
          i_requested_status = v_request_status
          i_status_mail      = v_status.
      call method send_request-&amp;gt;send( ).
      commit work.
    catch cx_document_bcs into bcs_exception.
  endtry.
endform.                                
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aRs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Aug 2007 19:53:48 GMT</pubDate>
    <dc:creator>former_member194669</dc:creator>
    <dc:date>2007-08-10T19:53:48Z</dc:date>
    <item>
      <title>BCS Classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bcs-classes/m-p/2661492#M614005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am looking for code example on how to send email using HTML format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Daniel Cantin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2007 15:54:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bcs-classes/m-p/2661492#M614005</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-10T15:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: BCS Classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bcs-classes/m-p/2661493#M614006</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 have develop this code to send multiple HTML attachments using CL_BCS class&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Form f_send_html_mail.
  data: send_request       type ref to cl_bcs.
  data: document           type ref to cl_document_bcs.
  data: sender             type ref to cl_sapuser_bcs.
  data: recipient          type ref to if_recipient_bcs.
  data: exception_info     type ref to if_os_exception_info,
  bcs_exception            type ref to cx_document_bcs.

  data i_attachment_size type sood-objlen.
  data v_status          type bcs_stml.
  data v_request_status  type bcs_rqst.

  data : v_desc like sopcklsti1-obj_descr.

      concatenate 'Doc-' pdocno into v_desc.
      condense v_desc no-gaps.
      submit yttcr0001 exporting list to memory
               with p_docno = pdocno
               and return.

    call function 'LIST_FROM_MEMORY'
      tables
        listobject = report_list
      exceptions
        not_found  = 1
        others     = 2.

    call function 'WWW_HTML_FROM_LISTOBJECT'
      exporting
        template_name = 'WEBREPORTING_REPORT'
      tables
        html          = report_html
        listobject    = report_list.

    describe table objbin lines tab_lines.
    v_lines = tab_lines + 1.

    loop at report_html.
      move report_html to it_attach1.
      append it_attach1.
    endloop.

  send_request = cl_bcs=&amp;gt;create_persistent( ).
  try.
      document = cl_document_bcs=&amp;gt;create_document(
                                    i_type    = 'RAW'
                                    i_text = it_content[]
                                    i_subject = subject ).
      if not attach_name1 is initial.
        call method document-&amp;gt;add_attachment
          exporting
            i_attachment_type    = attach_ext1
            i_attachment_subject = attach_name1
            i_att_content_text   = it_attach1[].
      endif.
     "&amp;lt;&amp;lt;&amp;lt; if you want multiple attachment then use this
      if not attach_name2 is initial.
        call method document-&amp;gt;add_attachment
          exporting
            i_attachment_type    = attach_ext2
            i_attachment_subject = attach_name2
            i_att_content_text   = it_attach2[].
      endif.

      call method send_request-&amp;gt;set_document( document ).
      sender = cl_sapuser_bcs=&amp;gt;create( sy-uname ).

      call method send_request-&amp;gt;set_sender
        exporting
          i_sender = sender.

      loop at it_recipient.
        translate it_recipient-smtp_addr to lower case.
        recipient = cl_cam_address_bcs=&amp;gt;create_internet_address( it_recipient-smtp_addr ).
        call method send_request-&amp;gt;add_recipient
          exporting
            i_recipient  = recipient
            i_express    = ' '
            i_copy       = ' '
            i_blind_copy = ' '
            i_no_forward = ' '.
      endloop.
      move : 'E' to v_request_status.
      v_status = v_request_status.
      call method send_request-&amp;gt;set_status_attributes
        exporting
          i_requested_status = v_request_status
          i_status_mail      = v_status.
      call method send_request-&amp;gt;send( ).
      commit work.
    catch cx_document_bcs into bcs_exception.
  endtry.
endform.                                
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aRs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2007 19:53:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bcs-classes/m-p/2661493#M614006</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-08-10T19:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: BCS Classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bcs-classes/m-p/2661494#M614007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check out this &amp;lt;a href="/people/thomas.jung3/blog/2005/01/05/develop-a-web-service-that-sends-an-email--in-abap log&amp;lt;/a&amp;gt; from Thomas Jung.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It goes very well through how to send an email from ABAP using the BCS Classes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't get onto my customers' system at the moment, but I am pretty sure that the document type for HTML email is '&amp;lt;b&amp;gt;HTM&amp;lt;/b&amp;gt;' instead of '&amp;lt;b&amp;gt;RAW&amp;lt;/b&amp;gt;'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Graham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2007 23:28:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bcs-classes/m-p/2661494#M614007</guid>
      <dc:creator>GrahamRobbo</dc:creator>
      <dc:date>2007-08-10T23:28:05Z</dc:date>
    </item>
  </channel>
</rss>

