Report to be mailed to different persons

Hi,
I have a classical report having informations of diferent employees.
This needs to be mailed to their respective supervisors as attachment but with the condition that each supervisor should get the attachment having details of his subordinates only and no other employee details should be mailed. This needs to be coded in the program itself that generates this report.
I am calling another program by SUBMIT command, within my program which sends the email.
Please suggest how to do this.
Regards,
Binay

Hi,
here is the sample code that will help you out.
sample code:
*& Report  ZDOC_AS_EMAIL_3
REPORT  ZDOC_AS_EMAIL_3.
*& Report  ZEMAIL_ATTACH                                               *
*& Example of sending external email via SAPCONNECT                    *
TABLES: ekko.
PARAMETERS: p_email   TYPE somlreci1-receiver.
TYPES: BEGIN OF t_ekpo,
  ebeln TYPE ekpo-ebeln,
  ebelp TYPE ekpo-ebelp,
  aedat TYPE ekpo-aedat,
  matnr TYPE ekpo-matnr,
END OF t_ekpo.
DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0,
      wa_ekpo TYPE t_ekpo.
TYPES: BEGIN OF t_charekpo,
  ebeln(10) TYPE c,
  ebelp(5)  TYPE c,
  aedat(8)  TYPE c,
  matnr(18) TYPE c,
END OF t_charekpo.
DATA: wa_charekpo TYPE t_charekpo.
DATA:   it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
                WITH HEADER LINE.
DATA:   it_attach TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
                WITH HEADER LINE.
DATA:   t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
        t_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
        t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
        t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
        t_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,
        w_cnt TYPE i,
        w_sent_all(1) TYPE c,
        w_doc_data LIKE sodocchgi1,
        gd_error    TYPE sy-subrc,
        gd_reciever TYPE sy-subrc.
*START_OF_SELECTION
START-OF-SELECTION.
  Retrieve sample data from table ekpo
  PERFORM data_retrieval.
  Populate table with detaisl to be entered into .xls file
  PERFORM build_xls_data_table.
*END-OF-SELECTION
END-OF-SELECTION.
Populate message body text
  perform populate_email_message_body.
Send file by email as .xls speadsheet
  PERFORM send_file_as_email_attachment
                               tables it_message
                                      it_attach
                                using p_email
                                      'Example .xls documnet attachment'
                                      'XLS'
                                      'filename'
                             changing gd_error
                                      gd_reciever.
  Instructs mail send program for SAPCONNECT to send email(rsconn01)
  PERFORM initiate_mail_execute_program.
*&      Form  DATA_RETRIEVAL
      Retrieve data form EKPO table and populate itab it_ekko
FORM data_retrieval.
  SELECT ebeln ebelp aedat matnr
   UP TO 10 ROWS
    FROM ekpo
    INTO TABLE it_ekpo.
ENDFORM.                    " DATA_RETRIEVAL
*&      Form  BUILD_XLS_DATA_TABLE
      Build data table for .xls document
FORM build_xls_data_table.
CONSTANTS: con_cret(2) TYPE c VALUE '0D',  "OK for non Unicode
            con_tab(2) TYPE c VALUE '09'.   "OK for non Unicode
*If you have Unicode check active in program attributes thnen you will
*need to declare constants as follows
*class cl_abap_char_utilities definition load.
constants:
    con_tab  type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
    con_cret type c value cl_abap_char_utilities=>CR_LF.
  CONCATENATE 'EBELN' 'EBELP' 'AEDAT' 'MATNR'
         INTO it_attach SEPARATED BY con_tab.
  CONCATENATE con_cret it_attach  INTO it_attach.
  APPEND  it_attach.
  LOOP AT it_ekpo INTO wa_charekpo.
    CONCATENATE wa_charekpo-ebeln wa_charekpo-ebelp
                wa_charekpo-aedat wa_charekpo-matnr
           INTO it_attach SEPARATED BY con_tab.
    CONCATENATE con_cret it_attach  INTO it_attach.
    APPEND  it_attach.
  ENDLOOP.
ENDFORM.                    " BUILD_XLS_DATA_TABLE
*&      Form  SEND_FILE_AS_EMAIL_ATTACHMENT
      Send email
FORM send_file_as_email_attachment tables pit_message
                                          pit_attach
                                    using p_email
                                          p_mtitle
                                          p_format
                                          p_filename
                                          p_attdescription
                                          p_sender_address
                                          p_sender_addres_type
                                 changing p_error
                                          p_reciever.
  DATA: ld_error    TYPE sy-subrc,
        ld_reciever TYPE sy-subrc,
        ld_mtitle LIKE sodocchgi1-obj_descr,
        ld_email LIKE  somlreci1-receiver,
        ld_format TYPE  so_obj_tp ,
        ld_attdescription TYPE  so_obj_nam ,
        ld_attfilename TYPE  so_obj_des ,
        ld_sender_address LIKE  soextreci1-receiver,
        ld_sender_address_type LIKE  soextreci1-adr_typ,
        ld_receiver LIKE  sy-subrc.
  ld_email   = p_email.
  ld_mtitle = p_mtitle.
  ld_format              = p_format.
  ld_attdescription      = p_attdescription.
  ld_attfilename         = p_filename.
  ld_sender_address      = p_sender_address.
  ld_sender_address_type = p_sender_addres_type.
Fill the document data.
  w_doc_data-doc_size = 1.
Populate the subject/generic message attributes
  w_doc_data-obj_langu = sy-langu.
  w_doc_data-obj_name  = 'SAPRPT'.
  w_doc_data-obj_descr = ld_mtitle .
  w_doc_data-sensitivty = 'F'.
