Sending PO (PDF attach.) via email: adding email body text

Hi,
I need to send Purchase Orders to Vendors as PDF attachments to emails; I have successfully configured all the necessary:
For Output Type NEU
1) Access to conditions (General Data) set to X
2) Dispatch time 3 Send with application own transaction
3) Transmission Medium 5 for External send
4) Processing routines 5 includes a customer Program and Form to make use of my SAPScript
I have set up a Communication Strategy (NET - Internet) and created a condition based on a specific document type.
Using ME9F I can select my PO and successfully output the message - I can view the request using SOST and an email with the PO attached as PDF is sent to the correct recipient (email address of Vendor).
I would like though to add some text to the body of the email, which is totally empty. Can anyone please advise on how to achieve this? In the Output Type config there is a section "Mail title and texts"... can anyone tell me whether this section can be used to add body text to the email and how? I have managed to customise the "Title/Subject" of the email and PO but cannot find a way to add some text in the email body.
Thank you very much for your help.
Gab

Hi Danilo,
You need to do some configuration for this.
- Goto NACE .
- Select EF and click on OUTPUT TYPES.
- Then select Output Type NEU and click on processing routines .
- In that you have to add a new entry - medium 5 .
- Then you need to assign a program, form routine and form.
- You can use the standard program i.e. SAPFM06P, FORM routine is always ENTRY_NEU and standard MEDRUCK.
- Then in PARTNER FUNCTION you need to add a new entry : medium - 5 and function - VN .
- For subject of the mail goto Mail Title and Texts. In title give PO No. &EKKO-EBELN& .
- Under General data -> Replacement of text symbols give programm as SAPMM06E and Form Routine as
TEXT_SYMBOL_REPLACE .
- Now the subject will be PO No. 1800004202.
- You need to maintain your email id in tcode SU01 and also the vendor's email id.
- Now while creating a new purchase order , change the medium to External Send .
- Then goto Communication Method and select CS01 . ALSO make sure that the Cover Page Text has value PO No. &EKKO-EBELN& .
- Goto tcode ME9F .
- Execute.
- Select the checkbox and click on Output Message.
- You will get a message MAII 00000000000001 generated .
If the BASIS guys have made the necessary configuration for sending mail then the mail will go .
You can see the status in tcode SOST.
If you want to use a z-programm and z-form then you need add the functions used in standard programm SAPFM06P for generating mail in your z-programm.
Hope it helps,
Swapnil

