<?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: EMAIL in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/email/m-p/1963373#M395837</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;'SO_NEW_DOCUMENT_SEND_API1' will be useful.&lt;/P&gt;&lt;P&gt;Pelase reward if useful&lt;/P&gt;&lt;P&gt;reagrds&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Feb 2007 06:09:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-23T06:09:21Z</dc:date>
    <item>
      <title>EMAIL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/email/m-p/1963372#M395836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i have submitted a report in the back groud. the out put is in the spool.&lt;/P&gt;&lt;P&gt;But my requirement is to send a mail that the out put has been stored with the respective spool number.&lt;/P&gt;&lt;P&gt;How is this done?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Feb 2007 06:06:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/email/m-p/1963372#M395836</guid>
      <dc:creator>P311729</dc:creator>
      <dc:date>2007-02-23T06:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: EMAIL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/email/m-p/1963373#M395837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;'SO_NEW_DOCUMENT_SEND_API1' will be useful.&lt;/P&gt;&lt;P&gt;Pelase reward if useful&lt;/P&gt;&lt;P&gt;reagrds&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Feb 2007 06:09:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/email/m-p/1963373#M395837</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-23T06:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: EMAIL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/email/m-p/1963374#M395838</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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;After running the background jobs, send the spool to the SAP users Office Mail Box. &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT ZMAILSPOOL. 

INCLUDE LBTCHDEF. 
* 
* Include the Business Object Repository object 
INCLUDE &amp;lt;CNTN01&amp;gt;. 

DATA ABAPNM LIKE SY-REPID. 

DATA BEGIN OF LOCAL_JOB. 
INCLUDE STRUCTURE TBTCJOB. 
DATA END OF LOCAL_JOB. 

DATA BEGIN OF LOCAL_STEP_TBL OCCURS 10. 
INCLUDE STRUCTURE TBTCSTEP. 
DATA END OF LOCAL_STEP_TBL. 

* 
* Data declarations for the mail recipient 
DATA RECIPIENT TYPE SWC_OBJECT. 
DATA RECIPIENT_OBJ LIKE SWOTOBJID. 
SWC_CONTAINER CONTAINER. 

* Data declarations for the background job 
PARAMETERS ABAPNAME(20) DEFAULT 'ZTEST1'. 
PARAMETERS EMPFNAME LIKE SY-UNAME DEFAULT SY-UNAME. 

ABAPNM = ABAPNAME. 
LOCAL_JOB-JOBNAME = ABAPNAME. 
* Generate recipient object (see report RSSOKIF1 for an example) 
*** 1. Create the recipient: 

IF EMPFNAME &amp;lt;&amp;gt; SPACE. 
"** 1.1 Generate an object reference to a recipient object 
SWC_CREATE_OBJECT RECIPIENT 'RECIPIENT' SPACE. 

"** 1.2 Write the import parameters for method 
"** recipient.createaddress into the container 
"** and empty the container 
SWC_CLEAR_CONTAINER CONTAINER. 
"** Set address element (internal user 'JSMITH') 
SWC_SET_ELEMENT CONTAINER 'AddressString' EMPFNAME. 
"** Set address type (internal user) 
SWC_SET_ELEMENT CONTAINER 'TypeId' 'B'. 

"** 1.3 Call the method recipient.createaddress 
SWC_CALL_METHOD RECIPIENT 'CreateAddress' CONTAINER. 
"** Issue any error message generated by a method exception 
IF SY-SUBRC NE 0. 
MESSAGE ID SY-MSGID TYPE 'E' NUMBER SY-MSGNO. 
ENDIF. 
SWC_CALL_METHOD RECIPIENT 'Save' CONTAINER. 
SWC_OBJECT_TO_PERSISTENT RECIPIENT RECIPIENT_OBJ. 
ENDIF. 
*** Recipient has been generated and is ready for use in a 
*** background job 

CALL FUNCTION 'JOB_OPEN' 
     exporting 
*      DELANFREP              = ' ' 
*      JOBGROUP               = ' ' 
       jobname                = LOCAL_JOB-JOBNAME 
*      SDLSTRTDT              = NO_DATE 
*      SDLSTRTTM              = NO_TIME 
     IMPORTING 
       JOBCOUNT               = LOCAL_JOB-JOBCOUNT 
     EXCEPTIONS 
       CANT_CREATE_JOB        = 1 
       INVALID_JOB_DATA       = 2 
       JOBNAME_MISSING        = 3 
       OTHERS                 = 4 
             . 
   if sy-subrc &amp;lt;&amp;gt; 0. 
      WRITE: / 'JOB_OPEN PROBLEM ', SY-SUBRC. 
   ELSE. 
      WRITE: / 'JOB OPEN SUCCESS', 
                                  LOCAL_JOB-JOBNAME, LOCAL_JOB-JOBCOUNT. 
   endif. 