Fill the document data and get size of attachment
  CLEAR w_doc_data.
  READ TABLE it_attach INDEX w_cnt.
  w_doc_data-doc_size =
     ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
  w_doc_data-obj_langu  = sy-langu.
  w_doc_data-obj_name   = 'SAPRPT'.
  w_doc_data-obj_descr  = ld_mtitle.
  w_doc_data-sensitivty = 'F'.
  CLEAR t_attachment.
  REFRESH t_attachment.
  t_attachment[] = pit_attach[].
Describe the body of the message
  CLEAR t_packing_list.
  REFRESH t_packing_list.
  t_packing_list-transf_bin = space.
  t_packing_list-head_start = 1.
  t_packing_list-head_num = 0.
  t_packing_list-body_start = 1.
  DESCRIBE TABLE it_message LINES t_packing_list-body_num.
  t_packing_list-doc_type = 'RAW'.
  APPEND t_packing_list.
Create attachment notification
  t_packing_list-transf_bin = 'X'.
  t_packing_list-head_start = 1.
  t_packing_list-head_num   = 1.
  t_packing_list-body_start = 1.
  DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
  t_packing_list-doc_type   =  ld_format.
  t_packing_list-obj_descr  =  ld_attdescription.
  t_packing_list-obj_name   =  ld_attfilename.
  t_packing_list-doc_size   =  t_packing_list-body_num * 255.
  APPEND t_packing_list.
Add the recipients email address
  CLEAR t_receivers.
  REFRESH t_receivers.
  t_receivers-receiver = ld_email.
  t_receivers-rec_type = 'U'.
  t_receivers-com_type = 'INT'.
  t_receivers-notif_del = 'X'.
  t_receivers-notif_ndel = 'X'.
  APPEND t_receivers.
  CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
       EXPORTING
            document_data              = w_doc_data
            put_in_outbox              = 'X'
            sender_address             = ld_sender_address
            sender_address_type        = ld_sender_address_type
            commit_work                = 'X'
       IMPORTING
            sent_to_all                = w_sent_all
       TABLES
            packing_list               = t_packing_list
            contents_bin               = t_attachment
            contents_txt               = it_message
            receivers                  = t_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.
Populate zerror return code
  ld_error = sy-subrc.
Populate zreceiver return code
  LOOP AT t_receivers.
    ld_receiver = t_receivers-retrn_code.
  ENDLOOP.
ENDFORM.
*&      Form  INITIATE_MAIL_EXECUTE_PROGRAM
      Instructs mail send program for SAPCONNECT to send email.
FORM initiate_mail_execute_program.
  WAIT UP TO 2 SECONDS.
  SUBMIT rsconn01 " WITH mode = 'INT'
                  "WITH output = 'X'
                AND RETURN.
ENDFORM.                    " INITIATE_MAIL_EXECUTE_PROGRAM
*&      Form  POPULATE_EMAIL_MESSAGE_BODY
       Populate message body text
form populate_email_message_body.
  REFRESH it_message.
  it_message = 'Please find attached a list test ekpo records'.
  APPEND it_message.
endform.                    " POPULATE_EMAIL_MESSAGE_BODY