Similar Messages

  • To send output as a PDF attachment via email

    Hi experts
    I have the (smartform) output data in OTF format..and displaying it in PDF form with FM 'HR_EFI_SHOW_PDF_FORM' .
    Now the requirement is <b>to send this output as a PDF attachment via email</b>.
    Please help me with sample code to perform this.
    Regards,
    Matt.

    Hi,
    Check this links,
    /people/sap.user72/blog/2004/11/10/bsphowto-generate-pdf-output-from-a-bsp
    Also for email:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8cd6adbb-0301-0010-39ba-938c601d5db9
    Refer the following link for more details:
    http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
    Thanks,
    Reward If Helpful.

  • I work for a retailer who sends out e-receipts as pdf attachements.  When the email arrives on any apple product, i see the email with the paperclip icon showing that there is an attachment but i cannot ever see or find the actual attachment.  Any ideas?

    i work for a retailer who sends out e-receipts as pdf attachements.  When the email arrives on any apple product, i see the email with the paperclip icon showing that there is an attachment but i cannot ever see or find the actual attachment.  Any ideas?

    i have scrolled left, right, up and down on iphone4, iphone5 and ipad and the attachment simply does not exist.  It has to be something with the apple mail client setup because for any mail client, if they go to the webemail thru safari, the attachment is there and it can be viewed without issue.
    I know there are plenty of people out there with this issue with the mail clients set up that you access thru the email icon on the iphone and ipad but i cannot find anyone with a resolution.  I cannot find any settings in the mail client setup that has anything to do with attachments or for what attachments can or cannot be read or seen.
    Hopefully someone out there has figured something out because this is an odd one.

  • Sending a binary attachment via email, looking for a more clean way

    Hi experts.
    I finally managed to send a binary attachment via email. Why "finally"? Never done before!
    Also I got to manage the "not standard" .SAP file extension, because the attachment is a transaction link.
    So let me explain how i did it:
    take SO_NEW_DOCUMENT_ATT_SEND_API1, filling following input data:
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = st_docdata
          commit_work                = 'X'
        TABLES
          packing_list               = lt_packlist
          contents_hex               = lt_hex
          contents_txt               = lt_content
          receivers                  = lt_recv
        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.
    But how to fill lt_hex? Well I did not found a way to transfer text data into raw data structure (lt_hex is type SOLIX).
    So, here is the trick:
    fill another table, lt_bin type SOLISTI1, with attachment content (text data);
    dump lt_bin content to a file on application server, having care to specify TEXT MODE and UTF-8 encoding;
    now reopen the same file in BINARY MODE and transfer content to lt_hex.
    Why I did not use parameter
    content_bin
    ? Because SAP ECC 6 is unicode enabled (I think UTF-16) and file has got to be UTF-8 or ASCII. Also, packing_list for attachment must specify binary tranfer mode. And doing so each UTF-16 character (2 bytes) is split into 2 characters (1 char + 1 NUL byte). Attachment is now unusable.
    What is the question? Here it is: how to fill lt_hex data directly from text (UTF-16) data, avoiding conversion errors?
    Thank you in advance.

    Hi Chhayank,
    the problem is not the exported xls. If you have a look inside with Notepad or something like that, you will see that your leading zeros are exported correct.Excel-settings occurs this problem, it is all about how to open the document. If you use the import-assistant you will have no problems because there are options available how to handle the different columns.
    Another solution might be to get familiar with ABAP2XLS-Project. I got in my mind, that there is a method implemented, that will help you solving this problem. But that is not a five minute job
    ~Florian

  • Facing problem with the code for sending an .xls attachment via email, a field value contains leading zeros but excel automatically removes these from display i.e. (00444 with be displayed as 444).kindly guide .

    Facing problem with the code for sending an .xls attachment via email, a field value contains leading zeros but excel automatically removes these from display i.e. (00444 with be displayed as 444).kindly guide .

    Hi Chhayank,
    the problem is not the exported xls. If you have a look inside with Notepad or something like that, you will see that your leading zeros are exported correct.Excel-settings occurs this problem, it is all about how to open the document. If you use the import-assistant you will have no problems because there are options available how to handle the different columns.
    Another solution might be to get familiar with ABAP2XLS-Project. I got in my mind, that there is a method implemented, that will help you solving this problem. But that is not a five minute job
    ~Florian

  • Sending PDF attachement via OUTLOOK

    Hello All,
    I am sending the output of a sales order as a PDF attachment via outlook mail.
    It wokrs fine. but only worry is the Chinese characters are appearing strange and not the characters what we need. The function module used to convert OTF to PDF is CONVERT_OTF.
    If I print / preview the output in SAP it shows the Chinese characters correctly.
    What can be the reason ? Please help.
    Thanks.

    pdf download software correctly multi language supports

  • PDF attachment via File adapter

    Dear Friends,
    I have a scenario like as follows :
         *SAP ECC -
    > PI -
    > SQL Database(external system )*
         *External system  -
    >  PI  -- (pdf attachment)----
    > Customers*    
    SAP sending the material number to SQL database via PI.
    In turn SQL database  will  take the corresponding material number and perform certain internal processing logic. Finally it will generate a pdf file.It will place the PDF file in a folder in that system
    Now PI need to fetch  that pdf file from thefolder and send the pdf attachment to external customers via email.
    How can we fufill this requirement?
    Please give your guidance friends.

    Subasree wrote:
    Dear Friends,
    >
    >  I have a scenario like as follows :
    >
    >      SAP ECC -> PI -> SQL Database(external system )
    this will be a normal IDoc/RFC/Proxy to JDBC scenario
    >                                               
    >      *External system  -
    >  PI  -- (pdf attachment)----
    > Customers*    
    >
    >    
    > SAP sending the material number to SQL database via PI.
    >
    > In turn SQL database  will  take the corresponding material number and perform certain internal processing logic. Finally it will generate a pdf file.It will place the PDF file in a folder in that system
    >
    > Now PI need to fetch  that pdf file from thefolder and send the pdf attachment to external customers via email.
    >
    > How can we fufill this requirement?
    >
    > Please give your guidance friends.
    In this case it will be a file to mail scenario.
    In case you want to attach the pdf file in the mail, then use the payloadswapbean and help you develop this
    refer: http://www.sdn.sap.com/irj/scn/advancedsearch?query=mailadapterattachment#sdn_content_category_value_blogs

  • Error during sending a PDF attachment of a mail

    Hi everebody,
                      I'm using a custom program [ see below ] ( in which there is the call to the std function SO_DOCUMENT_SEND_API1) to send a PDF attachment to an user's SAPOFFICE: in release 4.6C it works correctly but the same programm in ECC6 it doesn't work correctly.  I mean: the mail is sent correctly with the attachment, but when I try to open the attachment this one doesn't open correctly showing a PDF error message.
    Any help?
                gino bonfiglioli
    *& Report  Z_UT_CONVERT_SPOOL_PDF
    REPORT  z_ut_convert_spool_pdf.
    TABLES: tsp01.
    variabili globali
    *data: fm_name            type rs38l_fnam,
         output_options     type ssfcompop,
         control_parameters type ssfctrlop,
         job_output_info    type ssfcrescl,
         job_output_options type ssfcresop,
    DATA: spoolno            LIKE tsp01-rqident,
          dir_pdf            LIKE rlgrap-filename,
          numbytes           TYPE i,
          pagecount          TYPE i,
          w_cnt              TYPE i,
          wk_subrc           LIKE sy-subrc,
          pdfspoolid         LIKE tsp01-rqident,
          gd_buffer          TYPE string,
          pdf                LIKE tline OCCURS 100 WITH HEADER LINE,
          stampante          LIKE usr01-spld,
          tot_line   TYPE sy-tabix,
          tot_line2  TYPE sy-tabix,
          start_line TYPE sy-tabix.
    tabelle interne per 1a mail
    DATA: BEGIN OF it_email OCCURS 100.
            INCLUDE STRUCTURE solisti1.
    DATA: END OF it_email.
    DATA: BEGIN OF email_data.
            INCLUDE STRUCTURE sodocchgi1.
    DATA: END OF email_data.
    DATA: BEGIN OF email_send OCCURS 10.
            INCLUDE STRUCTURE somlreci1.
    DATA: END OF email_send.
    DATA: packing_list TYPE STANDARD TABLE OF sopcklsti1 WITH HEADER LINE,
          it_mess_att  LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          receivers    TYPE STANDARD TABLE OF somlreci1 WITH HEADER LINE.
    fine tabelle interne per 1a mail
    PARAMETER: p_spool LIKE tsp01-rqident.
    START-OF-SELECTION.
      PERFORM conversione_spool_pdf USING wk_subrc.
      IF wk_subrc EQ 0.
        PERFORM invio_mail.
      ENDIF.
    *&      Form  CONVERSIONE_SPOOL_PDF
          text
         -->P_P_SUBRC  text
    FORM conversione_spool_pdf  USING    p_subrc.
    **- Conversione in PDF
      CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
          EXPORTING
            src_spoolid                    = p_spool
            no_dialog                      = ' '
          DST_DEVICE                     =
          PDF_DESTINATION                =
          IMPORTING
            pdf_bytecount                  = numbytes
            pdf_spoolid                    = pdfspoolid
            otf_pagecount                  = pagecount
           btc_jobname                    = jobname
           btc_jobcount                   = jobcount
          TABLES
            pdf                            = pdf
          EXCEPTIONS
            err_no_otf_spooljob            = 1
            err_no_spooljob                = 2
            err_no_permission              = 3
            err_conv_not_possible          = 4
            err_bad_dstdevice              = 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.
      p_subrc = sy-subrc.
    ENDFORM.                    " CONVERSIONE_SPOOL_PDF
    *&      Form  invio_mail
          text
    -->  p1        text
    <--  p2        text
    FORM invio_mail .
    Transfer the 132-long strings to 255-long strings
      LOOP AT pdf.
        TRANSLATE pdf USING ' ~'.
        CONCATENATE gd_buffer pdf INTO gd_buffer.
      ENDLOOP.
      TRANSLATE gd_buffer USING '~ '.
      DO.
        it_mess_att = gd_buffer.
        APPEND it_mess_att.
        SHIFT gd_buffer LEFT BY 255 PLACES.
        IF gd_buffer IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
    Testo della mail
      CLEAR it_email. REFRESH it_email.
      it_email-line = 'Testo della mail'.
      APPEND it_email.
    Creazione messaggio
      email_data-obj_name      = 'MESSAGE'.
      email_data-obj_descr     = 'Conversione spool n.'.
      email_data-obj_descr+26  = p_spool.
      email_data-obj_langu     = 'I'.
      email_data-sensitivty    = 'F'.
      READ TABLE it_mess_att INDEX w_cnt.
      email_data-doc_size =
         ( w_cnt - 1 ) * 255 + STRLEN( it_mess_att ).
      start_line = 1.
      DESCRIBE TABLE it_email LINES tot_line.
      packing_list-transf_bin = ' '.
      packing_list-doc_type   = 'RAW'.
      packing_list-head_start = 1.
      packing_list-head_num   = 0.
      packing_list-body_start = 1.
      packing_list-body_num   = tot_line.
      packing_list-obj_langu  = sy-langu.
      APPEND packing_list.
      APPEND LINES OF it_mess_att TO it_email.
      CLEAR packing_list.
    Riga iniziale = ultima riga messaggio precedente + 1
      start_line = tot_line + 1.
      DESCRIBE TABLE it_mess_att LINES tot_line.
      packing_list-transf_bin = 'X'.
      packing_list-head_start = 1.
      packing_list-head_num   = 1.
      packing_list-body_start = 1.
      DESCRIBE TABLE it_mess_att LINES packing_list-body_num.
      packing_list-doc_type   = 'PDF'.
      packing_list-obj_descr  = 'Allegato PDF.'.
      packing_list-doc_size   =  packing_list-body_num * 255.
      packing_list-obj_langu  = sy-langu.
      APPEND packing_list.
    destinatario interno a SAP
      receivers-receiver = sy-uname.
      receivers-rec_type = 'B'.
      receivers-express = 'X'.
      APPEND receivers.
    destinatario esterno a SAP: deve essere un idirizzo email:
    receivers-receiver = '[email protected]'.
    receivers-rec_type = 'U'.
    APPEND receivers.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
      EXPORTING
        document_data                    = email_data
        put_in_outbox                    = 'X'
       SENDER_ADDRESS                   = SY-UNAME
        sender_address_type              = 'B'
       COMMIT_WORK                      = 'X'
    IMPORTING
      SENT_TO_ALL                      =
      NEW_OBJECT_ID                    =
      SENDER_ID                        =
      TABLES
        packing_list                   = packing_list
        contents_bin                   = it_mess_att
        contents_txt                   = it_email
        receivers                      = 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.
      IF sy-subrc <> 0.
    errore invio mail
      ENDIF.

    Hi,
    Try to use fm 'SO_NEW_DOCUMENT_ATT_SEND_API1' instead of SO_DOCUMENT_SEND_API1.
    Please check documentation of fm SO_DOCUMENT_SEND_API1 in ECC 6.

  • Invoice output as PDF attachment via email.

    Hi All,
    I have a requirement wherein an invoice when saved should generate a mail output (external send) with the invoice as a PDF attachment. I have the system set up for external send & scot settings but am stuck up with the PDF attachment. I also have the same requirement for PO output (because I look into both SD and MM). Any help on either of them would be greatly appreciated.
    Thanks & Regards,
    Vidya Sagar

    Hi,
    [External Send - Sending PO by email|http://www.sap-img.com/materials/external-send-sending-po-by-email.htm]:
    In order to send PO, your Basis team must configure the system first so that external email can be send out from SAP.  If it is not configured, no settings you do on MM will work.
    1. You must maintain email address in vendor master data.
    2. The same applies to your user master data.  For the output type for default values, a communication strategy needs 
    to be maintained in the Customizing that supports the e-mail. You can find the definition of the communication strategy in the 
    Customizing via the following path: 
    (SPRO -> IMG -> SAP Web Application Server -> Basic Services -> Message Control -> Define Communication Strategy). 
    As a default, communication strategy CS01 is delivered. This already contains the necessary entry for the external communication. Bear in mind that without a suitable communication strategy it is not possible to communicate with a partner via Medium 5 (external sending).
    3. Use the standard SAP environment (program 'SAPFM06P', FORM routine 'ENTRY_NEU' and form 'MEDRUCK') as the processing routines.
    4. In the condition records for the output type (for example, Transaction MN04), use medium '5' (External send).
    5. You can use Transaction SCOT to trigger the output manually. The prerequisite for a correct sending is that the node is set correctly. This is not described here, but it must have already been carried out.
    6. To be able to display, for example, the e-mail in Outlook, enter PDF as the format in the node.
    Regards,
    Srilatha.

  • How do I send entire pdf form via email from web browser

    How do you send a pdf completed form on your web browser via email to email address?

    Hello Wayne, see no offense in this message
    There is a faster scheme.
    Copy the range of cells to send (it may be an entire table)
    Enter the application entitled Preview.
    File > Create a new doc from the clipboard
    File > Send the selected PDF document (I'm not sure of the exact wording).
    It's the highlighted one.
    Bingo, it will create a mail with the PDF embedded.
    Yvan KOENIG (VALLAURIS, France) jeudi 3 novembre 2011 22:32:21
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • I am unable to send a PDF attachment using mac mail so that it appears in the body of the email when arrives in the recipient's inbox.

    I attach the pdf file as a view in place instead of view as icon, but it arrives in the recipient's inbox as a pdf icon attachment.  I have heard that there are programs that can make the attachment be viewed in the body of the email, but i have been unable to find them.  Does anyone have any suggestions??  I have called apple care, and been to the genius bar, but nothing.  it seems that if the email is sent from mac mail to mac mail it works, but to any other mail program they only receive the icons.

    new account are created without a password, so asking for it is normal.
    see http://thunderbirdtweaks.blogspot.com.au/2011/07/pssswords.html
    Compare the passwords Thunderbird has for the other accounts and see if using the same one is what you need to do.

  • Error opening PDF attachment (via email)

    Hello,
    I've problems to send a PDF file with the function:
    'SO_DOCUMENT_SEND_API1'
    At first a small overview of my process:
    - 'SCMS_DOC_READ'                 -> to read the file from the archive
    - 'SCMS_BINARY_TO_FTEXT'     -> to convert from bin. to pdf
    - 'SO_DOCUMENT_SEND_API1'  -> to send the email
    My pdf result:
    % P D F - 1 . 4  % â ã Ï Ó  1   0   o b j  < <  / T y p e
    Project scope:
    %PDF-1.4%âãÏÓ1 0 obj<</Type
    As a result, by opening the PDF file an error occured.
    Further information:
    objpack-transf_bin = 'X'.
      call function 'SO_DOCUMENT_SEND_API1'
        exporting
          document_data              = doc_data
          put_in_outbox              = ''
          commit_work                = 'X'
        tables
          packing_list               = objpack
          object_header              = objhead
          contents_bin               = data          <-  PDF content
          contents_txt               = objtxt
          receivers                  = reclist
        exceptions

    most possible reason has been discussed in:
    Error in opening PDF attachment

  • HTML file send as an attachment via an email adapter

    Hi,
    I need to implement an scenario File -> XI -> Email (html attachment) . To send html as attachment , do i need to go for XSLT mapping ? ...please share your ideas if any ..
    Regards
    Vinay P.

    Hi Vinay,
    Have you seen this blog?
    http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=%28J2EE3414900%29ID1832422350DB01827388014243714513End?blog=/pub/wlg/6321
    Regards
    Suraj

  • Sending a PDF form without a desktop email application

    I developed a PDF form using Livecycle and now discoved that the computers that users have do not have an email client installed. instead, they use OWA. So my Save and Send Email button will save the PDF but not email it. Is there a way to send the PDF (I've read something about http or server-side scripts) that will be automatic so that the user doesn't manually have to attach the saved file to an OWA email and type in an email address? We've used pdformail.asp in the past, but, for some reason, it's not working for me now.I get a message saying that the page can't be displayed. The code for this action page is copied below.
    <%
    Dim strMasterPath
    Dim PDForm
    ' Acquire the server default path
    strMasterPath = Server.MapPath(Request.ServerVariables("PATH_INFO"))
    strMasterPath = Left(strMasterPath,InstrRev(strMasterPath,"\"))
    ' Initiate the formium object and call the Render function
    Set PDForm = Server.CreateObject("formium.core")
    Call PDForm.render_PDForMail(0)
    ' Close out the object       
    Set renderPDF = Nothing
    %>

    Here's the javascript on the Submit button, and I'd like a script that would grab user-entered values in the PDF form in the same way. Is this possible?
    form1.page3.emailSubform.emailToBtn::preSubmit:form - (JavaScript, client)
    app.execMenuItem("SaveAs");
    //either way below works
    //event.target.submitForm({cURL:"mailto:"+ strToAddress + "?cc=" + strCCAddress + "&subject=" + strSubject + "&body=" + strMessage,cSubmitAs:"PDF",cCharset:"utf-8"});
    if (txtCCAddress.rawValue == null) {
    var strToAddress, strSubject, strMessage, strSuffix, strMgrFirstName, strMgrLastName, strStoreNum, strRegionNum
    strToAddress = txtToAddress.rawValue;
    strSuffix = form1.Page1.DropDownList1.rawValue;
    strMgrFirstName = form1.page3.MgrFirstName.rawValue;
    strMgrLastName = form1.page3.MgrLastName.rawValue;
    strStoreNum = form1.Page1.storeNumber.rawValue;
    strRegionNum = form1.page3.distRegion.rawValue;
    this.resolveNode("#event").submit.target = "mailto:" + strToAddress + "?subject= " + "LOA request for " + strSuffix + " DSM " + strMgrFirstName + " " + strMgrLastName + " Store# " + strStoreNum + " Region# " + strRegionNum;
        else
        var strToAddress, strCCAddress, strSubject, strMessage, strSuffix, strMgrFirstName, strMgrLastName, strStoreNum, strRegionNum
    strToAddress = txtToAddress.rawValue;
    strCCAddress = txtCCAddress.rawValue;
    strSuffix = form1.Page1.DropDownList1.rawValue;
    strMgrFirstName = form1.page3.MgrFirstName.rawValue;
    strMgrLastName = form1.page3.MgrLastName.rawValue;
    strStoreNum = form1.Page1.storeNumber.rawValue;
    strRegionNum = form1.page3.distRegion.rawValue;
        this.resolveNode("#event").submit.target = "mailto:"+ strToAddress + "?cc=" + strCCAddress + "&subject=" + "LOA request for "  + strSuffix + " DSM " + strMgrFirstName + " " + strMgrLastName + " Store# " + strStoreNum + " Region# " + strRegionNum;

  • Send a pdf from spooler to an email address

    Hi all,
    as the subject says i am trying to send a pdf that exists in the spooler at an email address. Is there an FM that reads the pdf ?
    As far as i can see all the procedures convert OTF to PDF, but i already have a pdf.
    Any proposal is welcome, thank you in advance.
    Regards,
    Alex.

    Hi you can do like this
    data decleration for mail and pdf.
    DATA : gt_listobject LIKE abaplist OCCURS 10 .
    DATA : gt_objcont LIKE soli OCCURS 10 WITH HEADER LINE.
    DATA : gt_objhead LIKE soli OCCURS 10 WITH HEADER LINE.
    DATA : gt_att_head LIKE soli OCCURS 10 WITH HEADER LINE.
    DATA : gt_receivers LIKE soos1 OCCURS 10 WITH HEADER LINE.
    DATA : gt_packing_list LIKE soxpl OCCURS 10 WITH HEADER LINE.
    DATA : gt_so_ali LIKE soli OCCURS 100 WITH HEADER LINE.
    DATA : gt_so_ali1 LIKE soli OCCURS 100 WITH HEADER LINE.
    DATA : gt_document_data LIKE sood1.
    DATA: lineno TYPE i , length TYPE i , size TYPE i.
    DATA: gt_scheme LIKE ztrc_scheme OCCURS 0 WITH HEADER LINE.
    DATA: gd_recsize TYPE i.
    Spool IDs
    TYPES: BEGIN OF t_tbtcp.
    INCLUDE STRUCTURE tbtcp.
    TYPES: END OF t_tbtcp.
    DATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
    wa_tbtcp TYPE t_tbtcp.
    Job Runtime Parameters
    DATA: gd_eventid LIKE tbtcm-eventid,
    gd_eventparm LIKE tbtcm-eventparm,
    gd_external_program_active LIKE tbtcm-xpgactive,
    gd_jobcount LIKE tbtcm-jobcount,
    gd_jobname LIKE tbtcm-jobname,
    gd_stepcount LIKE tbtcm-stepcount,
    gd_error TYPE sy-subrc,
    gd_reciever TYPE sy-subrc.
    DATA: w_recsize TYPE i.
    DATA: gd_subject LIKE sodocchgi1-obj_descr,
    it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    gd_sender_type LIKE soextreci1-adr_typ,
    gd_attachment_desc TYPE so_obj_nam,
    gd_attachment_name TYPE so_obj_des.
    Spool to PDF conversions
    DATA: gd_spool_nr LIKE tsp01-rqident,
    gd_destination LIKE rlgrap-filename,
    gd_bytecount LIKE tst01-dsize,
    gd_buffer TYPE string.
    Binary store for PDF
    DATA: BEGIN OF it_pdf_output OCCURS 0.
    INCLUDE STRUCTURE tline.
    DATA: END OF it_pdf_output.
    CONSTANTS: c_dev LIKE sy-sysid VALUE 'DEV',
    c_no(1) TYPE c VALUE ' ',
    c_device(4) TYPE c VALUE 'LOCL'.
    DATA: check TYPE c.
    DATA: spid LIKE tsp01-rqident.
    converting spool to pdf..
    spid = syst-spono . " give your spool number here
    CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
    EXPORTING
    src_spoolid = spid
    TABLES
    pdf = it_pdf_output.
    CHECK sy-subrc = 0.
    Transfer the 132-long strings to 255-long strings
    LOOP AT it_pdf_output.
    TRANSLATE it_pdf_output USING ' ~'.
    CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
    ENDLOOP.
    TRANSLATE gd_buffer USING '~ '.
    DO.
    it_mess_att = gd_buffer.
    APPEND it_mess_att.
    SHIFT gd_buffer LEFT BY 255 PLACES.
    IF gd_buffer IS INITIAL.
    EXIT.
    ENDIF.
    ENDDO.
    sending mail
    DATA: p_email LIKE somlreci1-receiver,
    p_sender LIKE somlreci1-receiver,
    sub(40).
    DESCRIBE TABLE it_mess_att LINES gd_recsize.
    CHECK gd_recsize > 0.
    REFRESH it_mess_bod.
    Default subject matter
    gd_subject = 'Subject'.
    gd_attachment_desc = text-002.
    it_mess_bod = text-001.
    APPEND it_mess_bod.
    IF p_sender EQ space.
    gd_sender_type = space.
    ELSE.
    gd_sender_type = 'INT'.
    ENDIF.
    *concatenate sy-datum into sub separated by space.
    MOVE 'Orders Released on' TO sub.
    WRITE: sy-datum DD/MM/YYYY TO sub+27(10).
    Send file by email as .xls speadsheet
    PERFORM send_file_as_email_attachment
    TABLES it_mess_bod
    it_mess_att
    USING
    p_email
    sub "text-003
    'PDF'
    gd_attachment_name
    gd_attachment_desc
    p_sender
    gd_sender_type
    CHANGING gd_error
    gd_reciever.
    ENDFORM. " process_email
    *& Form send_file_as_email_attachment
    text
    -->P_IT_MESS_BOD text
    -->P_IT_MESS_ATT text
    -->P_TEXT_009 text
    -->P_1058 text
    -->P_GD_ATTACHMENT_NAME text
    -->P_GD_ATTACHMENT_DESC text
    <--P_GD_ERROR text
    <--P_GD_RECIEVER text
    FORM send_file_as_email_attachment TABLES it_message
    it_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.
    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.
    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-rec_type = 'U'.
    t_receivers-com_type = 'INT'.
    t_receivers-notif_del = 'X'.
    t_receivers-notif_ndel = 'X'.
    t_receivers-receiver = '[email protected]'.
    APPEND t_receivers.
    function module to send mail with pdf attachment
    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.
    this will work...for further calrification reply

Maybe you are looking for

  • Office 365 Sandbox Solution EventReceiver throwing Remote Exception in ItemAdding

    Hi, I created a sandbox webpart for O365 with EventReceivers with ItemAdding for Document Library and while i upload a document to library in O365  sharepoint site application throws below exception:- System.Runtime.Remoting.RemotingException: Server

  • "writing lead-in" problem

    hello we are experiencing an very frustrating problem. we are burning a Dual Layer disk with a one hour video, and a slide show. We have followed all of the pointers listed here about compatible file types and audio files. When we go to burn the disk

  • Why do G3 raw files show as "Unsupported Image Format" in Aperture?

    I am moving towards shooting in raw, and as an experiment I imported some sample raw files from the publicly available text images on the Photography Blog. When I try to look at these images, I get a black screen with a warning triangle and the messa

  • Copy materail master only on selected fields

    Hi guru, I am exploring the possibility on copying exisitng materail master ( when createing a new matearil master ), only copy certain fields as deseired. Does anyone know if it's possible and where to do the config. Thanks

  • How do i know where tracfic is on maps?

    I travel a lot and have been using the map feature on the phone a LOT and was wondering how to tell where traffic is on the road.i think the little car at the bottom of the screen is for this feature but i dont know what to do next! Also, is there a