Transfer report data As an email attachment

i am having problem in tranfering report data.
in the email, in the place of space it is showing some junk characters.i have saved the report data as 'RAW' .what other extension I can use to eliminate the spaces.

you can check Raja's Article for converting report output to HTML format and send it as attachement.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5931ff64-0a01-0010-2bb7-ff2f9a6165a0

Similar Messages

  • Report output as an email attachment

    Hi ,
    I am sending report output as email attachment by using 'mail recipient ' CLTR+ F7' option in alv list.
    But this is sending mail as pdf attachment. I want it as excel format.
    Is there any option to change type of attachment which sending mail?

    Hi,
    This is not possible to change the filetype of the attachment. Instead you can have your own functionality in the program to send email with excel attachment
    Refer to this link..http://docs.google.com/Doc?id=dfv2hmgs_0fm22tggx&hl=en

  • Is it possible to send report results as an email attachment in BW3.x ?

    Hi Friends,
    I have a requirement wherein I need to automate the process to run the report via Reporting Agent..and also to send the results as an e-mail attachment.
    Is it possible to do so in BW 3.x..?
    I was trying to see if I can run the report using the Reporting Agent Settings, using the Web Templates tab. However I did not see any follo-up actions available for Web templates, but found so for the Exceptions.
    Can you please help and let us know if there is a way to do that and what options are available..?
    Thank You
    Sri lz70d7

    3.1 version.
    try to follwong links
    loginto rsa1
    u will see tab of REPORTING AGENT, press that tab.
    u need to schedule the jobs as u schedule process chains,
    select ur query, make the time arrangement, select output format,
    output type i.e.
    http://help.sap.com/saphelp_nw04/helpdata/en/45/67bd3cad649f5ce10000000a114084/content.htm
    Reporting Agent Configuration
    After the two steps configuration
    1 - configure the agent settings for web templates
    2 - scheduling package which is a reporting agent scheduler
    In RSRAJ Starts a Reporting Agent Job
    SAP show-mw the folow information...
    All Reporting Agent settings processed
    My Questions is ---Where the system save the query data ????
    In RSRAM Reporting Agent Monitor in Schedule --> Execution Target --> i have information of aplcation Server.

  • HT201269 Hi, how do i transfer my data from one email accouint on one iphone to another email account on another iphone, both accounst are apple accounts?

    How do I transfer content from a iPhone on one email account to to another iPhone on a different email account when both account are registered with apple?

    Are you asking how to transfer items from one AppleID to another AppleID?
    If yes, that cannot be done - apps, content, media are forever tied
    to the AppleID used to download them.
    If that is not what you are asking, please add more details as to what you
    are trying to accomplish so someone may offer a solution.

  • Report output getting truncated in email attachment

    Hello Gurus,
    My requirement is to send a report output as an email attachment.
    I have done the coding for this but have a small problem. In the attachment the report is getting truncated after certain length.
    Can you advise wats the problem ?
    Regards,
    Suhas

    Hello Guys,
    I too was contemplating on those lines. But actually i was calculating the File Size incorrectly.
    Changed the code & now it working !!!!!!!
    BR,
    Suhas

  • Transfer Report output to email body

    Hi,
    I have some problems in transferring my report output into the email body. As i know, there is a function to transfer the report output to the email as attachment. But for my current requirement, i would like to transfer the report output the the email body. My current report output is in table form and as i transfer the report output to the email body, it should be the same format as the report output in the email body. I am using write function to show this report. May i know how should i go about solving this problem?
    Appreciate if you could help.
    Thanks.
    Regards,
    Rachel

    Hi Rachel,
    Check this sample program which uses the standard FM for sending email .
    zdp_solisti1 is a structure having fields naming LINE of type LCHR and its length being 2500.
    *******Email declarations
    data : gv_delimit TYPE c,
    lv_lncnt1(5) TYPE c,
    tempread(10) TYPE c VALUE 0,
    objpack TYPE sopcklsti1 OCCURS 0 WITH HEADER LINE,
    objhead TYPE zdp_solisti1 OCCURS 1 WITH HEADER LINE,
    objbin TYPE soli OCCURS 0 WITH HEADER LINE,
    objtxt TYPE zdp_solisti1 OCCURS 0 WITH HEADER LINE,
    reclist TYPE somlreci1 OCCURS 0 WITH HEADER LINE,
    doc_chng LIKE sodocchgi1,
    tab_lines LIKE sy-tabix.
    CLEAR GV_DELIMIT.
    GV_DELIMIT = CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
    TEMPREAD = LV_LNCNT1.
    REFRESH OBJTXT.
    CONCATENATE 'The no. of error records are : ' TEMPREAD
    INTO OBJTXT-LINE.
    APPEND OBJTXT.
    CLEAR OBJPACK. REFRESH OBJPACK.
    CONCATENATE C_CODE
    C_CMMT
    C_COMMENT1
    INTO OBJTXT-LINE SEPARATED BY GV_DELIMIT.
    APPEND OBJTXT.
    LOOP AT IT_DATA INTO WA_DATA.
    CONCATENATE WA_DATA-ZCODE
    WA_DATA-ZCOMMENT
    WA_DATA-ZREASON
    INTO OBJTXT-LINE SEPARATED BY GV_DELIMIT.
    APPEND OBJTXT.
    ENDLOOP.
    CLEAR GV_DELIMIT.
    CLEAR OBJPACK. REFRESH OBJPACK.
    CLEAR DOC_CHNG.
    TAB_LINES = 0.
    OBJHEAD = REJFILE. APPEND OBJHEAD.
    DESCRIBE TABLE OBJTXT LINES TAB_LINES.
    READ TABLE OBJTXT INDEX TAB_LINES.
    DOC_CHNG-OBJ_NAME = REJFILE.
    MOVE TEXT-006 TO
    DOC_CHNG-OBJ_DESCR.
    DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
    CLEAR OBJPACK-TRANSF_BIN.
    OBJPACK-HEAD_START = 1.
    OBJPACK-HEAD_NUM = 0.
    OBJPACK-BODY_START = 1.
    OBJPACK-BODY_NUM = 1. " 3.
    OBJPACK-DOC_TYPE = 'RAW'.
    APPEND OBJPACK.
    FOR ASCII TO BINARY OBJECT FUNCTION
    TOTLINEXFER = 0.
    TOTXFER = 0.
    BINMAXLEN = 255.
    REFRESH OBJBIN.
    LV_CR = CL_ABAP_CHAR_UTILITIES=>CR_LF.
    TGTMAXLEN = BINMAXLEN.
    TGTLEN = 0.
    LOOP AT OBJTXT FROM 2.
    IF NOT OBJTXT-LINE CP 'The no. of records are '." AND
    CONCATENATE OBJTXT-LINE LV_CR INTO BUFFER.
    SRCOBJLEN = STRLEN( BUFFER ).
    SRCOBJPTR = 0.
    WHILE SRCOBJLEN > 0 .
    XFERLEN = TGTMAXLEN - TGTLEN.
    IF XFERLEN > SRCOBJLEN.
    XFERLEN = SRCOBJLEN.
    MOVE BUFFERSRCOBJPTR TO OBJBIN-LINETGTLEN.
    TGTLEN = TGTLEN + SRCOBJLEN.
    SRCOBJLEN = 0.
    CLEAR BUFFER.
    ELSE.
    MOVE BUFFER+SRCOBJPTR(XFERLEN) TO
    OBJBIN-LINE+TGTLEN(XFERLEN).
    APPEND OBJBIN.
    CLEAR OBJBIN-LINE.
    TGTLEN = 0.
    SRCOBJLEN = SRCOBJLEN - XFERLEN.
    SRCOBJPTR = SRCOBJPTR + XFERLEN.
    TOTLINEXFER = TOTLINEXFER + 1.
    ENDIF.
    TOTXFER = TOTXFER + XFERLEN.
    ENDWHILE.
    ENDIF.
    ENDLOOP.
    IF TGTLEN > 0.
    APPEND OBJBIN.
    TOTLINEXFER = TOTLINEXFER + 1.
    ENDIF.
    CLEAR OBJPACK-TRANSF_BIN.
    OBJPACK-TRANSF_BIN = 'X'.
    OBJPACK-HEAD_START = 1.
    OBJPACK-HEAD_NUM = 0.
    OBJPACK-BODY_START = 1.
    OBJPACK-BODY_NUM = TOTLINEXFER.
    OBJPACK-DOC_TYPE = 'XLS'.
    OBJPACK-OBJ_NAME = REJFILE.
    OBJPACK-OBJ_DESCR = 'Rejected Entries File'.
    OBJPACK-DOC_SIZE = TOTXFER.
    APPEND OBJPACK.
    REFRESH RECLIST.
    MAIL1 = 'xxxxxxxx' " Email Address
    RECLIST-RECEIVER = MAIL1.
    RECLIST-REC_TYPE = 'U'.
    APPEND RECLIST.
    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.
    IF SY-SUBRC 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
           As per your requirement, In  the above program you need to fill OBJTXT with the contents of your internal table as per your requirement. This is the data which is displayed as the body of your mail.
    Hope this is helpful to you. If you need further information, revert back.
    Reward all the helpful answers.
    Regards
    Nagaraj T

  • Send Email Attaching the Report generated in Program.

    Hi All,
    I am generating a report in list format with write statements.
    My requirement is to send an email attaching this report as an attachment.
    I wanted to know how to get the listobject of the report generated by my program from the memory. Can anyone guide me with this ?
    It will be appreciable , If any one can give me more information on sending mails attaching the reports  generated by the program.
    Thanks in advance,
    Mayank

    Hi,
    I think the problem is not clear.
    My problem is to get the listobject name which got generated after the program run.I want to attach this list report to the email. I have seen a code from one of the link.
    Here it is.
    List of Users According to Logon Date and Password Change
    NOTE: Create ALI/OTF Document in Spool
      SUBMIT rsusr200 WITH valid = 'X'
                      WITH notvalid = space
                      WITH unlocked = 'X'
                      WITH locked = space
                 EXPORTING LIST TO MEMORY AND RETURN.
    <b>* Read list from memory into table
      CALL FUNCTION 'LIST_FROM_MEMORY'
        TABLES
          listobject = lt_listobject
        EXCEPTIONS
          not_found  = 1
          OTHERS     = 2.
      IF sy-subrc <> 0.
      Error in function module &1
        MESSAGE ID '61' TYPE 'E' NUMBER '731'
           WITH 'LIST_FROM_MEMORY'.
      ENDIF.</b>
    Because listobject is of size RAW(1000)
    and objbin is of size CHAR(255) we make this table copy
      CALL FUNCTION 'TABLE_COMPRESS'
        TABLES
          in             = lt_listobject
          out            = lt_objbin
        EXCEPTIONS
          compress_error = 1
          OTHERS         = 2.
      IF sy-subrc <> 0.
      Error in function module &1
        MESSAGE ID '61' TYPE 'E' NUMBER '731'
           WITH 'TABLE_COMPRESS'.
      ENDIF.
    Here the report is sumitted with the option of exporting the list in to the memory which is later read using 'LIST_FROM_MEMORY'.
    But here i need the same report's output to be captured and want to read the list generated from memory into table.
    How can i get the listobject of the list generated by the report in the same report program itself ??
    Please let me know.
    Mayank

  • Send Report output as Email attachment (PDF)

    Hi Experts,
      i am trying to send the contents of an internal table from my report as email using PDF attachment. I have coded the logic and i get the attachment in the email. When i try to open the attachement, i cannot open it.
    The message i get is "_Adobe reader could not open the attachment "attach.pdf" because it is either not a supported file type or the file has been damaged(for example, it was sent as an email attachment and wasn't correctly decoded )._
    Not sure where i went wrong.
      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[] = it_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.                    "send_file_as_email_attachment

    Hello RnB,
    You can check the mentioned link for the same:
    [Simple Program to generate PDF from ABAP List Output.|http://www.abapmadeeasy.com/2011/02/sap-abap-simple-program-to-generate-pdf.html]
    Regards,
    Uttam Agrawal

  • Simple report list output sent as attachment thru email

    Hi All,
    Here's my task : I need to schedule a bi-weekly report that obviously runs in the background and produces output. From that output, I want to capture (with no manual intervention) the list output to an attachment and email a recipient. I've looked over code snippets and understand most of the <b>LIST</b> functions, but most deal with uploading a file from the frontend, which I do not want. Any ideas? Thx in advance.
    Jim

    Hi
    see the sample report to send mail as attachement
    modify it as per your requirement
    Mailing with Attachment by ABAP Coding  
    Refer this link:
    Mail with attachment.
    FORM send_list_to_basis .
      DATA: w_path      LIKE rlgrap OCCURS 0 WITH HEADER LINE,
            lt_index    TYPE sy-tabix,
            doc_type(3) TYPE c,
            descr       LIKE it_objpack_basis-obj_descr,
            temp_data   LIKE w_path,
            temp1       TYPE string,
            tab_lines   TYPE i,
            langu(15)   TYPE c,
            expirydate  TYPE so_obj_edt,
            L_FILE1(100).
      CONCATENATE 'C:\' sy-repid '_' sy-datum '.XLS' INTO L_FILE1.
      W_PATH-FILENAME = L_FILE1.
      APPEND w_path.
      CLEAR w_path.
      wa_doc_chng-obj_descr  = 'User List not logged on for 180 days'.
      wa_doc_chng-obj_langu  = 'E'.
      wa_doc_chng-obj_expdat = sy-datum.
      CLEAR w_subject.
      CONCATENATE 'Please find attached document with list of users'
                  'not logged on for 180 days for client' sy-mandt
                  INTO w_subject SEPARATED BY space.
      it_objtxt_basis-line = w_subject.
      APPEND it_objtxt_basis.
      CLEAR it_objtxt_basis.
      it_objtxt_basis-line = text-004.
      APPEND it_objtxt_basis.
      CLEAR it_objtxt_basis.
      CLEAR w_tab_line.
      DESCRIBE TABLE it_objtxt_basis LINES w_tab_line.
      READ TABLE it_objtxt_basis INDEX w_tab_line  INTO l_cline.
      wa_doc_chng-doc_size =
       ( w_tab_line - 1 ) * 255 + STRLEN( l_cline ).
      CLEAR it_objpack_basis-transf_bin.
      it_objpack_basis-head_start = 1.
      it_objpack_basis-head_num   = 0.
      it_objpack_basis-body_start = 1.
      it_objpack_basis-body_num   = w_tab_line.
      it_objpack_basis-doc_type   = 'RAW'.
      APPEND it_objpack_basis.
      CLEAR it_objpack_basis.
      LOOP AT w_path.
        temp1 = w_path.
        descr = w_path.
        CALL FUNCTION 'STRING_REVERSE'
          EXPORTING
            string  = descr
            lang    = 'E'
          IMPORTING
            rstring = descr.
        CALL FUNCTION 'STRING_SPLIT'
          EXPORTING
            delimiter = '\'
            string    = descr
          IMPORTING
            head      = descr
            tail      = temp_data.
        CALL FUNCTION 'STRING_REVERSE'
          EXPORTING
            string  = descr
            lang    = 'E'
          IMPORTING
            rstring = descr.
        CALL FUNCTION 'STRING_SPLIT'
          EXPORTING
            delimiter = '.'
            string    = descr
          IMPORTING
            head      = temp_data
            tail      = doc_type.
        CALL FUNCTION 'GUI_UPLOAD'
          EXPORTING
            filename      = temp1
            filetype      = 'BIN'
            header_length = 0
            read_by_line  = 'X'
            replacement   = '#'
          TABLES
            data_tab      = it_upload.
        DESCRIBE TABLE it_upload LINES tab_lines.
        DESCRIBE TABLE it_objbin_basis LINES lt_index.
        lt_index = lt_index + 1.
        LOOP AT it_upload.
          wa_objbin_basis-line = it_upload-line.
          APPEND wa_objbin_basis TO it_objbin_basis.
          CLEAR wa_objbin_basis.
        ENDLOOP.
        it_objpack_basis-transf_bin = 'X'.
        it_objpack_basis-head_start = 0.
        it_objpack_basis-head_num   = 0.
        it_objpack_basis-body_start = lt_index.
        it_objpack_basis-body_num   = tab_lines.
        it_objpack_basis-doc_type   = doc_type.
        it_objpack_basis-obj_descr  = descr.
        it_objpack_basis-doc_size   = tab_lines * 255.
        APPEND it_objpack_basis.
        CLEAR it_objpack_basis.
      ENDLOOP.
      it_reclist_basis-receiver = '[email protected]'.
      it_reclist_basis-rec_type = 'U'.
      APPEND it_reclist_basis.
      CLEAR it_reclist_basis.
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = wa_doc_chng
          put_in_outbox              = 'X'
          commit_work                = 'X'
        TABLES
          packing_list               = it_objpack_basis
          contents_txt               = it_objtxt_basis
          contents_bin               = it_objbin_basis
          receivers                  = it_reclist_basis
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          operation_no_authorization = 4
          OTHERS                     = 99.
      IF sy-subrc EQ 0.
        SUBMIT rsconn01 WITH mode = 'INT' AND RETURN.
      ENDIF.
    ENDFORM.                    " send_list_to_basis
    Reward points if useful
    Regards
    Anji

  • I want to send my output of report as an email attachment

    i am having internal table contains values.
    i want that output should be send as an email attachment
    to email id given in selection screen.
    help me how to pass that internal table to the parameters
    of SO_DOCUMENT_SEND_API1 function module
    should i call any function modules to format my internal table to get as an attachment in email.
    help me its urgent..

    *& Report  ZEMAIL_ATTACH                                               *
    *& Example of sending external email via SAPCONNECT                    *
    REPORT  ZEMAIL_ATTACH                   .
    TABLES: ekko.
    PARAMETERS: p_email   TYPE somlreci1-receiver
                                      DEFAULT '[email protected]'.
    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 TYPE x VALUE '0D',  "OK for non Unicode
                 con_tab TYPE x 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

  • CS6, no longer available? Quiz Reporting by email attachment

    Our company has a custom-built ColdFusion LMS which pulls in data from Captivate via the Email attachment option. See below:
    This option looks to have been removed from Captivate 6.
    Anyone know how to get around this issue?
    Thanks

    You are correct that the email reporting option has been removed from Captivate 6.
    I suggest you look at the External Server Reporting option which uses PHP files and port the code over to ColdFusion to work with your custom LMS.  That's probably the most direct route.

  • How to embedded oracle report data in email body from forms?

    Hi,
    I am working on oracle forms and report 10g and i am new to this. I want to knw How to embedded oracle report data in email body ?
    Regards
    Shruti

    I have uploaded a sample . This might help
    http://www.alexyscorp.com/send_report_email.zip

  • Scheduling a Report to Deliver As an Email Attachment

    Hi,
    I want to schedule a Report to Deliver As an Email Attachment. But I am getting the below error.
    oracle.apps.xdo.service.delivery.DeliveryException: oracle.apps.xdo.delivery.DeliveryException: Exception reading response;
    nested exception is:
         java.net.SocketException: Connection reset
         at oracle.apps.xdo.service.delivery.impl.DeliveryServiceImpl.deliverToEmail(DeliveryServiceImpl.java:235)
         at oracle.apps.xdo.servlet.scheduler.XDOJob.deliver(XDOJob.java:1215)
         at oracle.apps.xdo.servlet.scheduler.XDOJob.execute(XDOJob.java:493)
         at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
         at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
    In the below link its given to setup the email server (ArGoSoft Mail Server Freeware)
    http://www.oracle.com/technology/obe/obe_bi/bipub/advance/advance.htm
    But I did not do the steps mentioned in the above link. Since I have email server configured on my system.
    I am using the proper Host name and Port. Can you please suggest why I am getting this error.
    Thanks,
    Shiva

    Not really the best way to go.  You'll waste a lot of time and it may not work for your receiver.  Most email hosts have file size limits that make emailing video files a problem.  Better choice is upload you video to YouTube or some other file sharing site then email a link.

  • Zip the data and send as an email attachment

    Hi,
    I have a requirement where I want to send the log as an email attachment. The log size is very huge about 20MB. When I try to send this log as an excel attachment through FM SO_DOCUMENT_SEND_API1 its throwing an error related to the attachment size. Is there any way to zip the data and send the zipped attachment?
    Any help is really appreciated.
    Thnaks,
    Rajinikanth G

    which might help you getting the file from the pc or you can change the source path and then send it to the following reciptant
    data method1 like sy-ucomm.
    data g_user like soudnamei1.
    data g_user_data like soudatai1.
    data g_owner like soud-usrnam.
    data g_receipients like soos1 occurs 0 with header line.
    data g_document like sood4 .
    data g_header like sood2.
    data g_folmam like sofm2.
    data g_objcnt like soli occurs 0 with header line.
    data g_objhead like soli occurs 0 with header line.
    data g_objpara  like selc occurs 0 with header line.
    data g_objparb  like soop1 occurs 0 with header line.
    data g_attachments like sood5 occurs 0 with header line.
    data g_references like soxrl occurs 0 with header line.
    data g_authority like sofa-usracc.
    data g_ref_document like sood4.
    data g_new_parent like soodk.
    data: begin of g_files occurs 10 ,
      text(4096) type c,
       end of g_files.
    data : fold_number(12) type c,
           fold_yr(2) type c,
           fold_type(3) type c.
    parameters ws_file(4096) type c default 'c:\debugger.txt'.
    Can me any file fromyour pc ....either xls or word or ppt etc ...
    g_user-sapname = sy-uname.
    call function 'SO_USER_READ_API1'
    exporting
       user                            = g_user
       PREPARE_FOR_FOLDER_ACCESS       = ' '
    importing
       user_data                       = g_user_data
    EXCEPTIONS
       USER_NOT_EXIST                  = 1
       PARAMETER_ERROR                 = 2
       X_ERROR                         = 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.
    fold_type = g_user_data-outboxfol+0(3).
    fold_yr = g_user_data-outboxfol+3(2).
    fold_number =  g_user_data-outboxfol+5(12).
    clear g_files.
    refresh : g_objcnt,
      g_objhead,
      g_objpara,
      g_objparb,
      g_receipients,
      g_attachments,
      g_references,
      g_files.
    method1 = 'SAVE'.
    g_document-foltp  = fold_type.
    g_document-folyr   = fold_yr.
    g_document-folno   = fold_number.
    g_document-objtp   = g_user_data-object_typ.
    *g_document-OBJYR   = '27'.
    *g_document-OBJNO   = '000000002365'.
    *g_document-OBJNAM = 'MESSAGE'.
    g_document-objdes   = 'Manohar testing by program'.
    g_document-folrg   = 'O'.
    *g_document-okcode   = 'CHNG'.
    g_document-objlen = '0'.
    g_document-file_ext = 'TXT'.
    g_header-objdes =  'Manohar testing by program'.
    g_header-file_ext = 'TXT'.
    call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
      exporting
        method             = method1
       office_user        = sy-uname
       ref_document       = g_ref_document
       new_parent         =  g_new_parent
    importing
       authority          =  g_authority
    tables
       objcont            = g_objcnt
       objhead            = g_objhead
       objpara            = g_objpara
       objparb            = g_objparb
       recipients         = g_receipients
       attachments        = g_attachments
       references         = g_references
       files              = g_files
      changing
        document           = g_document
       header_data        = g_header
      FOLMEM_DATA        =
      RECEIVE_DATA       =
    File from the pc to send...
    method1 = 'ATTCREATEFROMPC'.
    g_files-text = ws_file.
    append g_files.
    call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
      exporting
        method             = method1
       office_user        = g_owner
       ref_document       = g_ref_document
       new_parent         =  g_new_parent
    importing
       authority          =  g_authority
    tables
       objcont            = g_objcnt
       objhead            = g_objhead
       objpara            = g_objpara
       objparb            = g_objparb
       recipients         = g_receipients
       attachments        = g_attachments
       references         = g_references
       files              = g_files
      changing
        document           = g_document
       header_data        = g_header
    method1 = 'SEND'.
    g_receipients-recnam = 'MK085'.
    g_receipients-recesc = 'B'.
    g_receipients-sndex = 'X'.
    append  g_receipients.
    call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
      exporting
        method             = method1
       office_user        = g_owner
       ref_document       = g_ref_document
       new_parent         =  g_new_parent
    importing
       authority          =  g_authority
    tables
       objcont            = g_objcnt
       objhead            = g_objhead
       objpara            = g_objpara
       objparb            = g_objparb
       recipients         = g_receipients
       attachments        = g_attachments
       references         = g_references
       files              = g_files
      changing
        document           = g_document
       header_data        = g_header.
    this code might help you

  • Email Attachment Via Report

    Hi Friends
    I have an issue like i need to send the internal table data to distribution list as an attachment.. I am able to send the email attachment to the list but in the Parameter OBJBIN i hardcoded the sy-uname sy-repid to make sure that along with the output prog name and userid also gets displayed in the attachment..
    My issue is Like while debuggin the FM SO_NEW_DOCUMENT_ATT_SEND_API1 i am getting the data line by line but in output attachment i am getting it as a single line..
    I want to see the output with prog name and sy-repid line one after other..
    Kindly help me in solving this issue
    Thanks in advance,
    Kishore

    Hi Srinivas,
    Thanks a lot for your response. Actually i already have tat piece of code which u have mentioned in your scrap.
    This is my code
    for eg.
      CONCATENATE '0101010101' 'HI HOW ARE U' INTO objbin
        SEPARATED BY CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
      APPEND OBJBIN.
    DESCRIBE TABLE OBJBIN LINES TAB_LINES.
      OBJHEAD = 'PURCHASEORDERS'.
      APPEND OBJHEAD.
    Creation of the entry for the compressed attachment
       OBJPACK-TRANSF_BIN = 'X'.
       OBJPACK-HEAD_START = 1.
       OBJPACK-HEAD_NUM = 1.
       OBJPACK-BODY_NUM = TAB_LINES.
       OBJPACK-DOC_TYPE = 'HTM'.
       OBJPACK-OBJ_DESCR = 'COST SWEEPER.htm'.
       OBJPACK-DOC_SIZE = TAB_LINES * 255.
       APPEND OBJPACK.
    Completing the recipient list
      clear reclist.
      refresh reclist[].
      reclist-receiver = 'Z_FI_SYS_ACT'.
      reclist-rec_type = 'C'.
      APPEND reclist.
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          DOCUMENT_DATA                 = DOC_CHNG
          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
          DOCUMENT_TYPE_NOT_EXIST          = 3
          OPERATION_NO_AUTHORIZATION       = 4
          PARAMETER_ERROR                  = 5
          X_ERROR                          = 6
          ENQUEUE_ERROR                    = 7
          OTHERS                           = 8
        IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    Thanks a lot
    Kishore

Maybe you are looking for