Similar Messages

  • My mac mail inbox is acting funny.  I receive an email from today and the window shows me an email from a different person and topic from 2011.  How can I fix this?  The mail appears correctly on my phone but not on my computer.

    I receive an email from today March 13, 2013, but my inbox displays an email from a different person on a different topic received in 2011.  It seems like some type of corruption but I don't know how best to fix it.

    Hi.  I checked on the order and it says the order is currently being processed and I should check back tomorrow. I'm mostly just concerned because I got an email saying the order was on hold, and I want to make sure it actually does go through and I'm not just waiting for a delivery that's not going to come. I'm still confused as to why I'd get an email saying I had to call the fraud department only to be told I shouldn't have called the fraud department.

  • Broad casting Webi report in excel format to different users email ids

    Hello,
    Seriously looking for the help, please help with the solution for below scenario.
    We have a requirement to schedule broadcasting of Webi reports to users email in excel format from infoview. But our concern is how the system takes care of authorizations of users when we broadcast the report to their mail id as excel file.
    For example we have one webi report for Finance and there are thousands of users for each department, cost centre etcu2026so how to broadcast the same webi report in excel to different users with only data they have authorized to see. We have committed to client that we can do this with out much massive overhead, please advise what is the easiest way to achieve this. I read something like this can be done using authorization profiles in CMS but creating those many profiles and mapping them to relevant authorizations is not possible as there are thousands of users with different authorization levels. And Client is expecting this broadcasting need to be done automatically with out every time manual intervention. 
    Looking forward for the prompt reply.
    Thanks,
    Gani.

    Please use the Dynmanic Recipients functionality of the Publication.
    For this we need to do follow steps.
    1) Create the WebI Report that needs to be published(Broadcasted)
    2) create Deski/webi report which contains the user details and email id's for publishing main report.
    3) Map the properties of souce report with Dynamic Recipient report.
    Please refer the user guide for more inforamtion.This helps you in avoiding manual creation of profiles in CMC.
    Regards,
    Siva
    Edited by: Nallamala siva on Jun 13, 2011 8:17 AM

  • How to send a mail to a person  from after completeing bdc .

    Hi Xperts,
    Please send me a options how to send a mail to a person after completing a bdc or from any report program.
    mailed can be a sapuser or other service provider(ex:yahoo,gmail.any thing)
    Please Any one i want it now .
    Thank You.

    FUNCTION RS_SEND_MAIL_FOR_SPOO* Email ITAB structure
    DATA: BEGIN OF EMAIL_ITAB OCCURS 10.
            INCLUDE STRUCTURE SOLI.
    DATA: END OF EMAIL_ITAB.
    DATA: T_EMAIL LIKE SOOS1-RECEXTNAM.  "EMail distribution list
    CONSTANTS: C_EMAIL_DISTRIBUTION LIKE SOOS1-RECEXTNAM VALUE
               ‘[email protected],[email protected]’.
    Initialization
    REFRESH EMAIL_ITAB.
    Populate data
    EMAIL_ITAB-LINE = ‘Email body text 1’.
    APPEND EMAIL_ITAB.
    EMAIL_ITAB-LINE = ‘Email body text 2’.
    APPEND EMAIL_ITAB.
    T_EMAIL = C_EMAIL_DISTRIBUTION.
    --- EMAIL FUNCTION ---------------------------------------------------
    REQUIRMENTS:
    1) The user running the program needs a valid email address in their
       address portion of tx SU01 under external comms -> SMTP -> internet
       address.
    2) A job called SAP_EMAIL is running with the following parameters:
       Program: RSCONN01  Variant: INT   User: XXX
       This program moves mail from the outbox to the mail server using
       RFC destination: SAP_INTERNET_GATEWAY_SERVER
    INTERFACE:
    1) APPLICATION: Anything
    2) EMAILTITLE:  EMail subject
    3) RECEXTNAM:   EMail distribution lists separated by commas
    4) TEXTTAB:     Internal table for lines of the email message
    EXCEPTIONS:
    Send OK = 0 otherwise there was a problem with the send.
        CALL FUNCTION 'Z_SEND_EMAIL_ITAB'
             EXPORTING
                  APPLICATION = 'EMAIL'
                  EMAILTITLE  = 'Email Subject'
                  RECEXTNAM   = T_EMAIL
             TABLES
                  TEXTTAB     = EMAIL_ITAB
             EXCEPTIONS
                  OTHERS      = 1.
    Function Z_SEND_EMAIL_ITAB
    ""Local interface:
    *"       IMPORTING
    *"             VALUE(APPLICATION) LIKE  SOOD1-OBJNAM
    *"             VALUE(EMAILTITLE) LIKE  SOOD1-OBJDES
    *"             VALUE(RECEXTNAM) LIKE  SOOS1-RECEXTNAM
    *"       TABLES
    *"              TEXTTAB STRUCTURE  SOLI
    *- local data declaration
      DATA: OHD    LIKE SOOD1,
            OID    LIKE SOODK,
            TO_ALL LIKE SONV-FLAG,
            OKEY   LIKE SWOTOBJID-OBJKEY.
      DATA: BEGIN OF RECEIVERS OCCURS 0.
              INCLUDE STRUCTURE SOOS1.
      DATA: END OF RECEIVERS.
    *- fill odh
      CLEAR OHD.
      OHD-OBJLA    = SY-LANGU.
      OHD-OBJNAM   = APPLICATION.
      OHD-OBJDES   = EMAILTITLE.
      OHD-OBJPRI   = 3.
      OHD-OBJSNS   = 'F'.
      OHD-OWNNAM   = SY-UNAME.
    *- send Email
      CONDENSE RECEXTNAM NO-GAPS.
      CHECK RECEXTNAM <> SPACE AND RECEXTNAM CS '@'.
    *- for every individual recipient send an Email
    (see OSS message 0120050409/0000362105/1999)
      WHILE RECEXTNAM CS ','.
        PERFORM INIT_REC TABLES RECEIVERS.
        READ TABLE RECEIVERS INDEX 1.
        RECEIVERS-RECEXTNAM = RECEXTNAM+0(SY-FDPOS).
        ADD 1 TO SY-FDPOS.
        SHIFT RECEXTNAM LEFT BY SY-FDPOS PLACES.
        MODIFY RECEIVERS INDEX 1.
        PERFORM SO_OBJECT_SEND_REC
         TABLES TEXTTAB RECEIVERS
          USING OHD.
      ENDWHILE.
    *- check last recipient in recipient list
      IF RECEXTNAM <> SPACE.
        PERFORM INIT_REC TABLES RECEIVERS.
        READ TABLE RECEIVERS INDEX 1.
        RECEIVERS-RECEXTNAM = RECEXTNAM.
        MODIFY RECEIVERS INDEX 1.
        PERFORM SO_OBJECT_SEND_REC
         TABLES TEXTTAB RECEIVERS
          USING OHD.
      ENDIF.
    ENDFUNCTION.
          FORM SO_OBJECT_SEND_REC                                       *
    FORM  SO_OBJECT_SEND_REC
    TABLES  OBJCONT      STRUCTURE SOLI
            RECEIVERS    STRUCTURE SOOS1
    USING   OBJECT_HD    STRUCTURE SOOD1.
      DATA:   OID     LIKE SOODK,
              TO_ALL  LIKE SONV-FLAG,
              OKEY    LIKE SWOTOBJID-OBJKEY.
      CALL FUNCTION 'SO_OBJECT_SEND'
           EXPORTING
                EXTERN_ADDRESS             = 'X'
                OBJECT_HD_CHANGE           = OBJECT_HD
                OBJECT_TYPE                = 'RAW'
                OUTBOX_FLAG                = 'X'
                SENDER                     = SY-UNAME
           IMPORTING
                OBJECT_ID_NEW              = OID
                SENT_TO_ALL                = TO_ALL
                OFFICE_OBJECT_KEY          = OKEY
           TABLES
                OBJCONT                    = OBJCONT
                RECEIVERS                  = RECEIVERS
           EXCEPTIONS
                ACTIVE_USER_NOT_EXIST      = 1
                COMMUNICATION_FAILURE      = 2
                COMPONENT_NOT_AVAILABLE    = 3
                FOLDER_NOT_EXIST           = 4
                FOLDER_NO_AUTHORIZATION    = 5
                FORWARDER_NOT_EXIST        = 6
                NOTE_NOT_EXIST             = 7
                OBJECT_NOT_EXIST           = 8
                OBJECT_NOT_SENT            = 9
                OBJECT_NO_AUTHORIZATION    = 10
                OBJECT_TYPE_NOT_EXIST      = 11
                OPERATION_NO_AUTHORIZATION = 12
                OWNER_NOT_EXIST            = 13
                PARAMETER_ERROR            = 14
                SUBSTITUTE_NOT_ACTIVE      = 15
                SUBSTITUTE_NOT_DEFINED     = 16
                SYSTEM_FAILURE             = 17
                TOO_MUCH_RECEIVERS         = 18
                USER_NOT_EXIST             = 19
                X_ERROR                    = 20
                OTHERS                     = 21.
      IF SY-SUBRC <> 0.
        RAISE OTHERS.
      ENDIF.
    ENDFORM.
          FORM INIT_REC                                                 *
    FORM INIT_REC TABLES RECEIVERS STRUCTURE SOOS1.
      CLEAR RECEIVERS.
      REFRESH RECEIVERS.
      MOVE SY-DATUM  TO RECEIVERS-RCDAT .
      MOVE SY-UZEIT  TO RECEIVERS-RCTIM.
      MOVE '1'       TO RECEIVERS-SNDPRI.
      MOVE 'X'       TO RECEIVERS-SNDEX.
      MOVE 'U-'      TO RECEIVERS-RECNAM.
      MOVE 'U'       TO RECEIVERS-RECESC.
      MOVE 'INT'     TO RECEIVERS-SNDART.
      MOVE '5'       TO RECEIVERS-SORTCLASS.
      APPEND RECEIVERS.
    ENDFORM.
    2.

  • Sending mail to 200 persons

    When sending one mail to 200 different persons,
    I would like to address them personally, like Dear John, Dear Helana, ...
    Is there an easy way to do?
    So that I do not have to fill in myself their name 200 times.
    I tried different systems, on internet, but never one was really fulfulling.
    Thank you for your help.

    Hello:
    There is a third party mail addressing program that I have used in the past.  It is a little hard to understand (for me at least, but it met my requirement).  I used it for mailing labels and postcard addressing.
    The program is called Labels and Addresses from BeLIght software.  The source can be spread sheets or Address Book.
    You might take a look at it to see if it will do what you wish.
    Barry

  • Selection screen in Cc reporting showing two lines when changed Person Res.

    Hi Guruz
    I have changed Person responsible in Cost centre hierarchy. Now I have two interval with different person responsible 1st one is from 01.01.07 to 31.12.2008 and 2nd one is from 01.01.2009 to 31.12.9999. When I go to cost centre report and look for the cost centre fo this cost centre system is showing two lines one with 1st Person responsible and second with 2nd Person responsible. I don't know how to show only latest one on the selection screen in cost centre reporting, any thoughts on this one?
    Many thanks

    Hi
    I wanted to keep history as well as showing only latest line for cost centre on selection screen but unfortunately it's not possible.
    The only way we can do this is change the name of person responsible from 01.01.2008 and system will show only one line. In this situation we will loose the history of the pervious person responsible for that cost centre but that's the way it works OR if you want history then we have to live with more than one line.
    Many thanks

  • Very urjent how to send report output in mail

    hi experts,
    how to send report output in mail which function module should i use wht parameters should i pass.
    thanks in addavnce,
    points to be awarded.

      CALL FUNCTION 'GET_PRINT_PARAMETERS'
           EXPORTING
                destination    = '026c'
                copies         = count
                list_name      = 'VATS_ASBUILT'
                list_text      = v_list
                immediately    = 'X'
                release        = 'X'
                new_list_id    = 'X'
                expiration     = days
                line_size      = 132
                line_count     = 65
                layout         = 'X_65_132'
    *            sap_cover_page = 'X'
    *            cover_page     = 'X'
                receiver       = 'SAP*'
                department     = 'VATS'
                no_dialog      = 'X'
           IMPORTING
                out_parameters = params
                valid          = valid.
      SUBMIT zppr_vats_asbuilt  WITH p_aufnr EQ v_aufnr
                   TO SAP-SPOOL WITHOUT SPOOL DYNPRO
                      SPOOL PARAMETERS params
                         AND RETURN.
      SELECT SINGLE rqident FROM tsp01 INTO l_spoolno
                         WHERE rqtitle = v_list .
    * convert report to PDF format
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
           EXPORTING
                src_spoolid              = l_spoolno
                no_dialog                = 'X'
           TABLES
                pdf                      = l_ipdf
           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.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        EXIT .
      ENDIF.
    Now comes the part to send the mail
      try.
    * -------- create persistent send request ------------------------
          send_request = cl_bcs=>create_persistent( ).
          clear document.
    * -------- create and set document with attachment ---------------
    * create document from internal table with text
          document = cl_document_bcs=>create_document(
          i_type = 'RAW'
          i_text = text
          i_length = '12'
          i_subject = '' ).
    *changing the content of the attachment
          binary_content[] = l_iobjbin[].
    *change the name of the PDF attachment
          concatenate 'Build ID' s_buildid_i 'Rev' v_buildid_rev
                              into i_att_sub separated by space.
    * add attachment to document
          call method document->add_attachment
            exporting
              i_attachment_type    = 'PDF'
              i_attachment_subject = i_att_sub
              i_att_content_hex    = binary_content.
    *setting the option to send an e-mail more than 50 characters
          call method send_request->set_message_subject
            exporting
              ip_subject = t_sub.
    * add document to send request
          call method send_request->set_document
            exporting
              i_document = document.
    * --------- set sender -------------------------------------------
    * note: this is necessary only if you want to set the sender
    * different from actual user (SY-UNAME). Otherwise sender is
    * set automatically with actual user.
          sender = cl_sapuser_bcs=>create( 'VATSUPPORT' ).
          call method send_request->set_sender
            exporting
              i_sender = sender.
    *Send the list based on receivers list obtained
          loop at l_ireclist.
            AD_SMTPADR = l_ireclist-receiver.
    * --------- add recipient (e-mail address) -----------------------
    * create recipient - please replace e-mail address !!!
          recipient = cl_cam_address_bcs=>create_internet_address(
          AD_SMTPADR ).
    * add recipient with its respective attributes to send request
          call method send_request->add_recipient
            exporting
              i_recipient = recipient
              i_express   = 'X'.
          ENDLOOP.
          call method send_request->set_status_attributes
            exporting
              i_requested_status = 'E'
              i_status_mail      = 'E'.
    * To send the mail immediately
          call method send_request->set_send_immediately( 'X' ).
    * ---------- send document ---------------------------------------
          call method send_request->send( ).
          commit work.

  • Can i make report to send mail .

    hi
    i want to send an automatic mail  to respective person before two days of the issue date as a warning message or any thing. I want to make it through a SAP program is it possible? if yes then give me one example or suggest me .
    please .
    thanks in advanced.

    Try using the following code.
    *& Report  ZEMAIL1_G
    REPORT  ZEMAIL1_G.
      DATA: form_name TYPE RS38L_FNAM.
      DATA: wa_ctrlop TYPE ssfctrlop,
            wa_outopt TYPE ssfcompop.
      DATA: t_otfdata TYPE ssfcrescl,
            t_pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE.
      DATA: t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE.
      DATA: w_filesize TYPE i.
      DATA: w_bin_filesize TYPE i.
      DATA: fname1 TYPE string.
    **********internal tables for email details ******88
    DATA:
    i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
    i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    Objects to send mail.
    i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
    i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
    Work Area declarations
    w_objhead TYPE soli_tab,
    w_doc_chng typE sodocchgi1,
    w_data TYPE sodocchgi1,
    w_buffer TYPE string,"To convert from 132 to 255
    Variables declarations
    v_len_out LIKE sood-objlen,
    v_len_in LIKE sood-objlen,
    v_len_outn TYPE i,
    v_lines_txt TYPE i,
    v_lines_bin TYPE i.
    SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME.
    PARAMETERS :p_name type RS38L_FNAM default 'zpdf_g', "form name
                p_email type somlreci1-receiver. "email address
    SELECTION-SCREEN: END OF BLOCK b1.
    PARAMETER: p_date LIKE sy-datum.
    PARAMETER: p_rea TYPE char255.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
      formname = p_name
      IMPORTING
      fm_name = form_name
      EXCEPTIONS
      no_form = 1
      no_function_module = 2
      OTHERS = 3
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      wa_ctrlop-getotf = 'X'.
      wa_ctrlop-no_dialog = 'X'.
      wa_outopt-tdnoprev = 'X'.
    CALL FUNCTION form_name
      EXPORTING
       CONTROL_PARAMETERS         = wa_ctrlop
       OUTPUT_OPTIONS             = wa_outopt
       USER_SETTINGS              = 'X'
        MYDATE                     = p_date
        REASON                     = p_rea
    IMPORTING
       JOB_OUTPUT_INFO            = t_otfdata
    EXCEPTIONS
       FORMATTING_ERROR           = 1
       INTERNAL_ERROR             = 2
       SEND_ERROR                 = 3
       USER_CANCELED              = 4
       OTHERS                     = 5
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
      t_otf[] = t_otfdata-otfdata[].
      CALL FUNCTION 'CONVERT_OTF'
      EXPORTING
      format = 'PDF'
      max_linewidth = 132
    ARCHIVE_INDEX = ' '
      IMPORTING
      bin_filesize = v_len_in
      TABLES
      otf = t_otf
      lines = t_pdf_tab
      EXCEPTIONS
      err_max_linewidth = 1
      err_format = 2
      err_conv_not_possible = 3
      OTHERS = 4
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Convert PDF from 132 to 255.
    LOOP AT t_pdf_tab.
    Replacing space by ~
    TRANSLATE t_pdf_tab USING ' ~'.
    CONCATENATE w_buffer t_pdf_tab INTO w_buffer.
    ENDLOOP.
    Replacing ~ by space
    TRANSLATE w_buffer USING '~ '.
    DO.
    i_record = w_buffer.
    Appending 255 characters as a record
    APPEND i_record.
    SHIFT w_buffer LEFT BY 255 PLACES.
    IF w_buffer IS INITIAL.
    EXIT.
    ENDIF.
    ENDDO.
    Refresh: i_reclist,
    i_objtxt,
    i_objbin,
    i_objpack.
    clear w_objhead.
    Object with PDF.
    i_objbin[] = i_record[].
    DESCRIBE TABLE i_objbin LINES v_lines_bin.
    Object with main text of the mail.
    i_objtxt = 'Find attached the output of the smart form.'.
    APPEND i_objtxt.
    *i_objtxt = 'Regards,'.
    *APPEND i_objtxt.
    *i_objtxt = 'Geeta'.
    *APPEND i_objtxt.
    DESCRIBE TABLE i_objtxt LINES v_lines_txt.
    read table i_objtxt index v_lines_txt.
    Document information.
    w_doc_chng-obj_name = 'Smartform'.
    w_doc_chng-expiry_dat = sy-datum + 10.
    w_doc_chng-obj_descr = 'Smart form output'.
    w_doc_chng-sensitivty = 'F'. "Functional object
    w_doc_chng-doc_size = v_lines_txt * 255.
    Pack to main body as RAW.
    Obj. to be transported not in binary form
    CLEAR i_objpack-transf_bin.
    Start line of object header in transport packet
    i_objpack-head_start = 1.
    Number of lines of an object header in object packet
    i_objpack-head_num = 0.
    Start line of object contents in an object packet
    i_objpack-body_start = 1.
    Number of lines of the object contents in an object packet
    i_objpack-body_num = v_lines_txt.
    Code for document class
    i_objpack-doc_type = 'RAW'.
    APPEND i_objpack.
    Packing as PDF.
    i_objpack-transf_bin = 'X'.
    i_objpack-head_start = 1.
    i_objpack-head_num = 0.
    i_objpack-body_start = 1.
    *CONCATENATE 'Smartform_output' '.pdf'
    *INTO i_objpack-obj_descr.
    *APPEND i_objpack.
    describe table i_objbin lines v_lines_bin.
      read table i_objbin index v_lines_bin.
    i_objpack-doc_size = v_lines_bin * 255.
    i_objpack-body_num = v_lines_bin.
    i_objpack-doc_type = 'PDF'.
    i_objpack-obj_name = 'Smartform'.
    i_objpack-obj_descr = 'test'.
      append i_objpack.
    Document information.
    CLEAR i_reclist.
    e-mail receivers.
    i_reclist-receiver = p_email.
    *i_reclist-express = 'X'.
    i_reclist-rec_type = 'U'. "Internet address
    APPEND i_reclist.
    Sending mail.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    document_data = w_doc_chng
    put_in_outbox = 'X'
    TABLES
    packing_list = i_objpack
    object_header = w_objhead
    contents_bin = i_objbin
    contents_txt = i_objtxt
    receivers = i_reclist
    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.
    CASE SY-SUBRC.
        WHEN 0.
          WRITE: / 'Result of the send process:'.
          LOOP AT i_reclist.
            WRITE: / i_reclist-RECEIVER(48), ':'.
            IF i_reclist-RETRN_CODE = 0.
              WRITE 'sent successfully'.
            ELSE.
              WRITE 'not sent'.
            ENDIF.
          ENDLOOP.
        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.

  • TS2998 Help! My Mac mail uses another person's name in stead of mine in the "from" heading when trying to send e-mail. How can I fix this?

    Mac mail started using another person's name instead of mine. In the "From" line it shows someone other than me so the receipient will not know I am sending them an e-mail. HELP!, This is crazy. Is there a fix?

    Does this problem happen EVERY time you send an email?
    Do you see the wrong FROM entry before you hit the send button? Or does the recipient report seeing another name other than yours?
    Do you recognize the incorrect name being shown? Is it something you or someone else using your machine have ever used? Is it a name you have never heard of before?
    Go to your SENT folder in Apple Mail. What do you see when you open one of your SENT emails, in the FROM slot? Is the name correct or incorrect?
    Also, I don't understand your comment "I noticed it when I try to send a link via e-mail to another person." are you saying that when you paste a link into an email to someone that your name in the FROM field changes? Where are you putting the link, in what place in the email?

  • OBIEE report from multiple facts at different levels

    Currently we need to develop a report with columns from 3 different facts surrounded with conformed and non conformed dimensions at different levels.
    After setting the hierarchial levels and putting the facts into single logical table with different sources OBIEE is generating 2 different queries and does a full outer join.
    I would like to know how we can do a left outer join instead of full outer join between the 2 queries based on a common column?
    Thanks in advance.

    Hi Vinod,
    The scenario provided in the link above doesnt match to my issue.
    We need to develop a report from multiple fact tables at different levels with conformed & non conformed dimension columns.
    I have 7 dimensions D1, D2, D3, D4, D5, D6 and D7 & two fact F1 and F2 tables.
    F1 is tied to dimensions D1,D2,D3,D4,d5
    F2 is tied to dimensions D3,D4,D5, D6 and D7.
    In my report I have columns from D1, D2, D3, D4, D5, D6, D7, F1 and F2.
    So OBIEE generates 2 queries with columns from D1,D2,D3,D4,d5 & F1 measure and another query with D3,D4,D5, D6, D7 and F2 measure.
    and then does a cross fact join out of box between 2 queries.
    But I need to do a left outer join between the 2 queries on a common column instead of cross fact join. I would like to know how we can achive this.
    Thanks.

  • I can no longer receive my email through firefox. Also my facebook account doesn't show some of the profile pictures show a different person on someone's name. It appears this is a firefox issues as when I go to explorer it is not a problem at all.

    It seems that through firefox I cannot receive my emails through charter.net and have always been able to before. Also, on my facebook page, profile pictures aren't showing up on some people and on some people a totally different person is showing up. It seems to be a firefox issue because when I get on internet explorer everything is fine? How can I get this problem taken care of? Can my 8.0 be updated.

    This issue can be caused by corrupted cookies or cookies that are blocked.
    *check the permissions on the about:permissions page and in "Tools > Page Info > Permissions"
    Clear the cache and remove cookies only from websites that cause problems.
    "Clear the Cache":
    *Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox/Tools > Options > Privacy > "Use custom settings for history" > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
    *Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
    *Do NOT click the Reset button on the Safe Mode start window
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • How to send ALV report Output through mail in background !

    Hi ,
    I had an ALV Report. I want to send this report output to patricular email id every day ! Presenty i do this manually. I run the report and send the output to the particular email address. Now i want to schecule the report daily in background and the out put of the report should be mailed to particular email ids in background itself. How can i do this ?
    Is there and method or setting through which we can do this ?
    Regards

    Hi Nau,
    For this requirement you will have to write another program.
    This program will convert the spool requests into PDF document and sends an email  to the recipients that you specify.
    These are the threads which are already posted in The SDN.
    *http://wiki.sdn.sap.com/wiki/display/Snippets/Converts+spool+request+into+PDF+document+and+emails*
    *<a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="353650"></a>*
    *<a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="902985"></a>*
    You need to use the Function module :
    -- Sending the document
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    I will provide you with the code to get this functionality.
    *&      Form  SEND_EMAIL
    form SEND_EMAIL .
    DATA:   t_mailpack   TYPE sopcklsti1 OCCURS 0 WITH HEADER LINE,
              t_mailhead   TYPE solisti1   OCCURS 0 WITH HEADER LINE,
              t_mailbin    TYPE solisti1   OCCURS 0 WITH HEADER LINE,
              t_mailtxt    TYPE solisti1   OCCURS 0 WITH HEADER LINE,
              t_mailrec    TYPE somlreci1  OCCURS 0 WITH HEADER LINE.
      DATA: wa_maildata    TYPE sodocchgi1,
            l_filename(50) TYPE c,
            l_fldname(30)  TYPE c,
            l_fldval(100)  TYPE c,
            l_lines        TYPE i,
            l_text         TYPE text128 .
      DATA: w_email_subrc  TYPE i.
      DATA: w_ship like vbfa-vbeln.
      CLEAR: wa_maildata,
             t_mailtxt,
             t_mailbin,
             t_mailpack,
             t_mailhead,
             t_mailrec.
      REFRESH: t_mailtxt,
               t_mailbin,
               t_mailpack,
               t_mailhead,
               t_mailrec.
    *-- Fill output file
    *- Fill header
      CLEAR: t_mailbin.
    *  t_mailbin[] = pdf_tab[].
      t_mailbin[] = it_att[].     "Uthaman
    *This line is added to get the shipment no in Subject Line
    SELECT SINGLE * FROM vbfa WHERE vbelv EQ nast-objky
                                AND vbtyp_v EQ c_vbtyp_v_j
                                AND vbtyp_n EQ c_vbtyp_n_8.
    w_ship = vbfa-vbeln.
    shift w_ship left deleting leading '0'.
    *-- File name
    if nast-kschl EQ 'ZFPL'.
      CLEAR l_filename.
      CONCATENATE 'Packing List -'
                  sy-datum+4(2) sy-datum+6(2) sy-datum(4) '.PDF' INTO l_filename.
    *-- Creation of the document to be sent File Name
      wa_maildata-obj_name = 'Packing List'.
    *-- Mail Subject
      CONCATENATE l_filename '-' 'Shipment No -' w_ship INTO wa_maildata-obj_descr SEPARATED BY space.
    *-- Mail Contents
      t_mailtxt-line = 'Packing List'.
      APPEND t_mailtxt.
    ENDIF.
    if nast-kschl EQ 'ZFBA'.
      CLEAR l_filename.
      CONCATENATE 'Booking Advice -'
                  sy-datum+4(2) sy-datum+6(2) sy-datum(4) '.PDF'
                  INTO l_filename.
    *-- Creation of the document to be sent File Name
      wa_maildata-obj_name = 'Booking Advice'.
    *-- Mail Subject
      CONCATENATE l_filename '-' 'Shipment No -' w_ship INTO wa_maildata-obj_descr SEPARATED BY space.
    *-- Mail Contents
      t_mailtxt-line = 'Packing List'.
      APPEND t_mailtxt.
    ENDIF.
    *-- Prepare Packing List
    *-- Write Packing List (Main Subject)
      CLEAR: l_lines, t_mailpack.
      DESCRIBE TABLE t_mailtxt LINES l_lines.
    *  READ TABLE t_mailtxt INDEX l_lines.
      t_mailpack-doc_size = ( l_lines - 1 ) * 255 + STRLEN( t_mailtxt ).
    *  CLEAR t_mailpack-transf_bin.
      t_mailpack-transf_bin = ' '.
      t_mailpack-head_start = 1.
      t_mailpack-head_num = 0.
      t_mailpack-body_start = 1.
      t_mailpack-body_num = l_lines.
      t_mailpack-doc_type = 'RAW'.
      APPEND t_mailpack.
      t_mailhead = l_filename.
      APPEND t_mailhead.
    *-- Write Packing List (Attachment)
      CLEAR: l_lines, t_mailpack.
      DESCRIBE TABLE pdf_tab[] LINES l_lines.
    *  READ TABLE pdf_tab INDEX l_lines.
      t_mailpack-doc_size = ( l_lines - 1 ) * 255 + STRLEN( t_mailbin ).
      t_mailpack-transf_bin = 'X'.
      t_mailpack-head_start = 1.
      t_mailpack-head_num = 1.
      t_mailpack-body_start = 1.
      t_mailpack-body_num = l_lines.
      t_mailpack-doc_type = 'PDF'.
      t_mailpack-obj_name = l_filename.
      t_mailpack-obj_descr = l_filename.
      t_mailpack-obj_langu = 'E'.
      APPEND t_mailpack.
    *-- Set recipients
    tables :  ztotcemail.
    SELECT SINGLE * FROM vbfa WHERE vbelv EQ nast-objky
                                AND vbtyp_v EQ c_vbtyp_v_j
                                AND vbtyp_n EQ c_vbtyp_n_8.
    CLEAR vttk.
    SELECT SINGLE * FROM vttk WHERE tknum EQ vbfa-vbeln.
    SELECT SINGLE * FROM ztotcemail WHERE tplst = vttk-tplst
                                      AND lifnr = vttk-tdlnr.
    IF SY-SUBRC EQ 0.
      t_mailrec-receiver = ztotcemail-smtp_addr. "'Here you will give the email address'.
      t_mailrec-rec_type  = 'U'.
      APPEND t_mailrec.
    ENDIF.
    **-- Sending the document
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = wa_maildata
          put_in_outbox              = 'X'
    *      commit_work                = 'X'  " N-16
        TABLES
          packing_list               = t_mailpack
          object_header              = t_mailhead
          contents_bin               = t_mailbin[]
          contents_txt               = t_mailtxt[]
          receivers                  = t_mailrec
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          operation_no_authorization = 4
          OTHERS                     = 99.
      w_email_subrc = sy-subrc.
      IF sy-subrc EQ 0.
        MESSAGE s000(zotc) WITH 'Email output sent successfully'.
      ELSE.
        MESSAGE s000(zotc) WITH 'Can not send email output'.
      ENDIF.
    endform.                    " SEND_EMAIL
    Hope the above information will be helpful.
    Regards,
    Kittu

  • 2 people sent e-mails to me today and I did not receive them. They both were replies to my e-mail (both different).  I am running 10.7.5.  I searched everywhere and nothing.  Not on iCloud either.

    2 people sent e-mails to me today and I did not receive them. They both were replies to my e-mail (both different).  I am running 10.7.5.  I searched everywhere and nothing.  Not on iCloud either.  This happened a few years ago and never noticed it again.  I received emails before and after the 2 that never showed up so can't figure out why I didn't get them!  Does Apple automatically delete some emails based on text?  These were nothing crazy.  One was about decorating cookies for a party and which colors to use!  HELP!  Now I am worried I am missing important emails!

    Greetings Val Val,
    Welcome to the Apple Support Communities!
    I understand that you are not receiving some email from an account that you have set up on your Mac. To begin the troubleshooting process, I would recommend reading over and working through the attached article.
    OS X Mail: Troubleshooting sending and receiving email messages - Apple Support
    Have a great day,
    Joe

  • I have configured a new one iphone 4s I have done it via wifi i has caught myself for defect the you ID (mail) of a person that toward a lot of time habia lived in my house.  Someone can tell me the because??

    I have configured a new one iphone 4s I have done it via wifi i has caught myself for defect the you ID (mail) of a person that toward a lot of time habia lived in my house.  Someone can tell me the because??

    PinguXeF wrote:
    , while I have taken a backup of the iTunes Library,
    this means nothing if it was not done correctly...
    To have  EVERYTHING on a New Computer...
    From your OLD computer...
    Copy your ENTIRE iTunes FOLDER to an External Drive... and then from the External Drive to your New Computer..
    Full Details Here  >  http://support.apple.com/kb/HT1751

  • Customized report for cost centers by different cost centers

    Hi All,
    Customized report for cost centers by different cost centers:
    I need to build a customised report with the following format:
    Cost element columns | Cost center 1 | cost center 2 | cost center 3, etc -> dynamic cost center columns
    CE 1 .............................. amount xxx  |  . amount xxx | ..  amount xxx
    CE 2 .............................. amount xxx  |  . amount xxx | ..  amount xxx
    CE 3 .............................. amount xxx  |  . amount xxx | ..  amount xxx
    CE 3 .............................. amount xxx  |  . amount xxx | ..  amount xxx
    User selection screen:
    Controlling are:
    Fiscal Year:
    From period to period:
    cost center group ... <range of CC group> or
    cost center value ... <range of CC value>
    Questions:
    From the above selection screens, I need to pull out all the data stored in the table: COEP
    But, the problem is that inside this table, there is no cost center or cost center group stored; and therefore the program should be smart enough to pull out all the documents from the table: COEP and then make sure that the document / list of documents that pull out should belongs to the cost center or cost center group, as well as date range.
    KIndly advise how functional description/design should be built in order ABAPer can understand the requirement?
    What should be the tables to refer in order meet the requirement.
    Similar Standard SAP cost center report should be S_ALR_87013611 - Cost Centers: Actual/Plan/Variance, but this report read from many tables.

    Hi,
    Please find the logic below & try it at your system-
    Here cost center group is not possible (also i not checked it so do it on your own simultaneously i am trying the same).
    Use Table BSEG-> in bseg give the cost center-> with the help of cost center find the account number (field HKONT)-> take this GL account number & got to table COEP-> in this give the GL account number at field 'offsetting account' (field GKONT) & you will get the line item.
    Try it & let me know if you have any question.
    Thanks

