<?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: Batch Email in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/batch-email/m-p/5074764#M1178813</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thankyou very much Marcin for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Solved a very big headache!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Jan 2009 08:00:32 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-01-22T08:00:32Z</dc:date>
    <item>
      <title>Batch Email</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/batch-email/m-p/5074762#M1178811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've written a program which runs daily in batch and produces a file on &lt;/P&gt;&lt;P&gt;the application server. Because this program runs in batch is there &lt;/P&gt;&lt;P&gt;anyway I can have an automated email if the program produces a file. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure if you can do this in the background or not??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help much appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2009 07:27:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/batch-email/m-p/5074762#M1178811</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-22T07:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Email</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/batch-email/m-p/5074763#M1178812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sure you can. In your program write a procedure for sending email and then all you need is to call a program releaseing the document to be sent in the background mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample code for sending email in background mode.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT z_ext_email NO STANDARD PAGE HEADING.

CONSTANTS con_cret(2) TYPE c VALUE cl_abap_char_utilities=&amp;gt;cr_lf.

DATA: doc_attr TYPE sodocchgi1,
      it_packing_list TYPE TABLE OF sopcklsti1 WITH HEADER LINE,
      it_message TYPE TABLE OF solisti1 WITH HEADER LINE,
      it_attachment TYPE TABLE OF solisti1 WITH HEADER LINE,
      it_txt TYPE TABLE OF solisti1 WITH HEADER LINE,
      it_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE.

"Document attributes
doc_attr-obj_name = 'EXT_MAIL'.
doc_attr-obj_descr = 'External test mail'.   "title
doc_attr-obj_langu = sy-langu.
doc_attr-sensitivty = 'F'.      "functional message

"Message in ASCII (txt) format
APPEND 'This is body message' TO it_message.   "message is from 1 to 2
APPEND 'and second line for message.' TO it_message.
APPEND LINES OF it_message TO it_txt.

"Determine how data are distrtibuted to document and attachment
"First line in it_packing describes message body
it_packing_list-transf_bin = space.  "ASCII format
it_packing_list-body_start = 1.      "message body starts from 1st line
DESCRIBE TABLE it_message LINES it_packing_list-body_num.  "lines in it_txt table for message body
it_packing_list-doc_type = 'RAW'.
APPEND it_packing_list.

"Attachment in ASCII (txt) format
APPEND 'This is body of an attachment' TO it_attachment.
CONCATENATE con_cret  'and the second line for it.' INTO it_attachment.
APPEND it_attachment.
APPEND LINES OF it_attachment TO it_txt.

"Further lines in it_packing describe attachment
CLEAR it_packing_list.
it_packing_list-transf_bin = space.  "ASCII format
it_packing_list-body_start = 3.
DESCRIBE TABLE it_attachment LINES it_packing_list-body_num.
it_packing_list-doc_type = 'txt'.
it_packing_list-obj_name = 'Test attachment'.
it_packing_list-obj_descr = 'Title of an attachment'.
it_packing_list-obj_langu = sy-langu.
"size od attachment = length of last line + all remaining lines * 255
READ TABLE it_attachment INDEX it_packing_list-body_num.
it_packing_list-doc_size = STRLEN( it_attachment ) + 255 * ( it_packing_list-body_num - 1 ).
APPEND it_packing_list.

"Receivers
it_receivers-receiver =  'Some_email_address'.
it_receivers-rec_type = 'U'.  "internet address
it_receivers-com_type = 'INT'. "send via internet
APPEND it_receivers.

CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
  EXPORTING
    document_data                    = doc_attr
    put_in_outbox                    = 'X'
    commit_work                      = 'X'
  TABLES
    packing_list                     = it_packing_list
   contents_txt                     = it_txt
    receivers                        = it_receivers.
 EXCEPTIONS
   TOO_MANY_RECEIVERS               = 1
   DOCUMENT_NOT_SENT                = 2
   DOCUMENT_TYPE_NOT_EXIST          = 3
   OPERATION_NO_AUTHORIZATION       = 4
   PARAMETER_ERROR                  = 5
   X_ERROR                          = 6
   ENQUEUE_ERROR                    = 7
   OTHERS                           = 8
IF sy-subrc = 0.
  WAIT UP TO 2 SECONDS.
  SUBMIT rsconn01 WITH mode = 'INT'
*                    WITH ouput = 'X'       "this parameter determins wheter program to be run in fore/back ground mode
                  AND RETURN.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2009 07:48:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/batch-email/m-p/5074763#M1178812</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2009-01-22T07:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Email</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/batch-email/m-p/5074764#M1178813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thankyou very much Marcin for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Solved a very big headache!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2009 08:00:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/batch-email/m-p/5074764#M1178813</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-22T08:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Email</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/batch-email/m-p/5074765#M1178814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have similar question about sending SD document (eg. billing doc) out to customer's email in the customer master.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. I have assign the output medium to 5 (External send) and the email with the billing doc attached was sent out ok.&lt;/P&gt;&lt;P&gt;2. But now I want to send a few billing doc belonging to the same customer in ONE email; have you done something like that or it is possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Patrick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Mar 2009 05:53:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/batch-email/m-p/5074765#M1178814</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-13T05:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Email</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/batch-email/m-p/5074766#M1178815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would imagine that you just append the different email addresses to the table&lt;/P&gt;&lt;P&gt;it_receivers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2009 07:48:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/batch-email/m-p/5074766#M1178815</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-17T07:48:58Z</dc:date>
    </item>
  </channel>
</rss>

