Send Reports in an Email

I was wondering if any of you have been challenged to automatically send reports from CRMOD via Email. If you have and you were successful how did you guys do it.
I hope this feature is built in future versions

Smjohn,
You can't automatically run reports to send via email but why not setup a dashboard as a custom web tab for these people so they can just click on the tab to view the report?
cheers
Alex

Similar Messages

  • Cannot send report to desired email address

    Hi,
    When an user tries to schedule a webi report in InfoView and send the report (as an attachment) to an manually entered email address, the report is always send to the default email address (of the adaptive Jobserver defaults).
    The user schedules the webi report by rightclicking it in InfoView -> select schedule -> format and destinations-> select email recipients -> deselect Job server defaults ->enter email -> click on schedule
    The default email address is the address entered in the CMC in servers -> adaptiveJobserver -> Destination.
    All users are experiencing this problem, except for the (general) Administrators.
    So I guess the problem is caused by insufficient rights. Obviously the question is which right I have to enable in order to make sure the report is delivered to the email address the user has entered.
    BTW, I'm using BO XI R3.1 FP1.3.
    Thanks a lot.

    Hello rp02100 and welcome to the BlackBerry Support Community Forums.
    Sorry to hear you're experiencing an issue with your email.
    What type of email account are you using - Gmail, Yahoo, POP/IMAP, Hotmail? Does this only happen when you try to send to yourself using this email and to this email account? 
    If you have more than one email account, if you were to use a different email account and send yourself an email to another account, does this same issue happen?
    Thanks!
    -HMthePirate
    Come follow your BlackBerry Technical Team on twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.Click Solution? for posts that have solved your issue(s)!

  • Send report as an email attachment from a page

    Hi
    I have page which generates a report based on two filters. After the report is generated, 'I want to send that report as an email attachment from that page, when button is clicked "Send Email"
    Thanks a lot in advance.'

    I accomplished functionality I believe similar to what you are looking for in an application once by querying a report into an html e-mail message. This approach gives you all kinds of flexibility. At least this would be one way of doing it. I am going to include a simplified sample here of what the script looked like. I hope this is at least helpful.
    DECLARE
    l_body_html CLOB;
    BEGIN
    l_body_html :=
    '<html>
    <head>
    <style type="text/css">
    body{font-family: Arial, Helvetica, sans-serif;
    font-size:9pt;
    margin:30px;
    background-color:#ffffff;}
    </style>
    </head><body>
    ' || UTL_TCP.crlf;
    l_body_html :=
    l_body_html || '<table border="1"><tr bgcolor="#999999">
    <th width="75" scope="col">
    Department
    </th>
    <th width="75" scope="col">
    Course
    </th>
    </tr>' || UTL_TCP.crlf;
    FOR c1 IN (SELECT some_table.DEPARTMENT, some_table.COURSE FROM some_table)
    LOOP
    l_body_html :=
    l_body_html || '<tr><td>
    ' || c1.DEPARTMENT || '
    </td>' || UTL_TCP.crlf;
    l_body_html := l_body_html || '<td>
    ' || c1.COURSE || '
    </td>' || UTL_TCP.crlf;
    l_body_html := l_body_html || '</tr>' || UTL_TCP.crlf;
    END LOOP;
    l_body_html := l_body_html || '</table>' || UTL_TCP.crlf;
    apex_mail.send(
    p_to => '<some email address>',
    p_from => '<desired from address here>',
    p_body => NULL,
    p_body_html => l_body_html,
    p_subj => '<desired subject line here>');
    END loop;
    apex_mail.push_queue;
    END;
    Edited by: stbrownOSU on Dec 8, 2009 2:53 PM
    I think something must have happened when I copied and pasted the code from TOAD. I have corrected the above code. Please try it again.

  • 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

  • Sending reports output to email

    Hi ,
    I would like to send output of a report to email insted of printer. Are there any setting to be done. We are running on 11i.
    Thanks
    Kiran

    Please see the user manual.
    Oracle Alert User's Guide
    http://download.oracle.com/docs/cd/B25516_18/current/acrobat/115alrug.pdf
    Also, see old threads which discuss the same topic -- http://forums.oracle.com/forums/search.jspa?threadID=&q=Send+AND+E-mail+AND+Alert&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • Send report output via email as zipped attachment

    Is it possible for the report output to be zipped before being attached to an email when running on a windows reports_server? On unix we theoretically have the ability to modify the mail.sh shell script that performs the mail operation for reports.

    Hi Richard
    This is a Reports 9i solution.
    You may create a batch file that runs the report, compresses the file and invokes, say, a Java application that mails the given .zip file.
    More "advanced" options would be:
    You may create a pluggable destination that captures report output. Next, your code does the compresses the output file and mails it.
    A simpler solution would be to run two reports. First, that creates the reports output file. In its AFTER_REPORT trigger, call Java method (thru. Java Importer), that picks up the output file and compresses it. Second, that uses XML distribution feature of Reports 9i and mails the .zip file as a file attachment using appropriate construct.
    Regard
    Sripathy

  • Send report query as email attachment

    Hi,
    I have created a multireport query under Shared Components that allows users to print several sql queries to a pdf file in a prefefined format. Is it possible to generate an email out of Apex with this report query pdf as an attachment (without having the users save the pdf to their hard drive and and manually attach to an email)?
    Thanks,
    Forrest

    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

  • Report output as email

    Hi All,
    I need to send report output as email text. is anybody has done this sort of work or any function module for this.
    Please help if anyone knows it.
    Cheers,
    Lokesh

    Hi
      Check the code for similar requirement I was faced earlier.
    Type for binary attachment table.
      types: l_ty_tab_objbin type solisti1 occurs 0.
      data: l_objbin type l_ty_tab_objbin.
    Tables to hold PDF data
      data: t_doctab type docs occurs 0,
            t_line  type tline occurs 0.
      tables : soli.             "SAPoffice: line, length 255
      tables : zpsdsalrep.       "ZPSDSALREP
      data: l_email type soli-line.
      data: l_email1 type soli-line.
      data: l_adrnr like kna1-adrnr.
      data: l_objky type nast-objky.
      data: l_zzterrmg type zpsdsalrep-zzterrmg.
      data: l_zsupervisor type zpsdsalrep-zsupervisor.
      data: l_kunnr type kna1-kunnr.
      data: l_kunnr1 type vbak-kunnr.
      data: l_reclist like somlreci1 occurs 0 with header line.
      data: l_objtxt    like solisti1 occurs   0 with header line.
      data: l_objpack   like sopcklsti1 occurs 0 with header line.
      data: l_doc_chng  like sodocchgi1.
      data: l_objhead   like solisti1 occurs   0 with header line.
      data: l_tab_lines like sy-tabix.
      constants: k_true type boolean_flg value 'X'.
      data: l_mail type somlreci1-receiver.
      data: l_mail1 type somlreci1-receiver.
      data:
    l_l_mail2 TYPE somlreci1-receiver.
    l_l_mail type somlreci1-receiver.
      data: l_zzsalesrep type zpsdsalrep-zzsalesrep.
      data: l_recipents type somlreci1-receiver.
      constants: k_x(1) type c value 'X',
                 k_u(1) type c value 'U',
                 k_raw(3) type c value 'RAW'.
      call function 'CONVERT_OTF_2_PDF'
    EXPORTING
      USE_OTF_MC_CMD               = 'X'
      ARCHIVE_INDEX                =
    IMPORTING
      BIN_FILESIZE                 =
        tables
          otf                          = t_otfdata
          doctab_archive               = t_doctab
          lines                        = t_line
          exceptions
         err_conv_not_possible        = 1
         err_otf_mc_noendmarker       = 2
         others                       = 3.
      if sy-subrc <> 0.
        write: / 'error', sy-subrc.
      endif.
    ***/ Convert the PDF format to the table type required for the
    **attachment.
      call function 'QCE1_CONVERT'
        tables
          t_source_tab         = t_line
          t_target_tab         = l_objbin
        exceptions
          convert_not_possible = 1
          others               = 2.
      if sy-subrc <> 0.
        write: / 'error', sy-subrc.
      endif.
      select single kunnr from vbak into l_kunnr1
             where vbeln = nast-objky.
      select single adrnr from kna1 into l_adrnr
             where kunnr = l_kunnr1.
      check sy-subrc is initial.
      select single smtp_addr from adr6 into l_email
             where addrnumber = l_adrnr.
    SELECT SINGLE zzterrmg FROM zpsdsalrep INTO l_zzterrmg
            WHERE zzsalesrep = l_kunnr1.
    SELECT SINGLE zsupervisor FROM zpsdsalrep INTO l_zsupervisor
         WHERE  zzterrmg = l_zzterrmg.
    SELECT SINGLE kunnr FROM kna1 INTO l_kunnr
           WHERE sortl = l_zsupervisor.
    SELECT SINGLE zsupervisor FROM zpsdsalrep INTO l_zsupervisor
           WHERE  zzsalesrep = l_kunnr1.
    SELECT SINGLE zzsalesrep FROM zpsdsalrep INTO l_zzsalesrep
           WHERE zzterrmg = l_zsupervisor.
    SELECT SINGLE adrnr FROM kna1 INTO l_adrnr
              WHERE kunnr = l_zzsalesrep.
    CHECK sy-subrc IS INITIAL.
    SELECT SINGLE smtp_addr FROM adr6 INTO l_email1
            WHERE addrnumber = l_adrnr.
    SELECT SINGLE adrnr FROM kna1 INTO l_adrnr
            WHERE kunnr = l_kunnr.
    CHECK sy-subrc IS INITIAL.
    SELECT SINGLE smtp_addr FROM adr6 INTO l_email1
            WHERE addrnumber = l_adrnr.
      l_mail = l_email.
    l_mail1 = l_email1.
    l_l_mail2 = text-006.
      l_l_mail = text-007.
    Creation of the document to be sent
    File Name
      l_doc_chng-obj_name = 'SENDFILE'.
    Mail Subject
      concatenate text-001 nast-objky into l_doc_chng-obj_descr.
    l_doc_chng-obj_descr = text-001.
    Completing the recipient list
      l_reclist-receiver = l_mail.
      l_reclist-rec_type = k_u.
      append l_reclist.
    l_reclist-receiver = l_mail1.
    l_reclist-rec_type = 'U'.
    APPEND l_reclist.
      l_reclist-receiver = l_l_mail.
      l_reclist-rec_type = k_u.
      append l_reclist.
    l_reclist-receiver = l_l_mail2.
    l_reclist-rec_type = 'U'.
    APPEND l_reclist.
    Mail Contents
      l_objtxt = text-002.
      append l_objtxt.
      clear l_objtxt.     " put in a blank line
      append l_objtxt.
      data: l_subject type solisti1.
      concatenate text-003 '-' nast-objky into l_subject.
      l_objtxt = l_subject.
      append l_objtxt.
      l_objtxt = text-004 .
      append l_objtxt.
    Calculate email size in bytes
      describe table l_objtxt lines l_tab_lines.
      read table l_objtxt index l_tab_lines.
      l_doc_chng-doc_size = ( l_tab_lines - 1 ) * 255 + strlen( l_objtxt ).
    Creation of the entry for the compressed document
    for the email text
      clear l_objpack-transf_bin.
      l_objpack-head_start = 1.
      l_objpack-head_num = 0.
      l_objpack-body_start = 1.
      l_objpack-body_num = l_tab_lines.
      l_objpack-doc_type = k_raw.
      append l_objpack.
    Creation of the document attachment
    (Assume that the data in OBJBIN is in BMP format)
      describe table l_objbin lines l_tab_lines.
      l_objhead = text-001  .
      append l_objhead.
      clear l_objpack.
    **/ Creation of the entry for the compressed/attached document
      l_objpack-transf_bin = k_true.
      l_objpack-head_start = 1.
      l_objpack-head_num = 1.
      l_objpack-body_start = 1.
      l_objpack-body_num = l_tab_lines.
      l_objpack-doc_type = 'PDF'.
      l_objpack-obj_name = text-005.
      l_objpack-obj_descr = text-001.
      l_objpack-doc_size = l_tab_lines * 255.
      append l_objpack. "/ .
      delete  l_reclist where receiver = ''.
    Sending the document
      call function 'SO_NEW_DOCUMENT_ATT_SEND_API1' " IN UPDATE TASK "/ .
        exporting
          document_data              = l_doc_chng
          put_in_outbox              = k_x
        tables
          packing_list               = l_objpack
          object_header              = l_objhead
          contents_bin               = l_objbin
          contents_txt               = l_objtxt
          receivers                  = l_reclist
        exceptions
          too_many_receivers         = 1
          document_not_sent          = 2
          operation_no_authorization = 4
          others                     = 99.
      if sy-subrc <> 0.
        write: / 'unsuccessful', sy-subrc.
      else.
        concatenate l_mail ',' l_mail1 ',' l_l_mail into l_recipents.
        syst-msgid = '8I'.
        syst-msgno = '000'.
        syst-msgty = 'S'.
        syst-msgv1 = text-008.
        skip.
        syst-msgv2 = text-009.
        syst-msgv3 = l_recipents.
        clear:  syst-msgv4. "syst-msgv2, syst-msgv3,
        perform protocol_update.
        write:  / 'successful'.
      endif.
    **/Take_note it is a requirement to do a commit work for the
    email to go into transaction SOST.
    COMMIT WORK.   "/Take_note .
    if sy-subrc eq 0.
    endif.
    Regards,
    Sreeram

  • Email bursting send report as HTML in email body

    Hello,
    I have Oracle BI Publisher 10.1.3.4.1 (build# 1101) version installed as part of Oracle Business Inteligence.
    I have question about email bursting. I created simple report and I am bursting it via email. But I would like to send report in HTML as part of email body and not as attachment. I read that it is possible in other versions of BIP (as part of EBS) with using of bursting configuration file. But I can not use this file with my version of BIP, I can configure bursting only vie SQL query.
    Is there any solution?
    Thank you

    My bursting SQL query:
    SELECT DISTINCT
    ip.APPL_ID KEY,
    '11F_Search_Prospect_Email' TEMPLATE,
    'RTF' template_format,
    'en-US' locale,
    'HTML' output_format,
    'EMAIL' DEL_CHANNEL,
    ip.email PARAMETER1,
    '[email protected]' PARAMETER3,
    'Welcome' PARAMETER4,
    'true' PARAMETER6
    FROM ugrad.inquiry_prospect ip,
    ugrad.correspondence f,
    ugrad.address e,
    ugrad.f_lookup fl
    WHERE ip.appl_id = f.appl_id
    AND ip.APPL_ID = e.APPL_ID
    AND fl.TYPE_CODE='C'
    AND ip.record_stage = 'Prospect'
    AND e.COUNTRY_CODE=fl.code
    AND e.table_name = 'INQUIRY_PROSPECT'
    AND e.address_type =
    NVL ((SELECT gg.address_type
    FROM ugradadm.address gg
    WHERE gg.address_type =
    DECODE (f.mailpref,
    'Home', 'HOME',
    'Best', 'LOCAL',
    'HOME'
    AND gg.table_name = 'INQUIRY_PROSPECT'
    AND gg.APPL_ID = ip.appl_id
    AND((gg.address_type='LOCAL' AND NVL(gg.address_expir_date,sysdate)>sysdate)
    OR gg.address_type='HOME')),
    'HOME'
    AND f.batchid = :Batch_ID
    This report when bursted sends an email with the layout template as html body.
    The EMAIL configuration is set with a server Port number and its host address.

  • Possible?: Send OS X Error Report to custom email address?

    Hi,
    I was wondering is it possible to somehow tweak OS X so that instead of sending software error reports to Apple, it would send them to my email?
    I would use this as a part of our helpdesk ticketing system.

    Hi,
    I was wondering is it possible to somehow tweak OS X so that instead of sending software error reports to Apple, it would send them to my email?
    I would use this as a part of our helpdesk ticketing system.

  • Problem to send a report to an Email address

    Hi All,
    I am using 10g forms and reports.I want to send a report to an email address using web.show_document();
    code is:WEB.SHOW_DOCUMENT('http://localhost:post/reports/rwservlet?userid=ur/ps@db&report='report_name&destype=mail&desformat=RTF&from=[email protected]&desname=[email protected]&paramform=no&_blank') ;
    this code generates an error message:
    REP-50159: Executed successfully but there were some errors when distribute the output
    I already configure my rwbuilder.conf and report_server.conf file.
    Although I am able to send this mail from report builder from FILE->mail menu.
    plz help me ASAP.
    thanks in advance.
    Sanjit

    Ok, did you add your smtp server to your <reports>.conf file is located at the end of the file.
    Because if it has been working for other destype it's probably security smtp related.
    so check if the correct smtp server is written there and that you can access it too because otherwise it would be impossible to send e-mail, if you're not the e-mail admin contact him and ask hin if he sees an attempt to send on the smtp engine log for your from user
    Erwin

  • Send report via email as xls file.

    Hello from Spain,
    Sorry if this is not the correct forum. It's both a forms and reports question, but I think it fits better in the reports forum. I have queried into the forums for similar questions and found some threads without any replies around this same issue. I wish I am lucky today.
    I have developed some web forms which generate pdf and txt reports. The latter ones make use of desformat=delimiteddata when calling the reports. They run fine. I have also developed one form which suscribes those reports to email addresses. To do so, I am setting those email addresses in the DESNAME reports parameter and setting DESTYPE parameter as MAIL. They arrive as an attachment with pdf or txt extensions.
    Now, I am required to deliver those reports as xls files. I have been reading that desformat=spreadsheet would allow me to do so (as well as formatting the reports and make them look "cuter" than by using just delimiteddata), but have been unable to do it so far. When setting desformat=spreadsheet, reports are sent via email as html attachments, and when they are opened they look awful. Is there any way I can do this? It shouldn't be a too big deal, but I feel completely unable.
    Thank you,
    Fernando G.

    Hi,
    Please check the following forum thread that may help --> Re: Generate report in Excel and send to user via email.
    Thanks, RZ

  • Send report as email thru bursting

    I am trying to send report by email thru bursting. My query follows:
    SELECT CLIENT_ID AS KEY
    ,'afsrep' AS TEMPLATE
    ,'RTF' AS TEMPLATE_FORMAT
    ,'en-US' AS LOCALE
    ,'EXCEL' AS OUTPUT_FORMAT
    ,'FILE' AS DEL_CHANNEL
    '[email protected]' PARAMETER1, '[email protected]' PARAMETER2, '[email protected]' PARAMETER3, 'TEST' PARAMETER4,
    'BODY TESET' PARAMETER5, 'true' PARAMETER6, '[email protected]' PARAMETER7
    from Client_contacts
    When we burst the report is opening in the desktop but NOT SENDING EMAIL.
    Can someone help me.
    Edited by: user10711255 on Jun 11, 2009 3:36 AM

    have you configured the address for the email server you will be snding through. its in the delivery setup in administration.

  • Sending Report as HTML via external email.

    I have a report on Apex 4.0.2 and was wondering if it is possible to get the report values as HTML so that I can send them using an email function I have in separate packages?
    I just send the username, recipients and the HTML to this function and it generates the email along with the ones I generate from all other screens.

    Just to clarify, I have a process that is called on submit.
    At the moment it emails fine with data from the apex page, but is there way to include a html version of the page without creating it myself?
    the function is called like this:
    Email(pEmailName => lvEmailName,
    pSubject => lvSubject,
    pTextMsg => lvText,
    pHTMLMsg => lvHtml);
    and I want to pass the data as html to pHTMLMsg.

  • How  convert a report out put to pdf and sending it via an email

    Hi all,
            i have convert the sap list or report output to a pdf file then i have to send it via an email that is given in the selection screen. if anyone knows the solutions for this please make it soon. i will be very thankful.
    Thanks & Regards,
    Poorna

    generate spool request of ur report output and execute the standard program RSTXPDFT4 with tht spool reuest.it will download it in PDF format on ur PC and to send it via mail as attachment ,just copy this below code -
    *& Report  ZGILL_SENDMAIL_PDF                                          *
    REPORT  ZGILL_SENDMAIL_PDF                      .
    INCLUDE ZGILL_INCMAIL.  "SEE BELOW FOR INCLUDE PROGRAM CODE.
    DATA
    DATA : itab LIKE tline OCCURS 0 WITH HEADER LINE.
    DATA : file_name TYPE string.
    data : path like PCFILE-PATH.
    data : extension(5) type c.
    data : name(100) type c.
    SELECTION SCREEN
    PARAMETERS : receiver TYPE somlreci1-receiver lower case DEFAULT '[email protected]'.
    PARAMETERS : p_file LIKE rlgrap-filename
    OBLIGATORY DEFAULT 'C:\TEMP\SALARY_SLIP1.PDF'.
    AT SELECTION SCREEN
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    CLEAR p_file.
    CALL FUNCTION 'F4_FILENAME'
    IMPORTING
    file_name = p_file.
    START-OF-SELECTION
    START-OF-SELECTION.
    PERFORM ml_customize USING 'Tst' 'Testing'.
    PERFORM ml_addrecp USING receiver 'U'.
    PERFORM upl.
    PERFORM doconv TABLES itab objbin.
    PERFORM ml_prepare USING 'X' extension name.
    PERFORM ml_dosend.
    SUBMIT rsconn01
    WITH mode EQ 'INT'
    AND RETURN.
    FORM
    FORM upl.
    file_name = p_file.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = file_name
    filetype = 'BIN'
    TABLES
    data_tab = itab
    EXCEPTIONS
    file_open_error = 1
    file_read_error = 2
    no_batch = 3
    gui_refuse_filetransfer = 4
    invalid_type = 5
    no_authority = 6
    unknown_error = 7
    bad_data_format = 8
    header_not_allowed = 9
    separator_not_allowed = 10
    header_too_long = 11
    unknown_dp_error = 12
    access_denied = 13
    dp_out_of_memory = 14
    disk_full = 15
    dp_timeout = 16
    OTHERS = 17.
    path = file_name.
    CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
    EXPORTING
    complete_filename = path
    CHECK_DOS_FORMAT =
    IMPORTING
    DRIVE =
    EXTENSION = extension
    NAME = name
    NAME_WITH_EXT =
    PATH =
    EXCEPTIONS
    INVALID_DRIVE = 1
    INVALID_EXTENSION = 2
    INVALID_NAME = 3
    INVALID_PATH = 4
    OTHERS = 5
    ENDFORM. "upl
    *********************iNCLUDE pROGRAM********************************************
    *&  Include           ZGILL_INCMAIL                                    *
    Data
    DATA: docdata LIKE sodocchgi1,
    objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
    objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
    objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
    objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
    objhex LIKE solix OCCURS 10 WITH HEADER LINE,
    reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
    DATA: tab_lines TYPE i,
    doc_size TYPE i,
    att_type LIKE soodk-objtp.
    DATA: listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
    FORM
    FORM ml_customize USING objname objdesc.
    Clear Variables
    CLEAR docdata.
    REFRESH objpack.
    CLEAR objpack.
    REFRESH objhead.
    REFRESH objtxt.
    CLEAR objtxt.
    REFRESH objbin.
    CLEAR objbin.
    REFRESH objhex.
    CLEAR objhex.
    REFRESH reclist.
    CLEAR reclist.
    REFRESH listobject.
    CLEAR listobject.
    CLEAR tab_lines.
    CLEAR doc_size.
    CLEAR att_type.
    Set Variables
    docdata-obj_name = objname.
    docdata-obj_descr = objdesc.
    ENDFORM. "ml_customize
    FORM
    FORM ml_addrecp USING preceiver prec_type.
    CLEAR reclist.
    reclist-receiver = preceiver.
    reclist-rec_type = prec_type.
    APPEND reclist.
    ENDFORM. "ml_customize
    FORM
    FORM ml_addtxt USING ptxt.
    CLEAR objtxt.
    objtxt = ptxt.
    APPEND objtxt.
    ENDFORM. "ml_customize
    FORM
    FORM ml_prepare USING bypassmemory whatatt_type whatname.
    IF bypassmemory = ''.
    Fetch List From Memory
    CALL FUNCTION 'LIST_FROM_MEMORY'
    TABLES
    listobject = listobject
    EXCEPTIONS
    OTHERS = 1.
    IF sy-subrc <> 0.
    MESSAGE ID '61' TYPE 'E' NUMBER '731'
    WITH 'LIST_FROM_MEMORY'.
    ENDIF.
    CALL FUNCTION 'TABLE_COMPRESS'
    IMPORTING
    COMPRESSED_SIZE =
    TABLES
    in = listobject
    out = objbin
    EXCEPTIONS
    OTHERS = 1
    IF sy-subrc <> 0.
    MESSAGE ID '61' TYPE 'E' NUMBER '731'
    WITH 'TABLE_COMPRESS'.
    ENDIF.
    ENDIF.
    Header Data
    Already Done Thru FM
    Main Text
    Already Done Thru FM
    Packing Info For Text Data
    DESCRIBE TABLE objtxt LINES tab_lines.
    READ TABLE objtxt INDEX tab_lines.
    docdata-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 = tab_lines.
    objpack-doc_type = 'TXT'.
    APPEND objpack.
    Packing Info Attachment
    att_type = whatatt_type..
    DESCRIBE TABLE objbin LINES tab_lines.
    READ TABLE objbin INDEX tab_lines.
    objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
    objpack-transf_bin = 'X'.
    objpack-head_start = 1.
    objpack-head_num = 0.
    objpack-body_start = 1.
    objpack-body_num = tab_lines.
    objpack-doc_type = att_type.
    objpack-obj_name = 'ATTACHMENT'.
    objpack-obj_descr = whatname.
    APPEND objpack.
    Receiver List
    Already done thru fm
    ENDFORM. "ml_prepare
    FORM
    FORM ml_dosend.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    document_data = docdata
    put_in_outbox = 'X'
    commit_work = 'X' "used from rel. 6.10
    IMPORTING
    SENT_TO_ALL =
    NEW_OBJECT_ID =
    TABLES
    packing_list = objpack
    object_header = objhead
    contents_bin = objbin
    contents_txt = objtxt
    CONTENTS_HEX = objhex
    OBJECT_PARA =
    object_parb =
    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 'SO' TYPE 'S' NUMBER '023'
    WITH docdata-obj_name.
    ENDIF.
    ENDFORM. "ml_customize
    FORM
    FORM ml_spooltopdf USING whatspoolid.
    DATA : pdf LIKE tline OCCURS 0 WITH HEADER LINE.
    Call Function
    CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
    EXPORTING
    src_spoolid = whatspoolid
    TABLES
    pdf = pdf
    EXCEPTIONS
    err_no_otf_spooljob = 1
    OTHERS = 12.
    Convert
    PERFORM doconv TABLES pdf objbin.
    ENDFORM. "ml_spooltopdf
    FORM
    FORM doconv TABLES
    mypdf STRUCTURE tline
    outbin STRUCTURE solisti1.
    Data
    DATA : pos TYPE i.
    DATA : len TYPE i.
    Loop And Put Data
    LOOP AT mypdf.
    pos = 255 - len.
    IF pos > 134. "length of pdf_table
    pos = 134.
    ENDIF.
    outbin+len = mypdf(pos).
    len = len + pos.
    IF len = 255. "length of out (contents_bin)
    APPEND outbin.
    CLEAR: outbin, len.
    IF pos < 134.
    outbin = mypdf+pos.
    len = 134 - pos.
    ENDIF.
    ENDIF.
    ENDLOOP.
    IF len > 0.
    APPEND outbin.
    ENDIF.
    ENDFORM. "doconv
    **********************INCLUDE END********************************

Maybe you are looking for