Maybe you are looking for

  • How to Connect my External WD Passport hard disk using wifi

    Dear Friends, i have got a new Apple Ipad 4 Gen, of 16GB but now i am facing a problem due to space requirements. my ipad is filling with lots of photoes and music.right now only 750mb is available among 16GB. i have an idea ,i need to connect my Ext

  • Getting Refund with itunes match

    Hi, i have subscribed to itunes match yesterday but then realise it doesn't work properly, how do i cancel it? try to click on report a problem but it does work? anyone experience this? thx

  • IPhoto 8 wont' find iPhoto 6 library?

    I just upgraded my mom's computer to Leopard and iLife 08. I first imported all 4,000 of her photos but when it was done it did not import the albums. The albums are critical to her organization (she just flipped). Since I have this all on a backup,

  • Oracle 9i standby database error

    Hi all, I am getting this error on my standby DB while it's archiving a log...and I've even restarted the DB and media recovery.Also, it's not a disk space issue. Errors in file f:\oracle\admin\xxxprd\bdump\xxxprd_pmon_5224.trc: ORA-16145: archival f

  • PURCHASE ORDER FIELD

    I am in SRM 5.0 , I am in PO screen. I wanted disable few fields in the PO screen. How can I do the same? I wanted to disable Purchase Order Response Field.