<?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 Job in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/batch-job/m-p/5633229#M1282476</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chandra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can just schdule the program in SM36 and give the spool recepiant, it will send the spool output to the mail box, no need of writing a program which functionlity is already existing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Br/Manas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 May 2009 10:37:29 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-06T10:37:29Z</dc:date>
    <item>
      <title>Batch Job</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/batch-job/m-p/5633225#M1282472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to schedule a job which should be executed every day at specific time and want to read the output from spool after its execution to send a mail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can it be possible to achieve the above requirement with the same application which is scheduled for the batch job?&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;Chandra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2009 09:58:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/batch-job/m-p/5633225#M1282472</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-06T09:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Job</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/batch-job/m-p/5633226#M1282473</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;youcan set the job priority using sm 37 transaction after thatcheck the job status from TBTCO table and send mail using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM docu_send_email USING pv_otfdata TYPE tsfotf&lt;/P&gt;&lt;P&gt;pv_emailid TYPE any&lt;/P&gt;&lt;P&gt;pv_formname TYPE any.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: lv_filesize TYPE i,&lt;/P&gt;&lt;P&gt;lv_buffer TYPE string,&lt;/P&gt;&lt;P&gt;lv_attachment TYPE i,&lt;/P&gt;&lt;P&gt;lv_testo TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: li_pdfdata TYPE STANDARD TABLE OF tline,&lt;/P&gt;&lt;P&gt;li_mess_att TYPE STANDARD TABLE OF solisti1,&lt;/P&gt;&lt;P&gt;li_mtab_pdf TYPE STANDARD TABLE OF tline,&lt;/P&gt;&lt;P&gt;li_objpack TYPE STANDARD TABLE OF sopcklsti1,&lt;/P&gt;&lt;P&gt;li_objtxt TYPE STANDARD TABLE OF solisti1,&lt;/P&gt;&lt;P&gt;li_objbin TYPE STANDARD TABLE OF solisti1,&lt;/P&gt;&lt;P&gt;li_reclist TYPE STANDARD TABLE OF somlreci1,&lt;/P&gt;&lt;P&gt;li_objhead TYPE soli_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: lwa_pdfdata TYPE tline,&lt;/P&gt;&lt;P&gt;lwa_objpack TYPE sopcklsti1,&lt;/P&gt;&lt;P&gt;lwa_mess_att TYPE solisti1,&lt;/P&gt;&lt;P&gt;lwa_objtxt TYPE solisti1,&lt;/P&gt;&lt;P&gt;lwa_objbin TYPE solisti1,&lt;/P&gt;&lt;P&gt;lwa_reclist TYPE somlreci1,&lt;/P&gt;&lt;P&gt;lwa_doc_chng TYPE sodocchgi1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONSTANTS: lc_u TYPE char1 VALUE 'U',&lt;/P&gt;&lt;P&gt;lc_0 TYPE char1 VALUE '0',&lt;/P&gt;&lt;P&gt;lc_1 TYPE char1 VALUE '1',&lt;/P&gt;&lt;P&gt;lc_pdf TYPE char3 VALUE 'PDF',&lt;/P&gt;&lt;P&gt;lc_raw TYPE char3 VALUE 'RAW',&lt;/P&gt;&lt;P&gt;lc_ordform TYPE char15 VALUE 'ZORDCONFIRM_01',&lt;/P&gt;&lt;P&gt;lc_attachment TYPE char10 VALUE 'ATTACHMENT'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERT_OTF'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;format = lc_pdf&lt;/P&gt;&lt;P&gt;max_linewidth = 132&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;bin_filesize = lv_filesize&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;otf = pv_otfdata&lt;/P&gt;&lt;P&gt;lines = li_pdfdata&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;err_max_linewidth = 1&lt;/P&gt;&lt;P&gt;err_format = 2&lt;/P&gt;&lt;P&gt;err_conv_not_possible = 3&lt;/P&gt;&lt;P&gt;err_bad_otf = 4&lt;/P&gt;&lt;P&gt;OTHERS = 5.&lt;/P&gt;&lt;P&gt;IF sy-subrc 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT li_pdfdata INTO lwa_pdfdata.&lt;/P&gt;&lt;P&gt;TRANSLATE lwa_pdfdata USING ' ~'.&lt;/P&gt;&lt;P&gt;CONCATENATE lv_buffer lwa_pdfdata INTO lv_buffer.&lt;/P&gt;&lt;P&gt;CLEAR lwa_pdfdata.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRANSLATE lv_buffer USING '~ '.&lt;/P&gt;&lt;P&gt;DO.&lt;/P&gt;&lt;P&gt;lwa_mess_att = lv_buffer.&lt;/P&gt;&lt;P&gt;APPEND lwa_mess_att TO li_mess_att.&lt;/P&gt;&lt;P&gt;CLEAR lwa_mess_att.&lt;/P&gt;&lt;P&gt;SHIFT lv_buffer LEFT BY 255 PLACES.&lt;/P&gt;&lt;P&gt;IF lv_buffer IS INITIAL.&lt;/P&gt;&lt;P&gt;EXIT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Object with PDF.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;REFRESH li_objbin.&lt;/P&gt;&lt;P&gt;li_objbin] = li_mess_att[.&lt;/P&gt;&lt;P&gt;DESCRIBE TABLE li_objbin LINES lv_attachment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Object with main text of the mail.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;lwa_objtxt = space.&lt;/P&gt;&lt;P&gt;APPEND lwa_objtxt TO li_objtxt.&lt;/P&gt;&lt;P&gt;CLEAR lwa_objtxt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DESCRIBE TABLE li_objtxt LINES lv_testo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create the document which is to be sent&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lwa_doc_chng-obj_name = text-008.&lt;/P&gt;&lt;P&gt;lwa_doc_chng-obj_descr = text-008.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lwa_doc_chng-sensitivty = lc_0.&lt;/P&gt;&lt;P&gt;lwa_doc_chng-obj_prio = lc_1.&lt;/P&gt;&lt;P&gt;lwa_doc_chng-doc_size = lv_testo * 225.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Pack to main body.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CLEAR lwa_objpack-transf_bin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;header&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;lwa_objpack-head_start = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The document needs no header (head_num = 0)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;lwa_objpack-head_num = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;body&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;lwa_objpack-body_start = 1.&lt;/P&gt;&lt;P&gt;lwa_objpack-body_num = lv_testo.&lt;/P&gt;&lt;P&gt;lwa_objpack-doc_type = lc_raw.&lt;/P&gt;&lt;P&gt;APPEND lwa_objpack TO li_objpack.&lt;/P&gt;&lt;P&gt;CLEAR lwa_objpack.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create the attachment.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Fill the fields of the packing_list for the attachment:&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;lwa_objpack-transf_bin = gc_x .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;header&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;lwa_objpack-head_start = 1.&lt;/P&gt;&lt;P&gt;lwa_objpack-head_num = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;body&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;lwa_objpack-body_start = 1.&lt;/P&gt;&lt;P&gt;lwa_objpack-body_num = lv_attachment.&lt;/P&gt;&lt;P&gt;lwa_objpack-doc_type = lc_pdf.&lt;/P&gt;&lt;P&gt;lwa_objpack-obj_name = lc_attachment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lwa_objpack-obj_descr = text-008.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lwa_objpack-doc_size = lv_attachment * 255.&lt;/P&gt;&lt;P&gt;APPEND lwa_objpack TO li_objpack.&lt;/P&gt;&lt;P&gt;CLEAR lwa_objpack.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lwa_reclist-receiver = pv_emailid.&lt;/P&gt;&lt;P&gt;lwa_reclist-rec_type = lc_u.&lt;/P&gt;&lt;P&gt;lwa_reclist-notif_del = gc_x.&lt;/P&gt;&lt;P&gt;lwa_reclist-notif_ndel = gc_x.&lt;/P&gt;&lt;P&gt;APPEND lwa_reclist TO li_reclist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF li_reclist IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;document_data = lwa_doc_chng&lt;/P&gt;&lt;P&gt;put_in_outbox = gc_x&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;packing_list = li_objpack&lt;/P&gt;&lt;P&gt;object_header = li_objhead&lt;/P&gt;&lt;P&gt;contents_bin = li_objbin&lt;/P&gt;&lt;P&gt;contents_txt = li_objtxt&lt;/P&gt;&lt;P&gt;receivers = li_reclist&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;too_many_receivers = 1&lt;/P&gt;&lt;P&gt;document_not_sent = 2&lt;/P&gt;&lt;P&gt;document_type_not_exist = 3&lt;/P&gt;&lt;P&gt;operation_no_authorization = 4&lt;/P&gt;&lt;P&gt;parameter_error = 5&lt;/P&gt;&lt;P&gt;x_error = 6&lt;/P&gt;&lt;P&gt;enqueue_error = 7&lt;/P&gt;&lt;P&gt;OTHERS = 8.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endform&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2009 10:01:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/batch-job/m-p/5633226#M1282473</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-06T10:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Job</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/batch-job/m-p/5633227#M1282474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As per my understanding of your requirement, it is possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can collect the result in an intermediate internal table and the pass the same to E-Mail sending FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: harsh bhalla on May 6, 2009 3:32 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2009 10:02:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/batch-job/m-p/5633227#M1282474</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-06T10:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Job</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/batch-job/m-p/5633228#M1282475</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 want this to be done from the program itself instead of scheduling it from SM36/SM37.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Chandra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2009 10:08:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/batch-job/m-p/5633228#M1282475</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-06T10:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Job</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/batch-job/m-p/5633229#M1282476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chandra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can just schdule the program in SM36 and give the spool recepiant, it will send the spool output to the mail box, no need of writing a program which functionlity is already existing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Br/Manas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2009 10:37:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/batch-job/m-p/5633229#M1282476</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-06T10:37:29Z</dc:date>
    </item>
  </channel>
</rss>