CALL FUNCTION 'JOB_SUBMIT' 
     exporting 
*      ARCPARAMS                         = 
       authcknam                         = SY-UNAME 
*      COMMANDNAME                       = ' ' 
*      OPERATINGSYSTEM                   = ' ' 
*      EXTPGM_NAME                       = ' ' 
*      EXTPGM_PARAM                      = ' ' 
*      EXTPGM_SET_TRACE_ON               = ' ' 
*      EXTPGM_STDERR_IN_JOBLOG           = 'X' 
*      EXTPGM_STDOUT_IN_JOBLOG           = 'X' 
*      EXTPGM_SYSTEM                     = ' ' 
*      EXTPGM_RFCDEST                    = ' ' 
*      EXTPGM_WAIT_FOR_TERMINATION       = 'X' 
       jobcount                          = LOCAL_JOB-JOBCOUNT 
       jobname                           = LOCAL_JOB-JOBNAME 
*      LANGUAGE                          = SY-LANGU 
*      PRIPARAMS                         = ' ' 
       REPORT                            = ABAPNM 
*      REPORT                            = 'ZTEST1' 
*      VARIANT                           = ' ' 
*    IMPORTING 
*      STEP_NUMBER                       = LOCAL_JOB-STEPCOUNT 
     EXCEPTIONS 
       BAD_PRIPARAMS                     = 1 
       BAD_XPGFLAGS                      = 2 
       INVALID_JOBDATA                   = 3 
       JOBNAME_MISSING                   = 4 
       JOB_NOTEX                         = 5 
       JOB_SUBMIT_FAILED                 = 6 
       LOCK_FAILED                       = 7 
       PROGRAM_MISSING                   = 8 
       PROG_ABAP_AND_EXTPG_SET           = 9 
       OTHERS                            = 10 
             . 
   if sy-subrc &amp;lt;&amp;gt; 0. 
      WRITE: / 'JOB_SUBMIT PROBLEM ', LOCAL_JOB-JOBCOUNT, 
               LOCAL_JOB-JOBNAME, ABAPNAME, SY-SUBRC. 
   endif. 

IF EMPFNAME &amp;lt;&amp;gt; SPACE. 
CALL FUNCTION 'JOB_CLOSE' 
  exporting 
*   AT_OPMODE                         = ' ' 
*   AT_OPMODE_PERIODIC                = ' ' 
*   CALENDAR_ID                       = ' ' 
*   EVENT_ID                          = ' ' 
*   EVENT_PARAM                       = ' ' 
*   EVENT_PERIODIC                    = ' ' 
    jobcount                          = LOCAL_JOB-JOBCOUNT 
    jobname                           = LOCAL_JOB-JOBNAME 
*   LASTSTRTDT                        = NO_DATE 
*   LASTSTRTTM                        = NO_TIME 
*   PRDDAYS                           = 0 
*   PRDHOURS                          = 0 
*   PRDMINS                           = 0 
*   PRDMONTHS                         = 0 
*   PRDWEEKS                          = 0 
*   PREDJOB_CHECKSTAT                 = ' ' 
*   PRED_JOBCOUNT                     = ' ' 
*   PRED_JOBNAME                      = ' ' 
*   SDLSTRTDT                         = NO_DATE 
*   SDLSTRTTM                         = NO_TIME 
*   STARTDATE_RESTRICTION             = BTC_PROCESS_ALWAYS 
    STRTIMMED                         = 'X' 
*   TARGETSYSTEM                      = ' ' 
*   START_ON_WORKDAY_NOT_BEFORE       = SY-DATUM 
*   START_ON_WORKDAY_NR               = 0 
*   WORKDAY_COUNT_DIRECTION           = 0 
    RECIPIENT_OBJ                     = RECIPIENT_OBJ 
*   TARGETSERVER                      = ' ' 
*   DONT_RELEASE                      = ' ' 
* IMPORTING 
*   JOB_WAS_RELEASED                  = 'X' 
  EXCEPTIONS 
    CANT_START_IMMEDIATE              = 1 
    INVALID_STARTDATE                 = 2 
    JOBNAME_MISSING                   = 3 
    JOB_CLOSE_FAILED                  = 4 
    JOB_NOSTEPS                       = 5 
    JOB_NOTEX                         = 6 
    LOCK_FAILED                       = 7 
    OTHERS                            = 8 
          . 

IF ( SY-SUBRC &amp;lt;&amp;gt; 0 ). 
  WRITE: / 'Job_Close Problem:', ABAPNAME, SY-SUBRC. 
ELSE. 
  WRITE: / 'Job_Close done'. 
ENDIF. 

ELSE. "no empfname 
... 
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt; Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Feb 2007 06:10:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/email/m-p/1963374#M395838</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-23T06:10:07Z</dc:date>
    </item>
  </channel>
</rss>

