Email in Batch Job

Hello All,
I need to set up a batch job and this would run daily. I can do this in SM36 and have done it.
But the question is I have couple of email ID's from the company I am working in and some email ID's for a different company.
The concern is when the JOB runs everyone has to receive a mail.
Please suggest.
Thanks.
Shreekant

If you want to send an internal SAP message into SAP Inbox, than it is possible:
Please refer to this thread:
Background scheduling
I don't think we have any provision for the "Spool Recipient" for the external email id.
Regards,
Naimesh Patel

Similar Messages

  • Maintaining Constant Sender Address in the Email of Batch Job

    Hi,
    I have created a smartform whcih will be sent via Batch job at a partcular time .And everytime the Sender Id is "BATCH.JOB". 
    Actually the businesswants the sender address to be XYZ.com instead of BATCH.JOB
    Iam using the below FM to send email.
    Can anyone help in this issue.
    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
         EXPORTING
              document_data              = l_doc_data_objl
             document_type              = 'RAW'
              put_in_outbox              = 'X'
         IMPORTING
              sent_to_all                = l_sent_all
         TABLES
              object_content             = l_contents
              receivers                  = l_receivers
         EXCEPTIONS
              too_many_receivers         = 1
              document_not_sent          = 2
              document_type_not_exist    = 3
              operation_no_authorization = 4
    Helpful answers will be rewarded.
    Regards
    Naveen

    Hi,
    Sorry for the delay. We can create a Outlook Inbox rule to achieve it. Please click Inbox > Rules > Manage Rules & Alerts > New Rule to create a rule with the following conditions and actions:
    Please change “people or public group” to [email protected] and edit a specific template by clicking “a specific template” in the action part.
    Hope it helps.
    Regards,
    Winnie Liang
    TechNet Community Support

  • Batch job creation for sending email if the invoice is aged

    Positive confirmation: Send system notification to the requestor if:
    a) An invoice is received and GR is not yet posted in the ECC system.
    b) An 'aged' invoice and GR is not yet posted in the ECC system.
    This requirement is for USA only. i.e., we have only one company code which is 8960.
    Identifiers of the invoice are
    Company Code = u20188960u2019
    Invoice Document Type = u2018R9u2019
    Use table EKBE for relationship between Invoice, Goods Receipt and Purchase Order.
    The field EKPO-BEDNR contains the Shopping Cart Number
    Implementation Strategy
    1. To send email if the invoice is aged.
    Create a program that will run as a job. This job will frequently check for invoices related to SRM Shopping Carts received from E2OPEN. If an invoice is aged and there is no Goods Receipt posted through confirmation from SRM, then an email will go out from ECC system to the requestor. Using the Shopping Cart number on PO, find the requestor information (email ID) from SRM through an RFC call. This job will run once in a day and should have a parameter in the program for the age of the Invoice.
    Both the emails should contain a link (To be taken from SRM system, to be supplied) to log into SRM system. The email will also contain the Shopping Cart number and the Description of the item, and a message to Confirm this, including age of the invoice if aged.
    Please let me know how to create the batch job.
    Regards,
    Venkat
    Edited by: VenkatG on Sep 1, 2009 3:14 PM

    Do not pass the COMMIT_WORK flag... Leave it blank. Any transaction for the data integrity, one should never use COMMIT WORK related statements. Normally SAP transactions will have the COMMIT WORK at the end of transaction which is enough for any thing that is added part of the customer exits...
    Hope this helps.
    Regards
    Anjaiah

  • Email Address not visible for output device MAIL in created batch job

    Issue in ECC6.0: Email Address not visible to display/change for output device MAIL in print parameter of each step in the created batch job.
    User wants to periodically receive report file via send to his email, so I create the batch job running report and send the report in pdf file to his email.
    Detail in the batch job
    1) In print parameter screen of the step in the batch job
       -Using output device MAIL (output type ZPDF1)
       -inputting email address of receiver in the EMAIL ADDRESS field
    2) After the batch job was saved, I tried to display/change the field EMAIL ADDRESS via Tx. SM37, but this field is invisible. The field can not be displayed or changed anymore. I also tried in SM36, but it is for creating new batch job, not changing the existing batch job.
    4) User receives email with pdf file from the batch job.
    How to change/display the email address of the receiver in the created batch job?
    Note that we just changed to use SAP ECC6 from SAP 4.6c. In SAP 4.6c, we can change/display the
    Email Address Field via Tx. SM37.
    Pls kindly suggest, thank you very much in advance.

    Hi Srirompoti,
    After saving the job if the job has not started then you can follow the below steps to change the Email address.
    1. View the job from Txn SM37.
    2. check the check box for your job that you want to change and goto menu path "Job->change
    3. in the next screen goto "Edit->steps." or press "F6" key
    4. place the coursor on the job and goto menu path "Step->change->print specifications.
    5. here you can change the email address.
    If you are not able change the data then you might not have authorization.

  • Email notification if batch job fails

    Hi,
    My requirement is to send a notification to a user if the batch job fails.
    The batch job is a Z report program.
    Regards
    Suresh Kumar

    HI,
    Check this thread..
    When a Job in SM37 fails means a email should be send
    Regards,
    Omkar.

  • Batch job email....

    Can any open help out in triggring email to bacth job sucess or failure to an email id.

    Hi,
    If yours is the standalone one, then you can access the online help by pressing F1 in the Redwood Explorer.
    In the tree on the lefthand side (on the Contents Tab), you need to browse down to Redwood Modules and Interfaces and expand that. The first topic underneath is the Mail module and describes the installation of the mail module (submitting the script RW_MAIL_INSTALL and specifying some parameters like your mail server).
    This script will create the necessary objects for you, like the destinations EMAIL_OUTPUT and EMAIL_LOGFILE.
    These can be used in job chains, as destinations on script calls: in the chain edit dialog, in the tree, you will find a node "Destinations" underneath each of the script calls in your chain, where you can add EMAIL_OUTPUT for instance to send the output of the script call. You can specify the parameters for the destination in the same way as you can for the script call.
    Regards,
    Anton Goselink.

  • Report to be sent to a list of recipients in an e:mail (part of batch job)

    Hi,
    I need to generate a report using ALV functionality.
    Currently my report requirement is to sent to a list of recipients in an e:mail (part of the batch job set-up) and the recipients just download the report in a spreadsheet format. 
    Could you please give me the suggestions the way which I need to follow and how I will be able to set this report as a part of batch job which will send the report details to the users in the form of Email.
    Points will be rewarded for the answers.
    Regards,
    Ravi Ganji

    Hi,
    IN SM36..You will see a button for "Spool list recipient" which is next to the target server button..
    press that button..
    Give the email address in the recipient field..
    GIve the steps and start condition and then release the job..
    THanks,
    Naren

  • Batch job for collecting Blocked Deliveries

    Hi,
    Can anyone help me, i need to collect all the orders that have been blocked for delivery and send the results to an email address.
    I created a batch job gave the program for SD Documents blocked for deliveries, but it doesnt seem to work, can anyone please give a step by step procedure.
    Thanks alot,
    Michelle.

    1. T.code SM36- Here you will creating the job
    2. Give the appropriate variants and the back ground user id
    3. once this is done, go to the Spool receipient and give the email id where you want to send the mail to. Run the job now. You should receive the mail now, provide the connections are maintained.
    Hope this will resolve the issue.
    Mani

  • Error in CCMS monitoring Batch job SAP_CCMS_MONI_BATCH_DP.

    Hi All,
    I am using a Sanbox system for CCMS Monitoring activities. I assigned a method CCMS_ONAlert_Email under auto reaction to the MTE class ABAP shortdumps on node System errors. So the requirement is when an alert triggered i have to receive an alert email. I just found there is an error in Batch job created for Alert monitoring, please find the error details mentioned below. Please let me know how to solve this error
    Job started
    Step 001 started (program RSAL_BATCH_TOOL_DISPATCHING, variant , user ID NBKIPXP)
    :Exception CX_DBA_ADBC in class CL_DB6_RDI method GET_SNAPSHOT line 431
    :  Kernel Error ID:
    :  SYSID: ES1
    :  SY-SUBRC: 1208
    :  Message: ADBC error
    :  SQL statement: SELECT '20110613075617',0 as DB6PMCF_PARTITION,FS_NAM
    :  E,'T','20110521174003','700',FREE_KB,USED_KB,TOTAL_KB,NUM_IUSED,PCT_IU
    :  SED FROM SYSIBM.SYSDUMMY1, TABLE(SAPTOOLS.DB6PMCF('/db2/ES1/sapdata1')
    :  ) AS FS_CONFIG
    :  Database:
    :caused by
    :Exception CX_SQL_EXCEPTIONin class CL_SQL_RESULT_SET
    :  Kernel Error ID:
    :  DB Error: Yes
    :  SQL Code: 444-
    :  SQL Message: SQL0444N Routine "SAPTOOLS.DB6PMCF" (specific name "D
    :  B6PMCF") is implemented with code in library orpath "/usr/sap/ED2/SYS
    :  /exe/run/db6pmudf", function "Db6pmcf" which cannot be accessed. Reas
    :  on code: "4". SQLSTATE=42724
    :  DB Object Exists: No
    :  Duplicated Key: No
    :  Internal Error: 1
    :  Invalid Cursor: No
    :  Unknown Connection: No
    :  Connection Closed: No
    Exception CX_DBA_ADBC in class CL_DB6_RDI method GET_SNAPSHOT line 431
    :Exception CX_DBA_ADBC in class CL_DB6_RDI method GET_SNAPSHOT line 431
    :  Kernel Error ID:
    :  SYSID: ES1
    :  SY-SUBRC: 1208
    :  Message: ADBC error
    :  SQL statement: SELECT '20110613075633',0 as DB6PMCF_PARTITION,FS_NAM
    :  E,'T','20110521174003','700',FREE_KB,USED_KB,TOTAL_KB,NUM_IUSED,PCT_IU
    :  SED FROM SYSIBM.SYSDUMMY1, TABLE(SAPTOOLS.DB6PMCF('/db2/ES1/log_dir/NO
    :  DE0000/') ) AS FS_CONFIG
    :  Database:
    :caused by
    :Exception CX_SQL_EXCEPTION in class CL_SQL_RESULT_SET
    :  Kernel Error ID:
    :  DB Error: Yes
    :  SQL Code: 444-
    :  SQL Message: SQL0444N Routine "SAPTOOLS.DB6PMCF" (specific name "D
    :  B6PMCF") is implemented with code in library orpath "/usr/sap/ED2/SYS
    :  /exe/run/db6pmudf", function "Db6pmcf" which cannot be accessed. Reas
    :  on code: "4". SQLSTATE=42724
    :  DB Object Exists: No
    :  Duplicated Key: No
    :  Internal Error: 1
    :  Invalid Cursor: No
    :  Unknown Connection: No
    :  Connection Closed: No
    Exception CX_DBA_ADBC in class CL_DB6_RDI method GET_SNAPSHOT line 431
    :Exception CX_DBA_ADBC in class CL_DB6_RDI method GET_SNAPSHOT line 431
    :  Kernel Error ID:
    :  SYSID: ES1
    :  SY-SUBRC: 1208
    :  Message: ADBC error
    :  SQL statement: SELECT '20110613075633',0 as DB6PMCF_PARTITION,FS_NAM
    :  E,'T','20110521174003','700',FREE_KB,USED_KB,TOTAL_KB,NUM_IUSED,PCT_IU
    :  SED FROM SYSIBM.SYSDUMMY1, TABLE(SAPTOOLS.DB6PMCF('/db2/ES1/sapdata4/d
    :  b2es1/NODE0000/ES1/T0000003/C0000000.TMP') ) ASFS_CONFIG
    :  Database:
    :caused by
    :Exception CX_SQL_EXCEPTION in class CL_SQL_RESULT_SET
    :  Kernel Error ID:
    :  DB Error: Yes
    :  SQL Code: 444-
    :  SQL Message: SQL0444N Routine "SAPTOOLS.DB6PMCF" (specific name "D
    :  B6PMCF") is implemented with code in library orpath "/usr/sap/ED2/SYS
    :  /exe/run/db6pmudf", function "Db6pmcf" which cannot be accessed. Reas
    :  on code: "4". SQLSTATE=42724
    :  DB Object Exists: No
    :  Duplicated Key: No
    :  Internal Error: 1
    :  Invalid Cursor: No
    :  Unknown Connection: No
    :  Connection Closed: No
    Exception CX_DBA_ADBC in class CL_DB6_RDI method GET_SNAPSHOT line 431
    :Exception CX_DBA_ADBC in class CL_DB6_RDI method GET_SNAPSHOT line 431
    :  Kernel Error ID:
    :  SYSID: ES1
    :  SY-SUBRC: 1208
    :  Message: ADBC error
    :  SQL statement: SELECT '20110613075634',0 as DB6PMCF_PARTITION,FS_NAM
    :  E,'T','20110521174003','700',FREE_KB,USED_KB,TOTAL_KB,NUM_IUSED,PCT_IU
    :  SED FROM SYSIBM.SYSDUMMY1, TABLE(SAPTOOLS.DB6PMCF('/db2/ES1/sapdata2/d
    :  b2es1/NODE0000/ES1/T0000003/C0000001.TMP') ) ASFS_CONFIG
    :  Database:
    :caused by
    :Exception CX_SQL_EXCEPTION in class CL_SQL_RESULT_SET
    :  Kernel Error ID:
    :  DB Error: Yes
    :  SQL Code: 444-
    :  SQL Message: SQL0444N Routine "SAPTOOLS.DB6PMCF" (specific name "D
    :  B6PMCF") is implemented with code in library orpath "/usr/sap/ED2/SYS
    :  /exe/run/db6pmudf", function "Db6pmcf" which cannot be accessed. Reas
    :  on code: "4". SQLSTATE=42724
    :  DB Object Exists: No
    :  Duplicated Key: No
    :  Internal Error: 1
    :  Invalid Cursor: No
    :  Unknown Connection: No
    :  Connection Closed: No
    Exception CX_DBA_ADBC in class CL_DB6_RDI method GET_SNAPSHOT line 431
    :Exception CX_DBA_ADBC in class CL_DB6_RDI method GET_SNAPSHOT line 431
    :  Kernel Error ID:
    :  SYSID: ES1
    :  SY-SUBRC: 1208
    :  Message: ADBC error
    :  SQL statement: SELECT '20110613075634',0 as DB6PMCF_PARTITION,FS_NAM
    :  E,'T','20110521174003','700',FREE_KB,USED_KB,TOTAL_KB,NUM_IUSED,PCT_IU
    :  SED FROM SYSIBM.SYSDUMMY1, TABLE(SAPTOOLS.DB6PMCF('/db2/ES1/sapdata1/d
    :  b2es1/NODE0000/ES1/T0000003/C0000002.TMP') ) ASFS_CONFIG
    :  Database:
    :caused by
    :Exception CX_SQL_EXCEPTION in class CL_SQL_RESULT_SET
    :  Kernel Error ID:
    :  DB Error: Yes
    :  SQL Code: 444-
    :  SQL Message: SQL0444N Routine "SAPTOOLS.DB6PMCF" (specific name "D
    :  B6PMCF") is implemented with code in library orpath "/usr/sap/ED2/SYS
    :  /exe/run/db6pmudf", function "Db6pmcf" which cannot be accessed. Reas
    :  on code: "4". SQLSTATE=42724
    :  DB Object Exists: No
    :  Duplicated Key: No
    :  Internal Error: 1
    :  Invalid Cursor: No
    :  Unknown Connection: No
    :  Connection Closed: No
    Exception CX_DBA_ADBC in class CL_DB6_RDI method GET_SNAPSHOT line 431
    :Exception CX_DBA_ADBC in class CL_DB6_RDI method GET_SNAPSHOT line 431
    :  Kernel Error ID:
    :  SYSID: ES1
    :  SY-SUBRC: 1208
    :  Message: ADBC error
    :  SQL statement: SELECT '20110613075634',0 as DB6PMCF_PARTITION,FS_NAM
    :  E,'T','20110521174003','700',FREE_KB,USED_KB,TOTAL_KB,NUM_IUSED,PCT_IU
    :  SED FROM SYSIBM.SYSDUMMY1, TABLE(SAPTOOLS.DB6PMCF('/db2/ES1/sapdata3/d
    :  b2es1/NODE0000/ES1/T0000003/C0000003.TMP') ) ASFS_CONFIG
    :  Database:
    :caused by
    :Exception CX_SQL_EXCEPTION in class CL_SQL_RESULT_SET
    :  Kernel Error ID:
    :  DB Error: Yes
    :  SQL Code: 444-
    :  SQL Message: SQL0444N Routine "SAPTOOLS.DB6PMCF" (specific name "D
    :  B6PMCF") is implemented with code in library orpath "/usr/sap/ED2/SYS
    :  /exe/run/db6pmudf", function "Db6pmcf" which cannot be accessed. Reas
    :  on code: "4". SQLSTATE=42724
    :  DB Object Exists: No
    :  Duplicated Key: No
    :  Internal Error: 1
    :  Invalid Cursor: No
    :  Unknown Connection: No
    :  Connection Closed: No
    Exception CX_DBA_ADBC in class CL_DB6_RDI method GET_SNAPSHOT line 431
    :Exception CX_DBA_ADBC in class CL_DB6_RDI method GET_SNAPSHOT line 431
    :  Kernel Error ID:
    :  SYSID: ES1
    :  SY-SUBRC: 1208
    :  Message: ADBC error
    :  SQL statement: SELECT '20110613075634',0 as DB6PMCF_PARTITION,FS_NAM
    :  E,'T','20110521174003','700',FREE_KB,USED_KB,TOTAL_KB,NUM_IUSED,PCT_IU
    :  SED FROM SYSIBM.SYSDUMMY1, TABLE(SAPTOOLS.DB6PMCF('/db2/ES1/sapdata3/d
    :  b2es1/NODE0000/ES1/T0000004/C0000003.UTM') ) ASFS_CONFIG
    :  Database:
    :caused by
    :Exception CX_SQL_EXCEPTION in class CL_SQL_RESULT_SET
    :  Kernel Error ID:
    :  DB Error: Yes
    :  SQL Code: 444-
    :  SQL Message: SQL0444N Routine "SAPTOOLS.DB6PMCF" (specific name "D
    :  B6PMCF") is implemented with code in library orpath "/usr/sap/ED2/SYS
    :  /exe/run/db6pmudf", function "Db6pmcf" which cannot be accessed. Reas
    :  on code: "4". SQLSTATE=42724
    :  DB Object Exists: No
    :  Duplicated Key: No
    :  Internal Error: 1
    :  Invalid Cursor: No
    :  Unknown Connection: No
    :  Connection Closed: No
    Exception CX_DBA_ADBC in class CL_DB6_RDI method GET_SNAPSHOT line 431
    :Exception CX_DBA_ADBC in class CL_DB6_RDI method GET_SNAPSHOT line 431
    :  Kernel Error ID:
      SYSID: ES1
      SY-SUBRC: 1208
      Message: ADBC error
      SQL statement: SELECT '20110613075634',0 as DB6PMCF_PARTITION,FS_NAM
      E,'T','20110521174003','700',FREE_KB,USED_KB,TOTAL_KB,NUM_IUSED,PCT_IU
      SED FROM SYSIBM.SYSDUMMY1, TABLE(SAPTOOLS.DB6PMCF('/db2/ES1/sapdata4/d
      b2es1/NODE0000/ES1/T0000004/C0000000.UTM') ) ASFS_CONFIG
      Database:
    caused by
    Exception CX_SQL_EXCEPTION in class CL_SQL_RESULT_SET
      Kernel Error ID:
      DB Error: Yes
      SQL Code: 444-
      SQL Message: SQL0444N Routine "SAPTOOLS.DB6PMCF" (specific name "D
      B6PMCF") is implemented with code in library orpath "/usr/sap/ED2/SYS
      /exe/run/db6pmudf", function "Db6pmcf" which cannot be accessed. Reas
      on code: "4". SQLSTATE=42724
      DB Object Exists: No
      Duplicated Key: No
      Internal Error: 1
      Invalid Cursor: No
      Unknown Connection: No
      Connection Closed: No
    xception CX_DBA_ADBC in class CL_DB6_RDI method GET_SNAPSHOT line 431
    Exception CX_DBA_ADBC in class CL_DB6_RDI method GET_SNAPSHOT line 431
      Kernel Error ID:
      SYSID: ES1
      SY-SUBRC: 1208
      Message: ADBC error
      SQL statement: SELECT '20110613075634',0 as DB6PMCF_PARTITION,FS_NAM
      E,'T','20110521174003','700',FREE_KB,USED_KB,TOTAL_KB,NUM_IUSED,PCT_IU
    :  SED FROM SYSIBM.SYSDUMMY1, TABLE(SAPTOOLS.DB6PMCF('/db2/ES1/sapdata2/d
    :  b2es1/NODE0000/ES1/T0000004/C0000001.UTM') ) ASFS_CONFIG
    :  Database:
    :caused by
    :Exception CX_SQL_EXCEPTION in class CL_SQL_RESULT_SET
    :  Kernel Error ID:
    :  DB Error: Yes
    :  SQL Code: 444-
    :  SQL Message: SQL0444N Routine "SAPTOOLS.DB6PMCF" (specific name "D
    :  B6PMCF") is implemented with code in library orpath "/usr/sap/ED2/SYS
    :  /exe/run/db6pmudf", function "Db6pmcf" which cannot be accessed. Reas
    :  on code: "4". SQLSTATE=42724
    :  DB Object Exists: No
    :  Duplicated Key: No
    :  Internal Error: 1
    :  Invalid Cursor: No
    :  Unknown Connection: No
    :  Connection Closed: No
    Exception CX_DBA_ADBC in class CL_DB6_RDI method GET_SNAPSHOT line 431
    :Exception CX_DBA_ADBC in class CL_DB6_RDI method GET_SNAPSHOT line 431
    :  Kernel Error ID:
    :  SYSID: ES1
    :  SY-SUBRC: 1208
    :  Message: ADBC error
    :  SQL statement: SELECT '20110613075634',0 as DB6PMCF_PARTITION,FS_NAM
    :  E,'T','20110521174003','700',FREE_KB,USED_KB,TOTAL_KB,NUM_IUSED,PCT_IU
    :  SED FROM SYSIBM.SYSDUMMY1, TABLE(SAPTOOLS.DB6PMCF('/db2/ES1/sapdata1/d
    :  b2es1/NODE0000/ES1/T0000004/C0000002.UTM') ) ASFS_CONFIG
    :  Database:
    :caused by
    :Exception CX_SQL_EXCEPTION in class CL_SQL_RESULT_SET
    :  Kernel Error ID:
    :  DB Error: Yes
    :  SQL Code: 444-
    :  SQL Message: SQL0444N Routine "SAPTOOLS.DB6PMCF" (specific name "D
    :  B6PMCF") is implemented with code in library orpath "/usr/sap/ED2/SYS
    :  /exe/run/db6pmudf", function "Db6pmcf" which cannot be accessed. Reas
    :  on code: "4". SQLSTATE=42724
    :  DB Object Exists: No
    :  Duplicated Key: No
    :  Internal Error: 1
    :  Invalid Cursor: No
    :  Unknown Connection: No
    :  Connection Closed: No
    Exception CX_DBA_ADBC in class CL_DB6_RDI method GET_SNAPSHOT line 431
    Job finished

    Hi Dinesh,
    Please check the note is applicable for you [Note 978319 - DB6: Incorrectly cataloged table functions|https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=978319]
    so please check wheter db2<sid>user has enough permission
    Thanks,
    Jansi

  • Subject in the mail sent through Batch Job

    Hi,
    We have a batch job which is running daily.
    Consumer wants the output of the batch job (spool request) in mail. We generally send the mail from batch job by filling the mail id in "Title field".. there is some third party involved in managing spool requests..
    But now consumer wants to send the mail with a subject line filled..
    I could not find any field or option in SM36 where i can fill in the subject..
    Please help. Now we are getting the subject as user id + spool request + system number.

    Check the below Code.
    DATA: NUMBYTES TYPE TST01-DSIZE,
            PDFSPOOLID TYPE TSP01-RQIDENT.
      DATA: BEGIN OF PDFDATA OCCURS 0.
              INCLUDE STRUCTURE TLINE.
      DATA: END OF PDFDATA.
      DATA: G1_LINES_TXT  TYPE I.
      DATA  : L_DOCUMENT_DATA    TYPE SODOCCHGI1,
              T_PACKING_LIST     TYPE STANDARD TABLE OF SOPCKLSTI1,
              W_OBJHEAD TYPE SOLI_TAB,
              T_OBJBIN TYPE STANDARD TABLE OF SOLISTI1,
              T_OBJTXT  TYPE STANDARD TABLE OF SOLISTI1,
              LW_PACKING_LIST    TYPE SOPCKLSTI1,
              L_LINES            TYPE I,
              W_RECEIVER        TYPE SOMLRECI1,
              T_RECEIVER         TYPE STANDARD TABLE OF SOMLRECI1.
      DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS  2 WITH HEADER LINE.
      DATA: OBJHEAD LIKE SOLISTI1   OCCURS  1 WITH HEADER LINE.
      DATA: OBJBIN  LIKE SOLISTI1   OCCURS 10 WITH HEADER LINE.
      DATA: OBJTXT  LIKE SOLISTI1   OCCURS 10 WITH HEADER LINE.
      DATA: RECLIST LIKE SOMLRECI1  OCCURS  5 WITH HEADER LINE.
      DATA: DOC_CHNG LIKE SODOCCHGI1.
      DATA: TAB_LINES LIKE SY-TABIX.
    *...Read the Spool request number generated.
      SELECT MAX( RQIDENT ) INTO G_SPOOL_NUM
                            FROM TSP01
                            WHERE RQCLIENT = SY-MANDT AND
                            RQOWNER = SY-UNAME.
    *....Convert Spool to PDF
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
        EXPORTING
          SRC_SPOOLID              = G_SPOOL_NUM
          NO_DIALOG                = 'X'
          DST_DEVICE               = G_PDEST
        IMPORTING
          PDF_BYTECOUNT            = NUMBYTES
        TABLES
          PDF                      = PDFDATA
        EXCEPTIONS
          ERR_NO_ABAP_SPOOLJOB     = 1
          ERR_NO_SPOOLJOB          = 2
          ERR_NO_PERMISSION        = 3
          ERR_CONV_NOT_POSSIBLE    = 4
          ERR_BAD_DESTDEVICE       = 5
          USER_CANCELLED           = 6
          ERR_SPOOLERROR           = 7
          ERR_TEMSEERROR           = 8
          ERR_BTCJOB_OPEN_FAILED   = 9
          ERR_BTCJOB_SUBMIT_FAILED = 10
          ERR_BTCJOB_CLOSE_FAILED  = 11
          OTHERS                   = 12.
    *...Convert 132 char to 255 char
      LOOP AT PDFDATA.
        TRANSLATE PDFDATA USING ' ~'.
        CONCATENATE GD_BUFFER PDFDATA INTO GD_BUFFER.
      ENDLOOP.
      TRANSLATE GD_BUFFER USING '~ '.
      DO.
        IT_MESS_ATT = GD_BUFFER.
        APPEND IT_MESS_ATT.
        SHIFT GD_BUFFER LEFT BY 255 PLACES.
        IF GD_BUFFER IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
    Creating the document attachment
      LOOP AT IT_MESS_ATT.
        OBJBIN = IT_MESS_ATT.
        APPEND OBJBIN.
        CLEAR: OBJBIN,
               IT_MESS_ATT.
      ENDLOOP.
    Creating the document to be sent
      DOC_CHNG-OBJ_NAME = 'IG Balance'.
    *.....Subject of the email.
      CONCATENATE 'Intragroup Confirmation from AoO: ' P_ZAOO INTO DOC_CHNG-OBJ_DESCR.
    DOC_CHNG-OBJ_DESCR = 'Intragroup Confirmation from AoO '.
    *...Body of the email
      OBJTXT = 'Please find attached a summary and details '.
      APPEND OBJTXT.
      OBJTXT = 'Any queries regarding the attached should be addressed to the contact names on the Report.'.
      APPEND OBJTXT.
      DESCRIBE TABLE OBJTXT LINES TAB_LINES.
      READ TABLE OBJTXT INDEX TAB_LINES.
      DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
    Creating the entry for the compressed document
      CLEAR OBJPACK-TRANSF_BIN.
      OBJPACK-HEAD_START = 1.
      OBJPACK-HEAD_NUM   = 0.
      OBJPACK-BODY_START = 1.
      OBJPACK-BODY_NUM   = TAB_LINES.
      OBJPACK-DOC_TYPE   = 'RAW'.
      APPEND OBJPACK.
      DESCRIBE TABLE OBJBIN LINES TAB_LINES.
      OBJHEAD = 'Balace.PDF'. APPEND OBJHEAD.
    Creating the entry for the compressed attachment
      OBJPACK-TRANSF_BIN = 'X'.
      OBJPACK-HEAD_START = 1.
      OBJPACK-HEAD_NUM   = 1.
      OBJPACK-BODY_START = 1.
      OBJPACK-BODY_NUM   = TAB_LINES.
      OBJPACK-DOC_TYPE   = 'PDF'.
      OBJPACK-OBJ_NAME   = 'ATTACHMENT'.
      OBJPACK-OBJ_DESCR = 'Balance Report'.
      OBJPACK-DOC_SIZE   = TAB_LINES * 255.
      APPEND OBJPACK..
    Entering names in the distribution list
      DATA: L_CNT TYPE I.
      LOOP AT T_EMAIL INTO W_EMAIL.
        IF W_EMAIL-ZCONTACT1 IS NOT INITIAL.
          RECLIST-RECEIVER = W_EMAIL-ZCONTACT1.
          RECLIST-REC_TYPE = 'U'.
          L_CNT = L_CNT + 1.
        ELSEIF W_EMAIL-ZCONTACT2 IS NOT INITIAL.
          RECLIST-RECEIVER = W_EMAIL-ZCONTACT2.
          RECLIST-REC_TYPE = 'U'.
          L_CNT = L_CNT + 1.
        ENDIF.
        APPEND RECLIST.
        CLEAR: RECLIST,
               W_EMAIL.
      ENDLOOP.
      SELECT SINGLE ZAOO
                     ZCONTACT1
                     ZCONTACT2 FROM ZFI_MT_RPTRMAP INTO W_EMAIL
                     WHERE ZAOO EQ P_ZAOO.
      IF W_EMAIL-ZCONTACT1 IS NOT INITIAL.
        RECLIST-RECEIVER = W_EMAIL-ZCONTACT1.
        RECLIST-REC_TYPE = 'U'.
        L_CNT = L_CNT + 1.
        APPEND RECLIST.
      ELSEIF W_EMAIL-ZCONTACT2 IS NOT INITIAL.
        RECLIST-RECEIVER = W_EMAIL-ZCONTACT2.
        RECLIST-REC_TYPE = 'U'.
        L_CNT = L_CNT + 1.
        APPEND RECLIST.
      ENDIF.
    Sending the document
      IF L_CNT > 0.
        CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
          EXPORTING
            DOCUMENT_DATA              = DOC_CHNG
            PUT_IN_OUTBOX              = 'X'
            COMMIT_WORK                = 'X'
          TABLES
            PACKING_LIST               = OBJPACK
            OBJECT_HEADER              = OBJHEAD
            CONTENTS_BIN               = OBJBIN
            CONTENTS_TXT               = OBJTXT
            RECEIVERS                  = RECLIST
          EXCEPTIONS
            TOO_MANY_RECEIVERS         = 1
            DOCUMENT_NOT_SENT          = 2
            OPERATION_NO_AUTHORIZATION = 4
            OTHERS                     = 99.
        CASE SY-SUBRC.
          WHEN 0.
            WRITE 'Email sent successfully'.
          WHEN 1.
            WRITE: / 'no authorization to send to the specified number of recipients!'.
          WHEN 2.
            WRITE: / 'document could not be sent to any of the recipients!'.
          WHEN 4.
            WRITE: / 'no authorization to send !'.
          WHEN OTHERS.
            WRITE: / 'error occurred during sending !'.
        ENDCASE.
      ELSE.
        MESSAGE S000 WITH TEXT-018.
        STOP.
      ENDIF.
    *...Delete Spool Request.
      DATA: SPOOLID TYPE TSP01_SP0R-RQID_CHAR.
      SPOOLID = G_SPOOL_NUM.
      CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
        EXPORTING
          SPOOLID             = SPOOLID
      IMPORTING
        RC                  =
        STATUS              =
        ERROR_MESSAGE       =

  • Batch Job to Create and Send Excel Reports Using!!!

    Hello at all,
    i have a Report which is created by an Query.
    My question is, how can i know if this report have a batch-job in background or not??
    I want to know if their is existing any job for this report???
    OTHER QUESTION, is:
    Is it possible to create a job for a Query-Report that is sending email in background??

    Hi ETN_58,
    in transaction SM37 you can look for jobs for a specific report using field "ABAP program name".
    when you create a job in transaction SM36 you have a button for "Spool list recipient". Fill it out to distribute the spool generated by the jog to a distribution list or an email.
    regards,
    Edgar

  • Set up a Batch Job

    Hi Everyone,
    I created a sample report using Crystal Reports and was wondering if it can be set up as a batch job. Do we have the option of setting up batch jobs in Crystal reports?
    Thanks
    Kumar..

    Is this a one-time requirement, or do you anticipate having many reports setup this way? If you are proficient, you could create a VB application to run the report, then schedule it, but batch scheduling is one of the primary uses for Crystal Reports Server (or BO Edge/BOE). It also provides delivery capabilities (FTP, email, etc) and history tracking. I think there are a few third-party tools that facilitate scheduling, but you can purchase CR Server with 5 named users for about $2500.

  • Batch Job Error Messages

    Hi Gurus,
    I have a program with rounddown quantities in deliveries notes. This program is run in background with all other programs. When we checked the batch job error log, we found out that when it gets to this Rounddown program, there are some SAP generated errors messages (examples are listed below).
    This issue is there is no way to know exactly which deliveries the error is generated from and if the program actually rounddown the quantities of all the deliveries passed to it and so on, because this error messages are not specific enough (like we can see below).
    This program passed this new rounddown quantity number from the internal table using a BAPI.
    Is there a way to change this SAP generated error messages to be specific enough like stating which actual delivery number is been affected or even stop at the error and send an email to the user to change the delivery or something in that manner, OR is there a way we can replace this SAP generated error messages with our own messages and send email out to the user.
    Error Messages:-
    01/16/2008 01:40:40 Step 005 started (program ZSDSO_DELIVERY_QTY_ROUNDDOWN, variant , user ID AUTOSYSUSER
    01/16/2008 01:51:35 Item 000020 belongs to delivery group 001
    01/16/2008 01:52:13 Item 000020 belongs to delivery group 001
    01/16/2008 01:52:15 Item 000030 belongs to delivery group 001
    01/16/2008 01:52:19 Item 000020 belongs to delivery group 001
    01/16/2008 01:52:29 Dynamic credit check has been exceeded                              23,984.52 USD
    01/16/2008 01:52:30 Item 000020 (change quantity manually to             400 PC because of complex struct
    01/16/2008 01:52:30 Item 000030 (change quantity manually to             400 PC because of complex struct
    01/16/2008 01:52:30 Quantity correlation for dependent items has been carried out
    01/16/2008 01:52:30 Item 000020 belongs to delivery group 008
    01/16/2008 01:52:30 Item 000030 belongs to delivery group 008
    01/16/2008 01:52:31 Dynamic credit check has been exceeded                              23,984.52 USD
    01/16/2008 01:52:32 Delivery quantity must be entered for the item
    01/16/2008 01:52:34 Dynamic credit check has been exceeded                              23,984.52 USD
    01/16/2008 01:53:05 Item 000020 belongs to delivery group 001
    01/16/2008 01:54:40 Dynamic credit check has been exceeded                              15,501.88 USD
    01/16/2008 01:55:53 Item 000020 belongs to delivery group 001
    Thanks.
    Points will be awarded.

    This is the Subrouting Form code.
    FORM call_bapi_delivery_change TABLES p_i_lips LIKE i_lips.
      DATA: w_header_data TYPE bapiobdlvhdrchg,
            w_header_control TYPE bapiobdlvhdrctrlchg,
            w_delivery TYPE bapiobdlvhdrchg-deliv_numb.
      DATA: i_item_data TYPE STANDARD TABLE OF bapiobdlvitemchg,
            w_item_data TYPE bapiobdlvitemchg,
            i_item_control TYPE STANDARD TABLE OF bapiobdlvitemctrlchg,
            w_item_control TYPE bapiobdlvitemctrlchg,
            i_return TYPE STANDARD TABLE OF bapiret2,
            w_return TYPE bapiret2.
      LOOP AT p_i_lips INTO w_lips.
        w_item_data-deliv_numb = w_lips-vbeln.
        w_item_data-deliv_item = w_lips-posnr.
        w_item_data-material = w_lips-matnr.
        w_item_data-batch = w_lips-charg.
        w_item_data-dlv_qty = w_lips-lfimg.
        w_item_data-dlv_qty_imunit = w_lips-lfimg.
        w_item_data-fact_unit_nom = 1.
        w_item_data-fact_unit_denom = 1.
        APPEND w_item_data TO i_item_data.
        CLEAR w_item_control.
        w_item_control-deliv_numb = w_lips-vbeln.
        w_item_control-deliv_item = w_lips-posnr.
        IF w_lips-delete NE 'X'.
          w_item_control-chg_delqty = 'X'.
        ELSEIF w_lips-delete EQ 'X'.
          w_item_control-del_item = 'X'.
        ENDIF.
        APPEND w_item_control TO i_item_control.
      ENDLOOP.
      w_header_data-deliv_numb = w_lips-vbeln.
      w_header_control-deliv_numb = w_lips-vbeln.
      w_delivery = w_lips-vbeln.
      CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
        EXPORTING
          header_data               = w_header_data
          header_control            = w_header_control
          delivery                  = w_delivery
      TECHN_CONTROL             =*
        TABLES
      HEADER_PARTNER            =*
      HEADER_PARTNER_ADDR       =*
      HEADER_DEADLINES          =*
          item_data                 = i_item_data
          item_control              = i_item_control
      ITEM_SERIAL_NO            =*
      SUPPLIER_CONS_DATA        =*
      EXTENSION1                =*
      EXTENSION2                =*
          return                    = i_return
      TOKENREFERENCE            =*
      IF sy-subrc EQ 0.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait = 'X'.
        w_zbdcopendn-otce706 = 'X'.
        MODIFY i_zbdcopendn FROM w_zbdcopendn TRANSPORTING otce706
        WHERE delivery EQ w_deliveries-vbeln.
      ELSE.
        CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
        DELETE i_zbdcopendn WHERE delivery EQ w_deliveries-vbeln.
       DELETE i_deliveries WHERE vbeln EQ w_lips-vbeln.*
        w_bad_delv-vbeln = w_deliveries-vbeln.
        APPEND w_bad_delv TO i_bad_delv.
      ENDIF.
    ENDFORM.                    " call_bapi_delivery_change
    Thanks again.

  • Batch job print parameters missing

    I have 4 BATCH jobs that output to a pdf via MAIL. The data is shrunk so small that it cannot be read. If I am in SP01, and I try to reprint with changed parameters, only a select few formats are available. (All the ABAP/4 lists).
    I went to SPAD -> Full Administration -> Device Types -> Choose the device type -> Formats
    I see the the output DEVICE associated with MAIL is PDF1. I checked the formats that are already listed. It seems that some of these will suit my needs - however, most of them are not available to choose when I edit the batch job.
    How can I add a different format? I need to test several to find a size that will accommodate a very wide table.
    All suggestions welcome.
    Thanks!

    It's pretty huge. Columns A-W. The length varies, but this week's was 195 rows. I tried to create a new format, but I supposed it will never fit on a normal sheet of paper.
    Is it possible to "print" to an Excel file from a batch job?
    Right now, I am going back into SP01 and downloading to excel and emailing it out.
    Think this can be automated?
    Thanks for your input

  • Output condition records copied by batch job

    Hi!
    We are creating invoices through batch job RV60SBAT. However, we notice that the outputs are created based on the output condition records of the last invoice created by the batch job.
    For example, if 2 invoices were to be picked up for creation by the batch job, where the first invoice should create a print output and the second invoice should create an email output, both invoices will be created with email outputs.
    It appears that the codition record of the last invoice is copied to all invoices created by a batch job run.
    Has anyone experienced the same issue?
    Cholen

    first invoice should create a print output and the second invoice should create an email output
    In that case, create two variants in program SD70AV3A by differentiating the output type and schedule it in background
    ps:-  post your text in big fonts as it is difficult to read
    G. Lakshmipathi

Maybe you are looking for

  • If statement with xml?

    I'd like to have a checkmark (image) show up if a certain value shows up in my dataset. For example, if the column Status has the value "Quote" I'd like to have an img show up, otherwise that column in the table would be blank. I was able to easily d

  • IOS 7.1.1 Voice Memos not syncing

    I have selected "include voice memos" under "Sync Music" in iphone.  Since updating to 7.1.1 my voice memos are not downloading to my computer.  I have logged-out of iTunes store and shut down iTune multiple time and disconnected phone from computer,

  • Running Adobe premiere in samung rv 520

    Hello all I am wondering if I can run and install Adobe Premiere Elements on a Samsung RV 520 ? heres all the spec thanks ! Christian Specifications: Colour: Metallic Silver Operating System Genuine Windows 7 Home Premium (64 bit) Processor Intel Cor

  • Forget All Remotes Grayed Out In iTunes

    I am using iTunes on 10.6.8. Under the "Device Preferences" option in iTunes Preferences, it says that "iTunes is not paired with any Remotes." The "Forget All Remotes" is grayed out. However, home sharing is turned on to "share entire library." And,

  • How to reflect the Master data changes from ECC to MDM

    Hi Experts, We need to reflect the master data changes of company code and cost center groups  from ECC to MDM. what methods available and which would be best in performance. kindly let me know if you need further information for better undrstanding.