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.

Similar Messages

  • How do I scan a photo to a file and then send the file as an attachment via email.

    How do I scan a photo to a file and then send the file as an attachment  via email.

    All of this depends largely on what printer /software you have, which Email client you use and to some extent which OS you are running.
    Most HP printers have HP Solution Center which is used to set up scanning,choosing where to save,etc. Once a file/photo is scanned and saved to the folder, open the folder.Select the file and at the top of the window should be the option to 'Email'.
    ******Clicking the Thumbs-Up button is a way to say -Thanks!.******
    **Click Accept as Solution on a Reply that solves your issue to help others**

  • Is there a way to send output from a Concurrent Request via email in r12?

    We are looking for a way to send emails out from the Concurrent Request output in r12.
    Discussions internally have involved using Unix procedures/commands but we were looking for an EBS integrated solution if one is available.
    I did find document 811716.1which seems to provide a solution, but the patches and information given are for 11i (we are r12). If this functionality is available in r12, is there any further documentation we can use?
    Any assistance would be appreciated.
    Thanks.
    Kevin
    Edited by: user3065048 on Jul 21, 2009 2:52 PM

    Duplicate post.
    Is there a way to send output from a Concurrent Request via email in r12?
    Re: Is there a way to send output from a Concurrent Request via email in r12?

  • 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 to send an ouput as PDF attachment to email

    Hi,
    We have a 'Z' output for a delivery document. The output has the standard RLE_DELNOTE driver program and a Zsmart form assigned to it. We need to send the output as an attachment to email. Can some one please adivice how this can be achieved?
    Thanks in advance
    Kat

    Hi,
    Plz try following steps.
    1. Note the spool request No.
    2. In T/code SE38, Enter The programme and execute.
    3. In sub Object- Click Documentation and then do debuggung.
    4.Enter spool request no and desired location and execute.
    5. In ABAP Debugger- Use F8 key.
    6. Select the desired location and file name and save.
    View the desired output in PDF and can be sent through mail.
    Hope this helps.
    Regards,
    Jaiprakash.P.T

  • 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

  • Sending smartform as PDF attachment through email

    Hi,
    I have used the FM SO_NEW_DOCUMENT_ATT_SEND_API1 to send the smartform as PDF attachment through email.In SOST transaction I can see that the mail has been sent to the reciepient,but the mail is not going to the mail box.What would be the reason for this?
    Regards,
    Hema

    That should be the basis issue. They needs to do some settings. Please ask them to do so.
    Pranav

  • 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

  • Error opening PDF file when send as attachment via email

    Hi,
    I searched around the forum to resolve my issue and there's alot of post that is related but i can't find any answer to my issues.
    Here's the scenario :-
    I try to convert the smartform to PDF and then send the PDF as an attachment via email.
    After converting the smartform to PDF, i managed to download the file and view it without any problem but i can't view the PDF as an attachment. It has the following error :-
    Adobe Reader could not open '4500002325.PDF' because it is either not a supported fle type or because the file has been damaged (for example, it was sent as an email and wasn't correctly decoded
    The following is the snapshot of my code:-
    * Determine smartform function module for invoice
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = lf_formname
        IMPORTING
          fm_name            = lf_fm_name
        EXCEPTIONS
          no_form            = 1
          no_function_module = 2
          OTHERS             = 3.
      IF sy-subrc <> 0.
    *  error handling
        ent_retco = sy-subrc.
        PERFORM protocol_update_i.
      ENDIF.
      ls_control_param-getotf = 'X'.
      CALL FUNCTION lf_fm_name
        EXPORTING
          archive_index        = toa_dara
          archive_parameters   = arc_params
          control_parameters   = ls_control_param
          mail_recipient       = ls_recipient
          mail_sender          = ls_sender
          output_options       = ls_composer_param
          zxekko               = l_doc-xekko  " user_settings = ' '
          zxpekko              = l_doc-xpekko
        IMPORTING
          document_output_info = l_ssfcrespd
          job_output_info      = l_ssfcrescl
          job_output_options   = l_ssfcresop
        TABLES
          l_xekpo              = l_doc-xekpo[]
          l_xekpa              = l_doc-xekpa[]
          l_xpekpo             = l_doc-xpekpo[]
          l_xeket               = l_doc-xeket[]
          l_xtkomv             = l_doc-xtkomv[]
          l_xekkn              = l_doc-xekkn[]
          l_xekek              = l_doc-xekek[]
          l_xkomk              = l_xkomk
        EXCEPTIONS
          formatting_error     = 1
          internal_error       = 2
          send_error           = 3
          user_canceled        = 4
          OTHERS               = 5.
      IF sy-subrc = 0.
        CALL FUNCTION 'CONVERT_OTF'
          EXPORTING
            FORMAT                = 'PDF'
          IMPORTING
            BIN_FILESIZE          = v_len_in
            BIN_FILE              = v_bin_file
          TABLES
            OTF                   = l_ssfcrescl-otfdata
            LINES                 = l_pdf
          EXCEPTIONS
            ERR_MAX_LINEWIDTH     = 1
            ERR_FORMAT            = 2
            ERR_CONV_NOT_POSSIBLE = 3
            ERR_BAD_OTF           = 4
            OTHERS                = 5.
    * email subject
        CONCATENATE 'Purchase order' l_doc-xekko-ebeln INTO lw_subject
                    SEPARATED BY space.
    * RECIPIENTS
        lwa_recipients-rec_type = 'U'.
        lwa_recipients-express = 'X'.
        SELECT adr6~smtp_addr
        INTO TABLE gv_smtp_addr
        FROM ekko AS ekko INNER JOIN
             lfa1 AS lfa1 ON ekko~lifnr      = lfa1~lifnr INNER JOIN
             adr6 AS adr6 ON adr6~addrnumber = lfa1~adrnr
        WHERE ekko~ebeln = l_doc-xekko-ebeln.
        IF NOT gv_smtp_addr[] IS INITIAL.
          LOOP AT gv_smtp_addr INTO gv_smtp_addr_line FROM 2.
            lwa_recipients-receiver = gv_smtp_addr_line.
            lwa_recipients-copy = ''.
            APPEND lwa_recipients TO ptb_recipients.
          ENDLOOP.
    * Text Data
            CALL FUNCTION 'READ_TEXT'
              EXPORTING
                id                      = 'ST'
                language                = 'E'
                name                    = 'TEST'
                object                  = 'TEXT'
              TABLES
                lines                   = lv_lines
              EXCEPTIONS
                id                      = 1
                language                = 2
                name                    = 3
                not_found               = 4
                object                  = 5
                reference_check         = 6
                wrong_access_to_archive = 7
                OTHERS                  = 8.
          LOOP AT lv_lines INTO lv_lines_line.
            ltb_objtxt = lv_lines_line-tdline.
            APPEND ltb_objtxt.
          ENDLOOP.
          DESCRIBE TABLE ltb_objtxt LINES lw_tab_lines.
          READ TABLE ltb_objtxt INDEX lw_tab_lines.
    * document data contains information for the whole message
          lwa_doc_chng-obj_descr = 'ABAPlist'.
    * Control Data
          lwa_doc_chng-obj_name   = 'TESTING'.
          lwa_doc_chng-sensitivty = 'F'.
          lwa_doc_chng-no_change  = 'X'.
          lwa_doc_chng-priority   = '1'.
          lwa_doc_chng-obj_prio   = '1'.
          lwa_doc_chng-obj_langu  = sy-langu.
          CLEAR ltb_objpack-transf_bin.
    *Attachment
    *Move the binary attachment to other internal table.
          ltb_objpack-head_start = 1.
          ltb_objpack-head_num   = 0.
          ltb_objpack-body_start = 1.
          ltb_objpack-body_num   = lw_tab_lines.
          ltb_objpack-doc_type   = 'RAW'.
          APPEND ltb_objpack.
          clear : lw_tab_lines.
    *Get the number of lines in the Attachment (PDF FILE)
    *      DESCRIBE TABLE it_mess_att LINES lw_tab_lines.
          DESCRIBE TABLE l_objbin lines lw_tab_lines.
          ltb_objpack-transf_bin = 'X'.
          ltb_objpack-head_start = 1.
          ltb_objpack-head_num   = 1.
          ltb_objpack-body_start = 1.
          ltb_objpack-body_num = lw_tab_lines.
          ltb_objpack-doc_type = 'PDF'.
          ltb_objpack-obj_descr = l_doc-xekko-ebeln.
          ltb_objpack-doc_size = lw_tab_lines * 255.
          APPEND ltb_objpack.
    *Email Subject
          lwa_doc_chng-obj_descr = lw_subject.
            lwa_recipients-receiver = recipeint.
            lwa_recipients-rec_type = 'U'.
            lwa_recipients-copy     = 'X'.
            lwa_recipients-express  = 'X'.
            APPEND lwa_recipients TO ptb_recipients.
          CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
            EXPORTING
              document_data = lwa_doc_chng
              COMMIT_WORK   = 'X'
            TABLES
              packing_list  = ltb_objpack
              contents_bin  = l_objbin
              contents_txt  = ltb_objtxt
              receivers     = ptb_recipients.
          IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
        ENDIF.
      ENDIF.
    Edited by: ~loObie on Apr 23, 2010 12:01 PM
    Edited by: ~loObie on Apr 23, 2010 12:02 PM

    Did you send the pdf in the following format ...
    2. Sending PDF as mail.
    CLEAR t_receivers.
    REFRESH t_receivers.
    t_receivers-receiver = sy-uname.
    t_receivers-rec_type = 'B'.
    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.
    Quote from the Following [LINK|http://www.sap-basis-abap.com/smartforms/convert-the-smart-form-into-pdf-and-send.htm]

  • Sending SAP Script output as a PDF attachment through mail

    Dear Guru,
    I am using SAP 4.0B version, DATABASE Oracle 8i, OS is sun solaris 7.5.
    I want to send SAP script output as a
    PDF attachement through mail.Please suggest a solution.
    Regards,
    Rajesh

    Hi Rajesh,
    In your print program, while calling OPEN_FORM, pass options-TDGETOTF = 'X'. This is used for returning print output in OTF format.
    Then in CLOSE_FORM, get the table OTFDATA returned from the function module. for example
    DATA: OTF_DATA LIKE ITCOO OCCURS 0 WITH HEADER LINE.
        CALL FUNCTION 'CLOSE_FORM'
          IMPORTING
            RESULT  = RESULT
          TABLES
            OTFDATA = OTF_DATA.
    now you can convert this OTF data to PDF using function module CONVERT_OTF
    Then send this data as attachment to a mail using function module SO_NEW_DOCUMENT_ATT_SEND_API1
    Regards,
    Komal.

  • Send spool list ceated by Job (SM36) as pdf-file via email

    We are running the report RM06EFLB (Transaktion ME84 - "Create Releases") in the background.
    The Job is creating a spool list with 17 pages.
    I want to send this 17 pages (in a readable form) to a number of persons.
    This did I try so far:
    - Distribution list with Recipient type "via Internet" as Spool list recipients in the Job. (Tried different formats for ABAP List in Transaction SCOT)
    => Email is send to recipients, attachment is readable depending on format.
         Problem: attachment is not complete, it contains only about 15 pages (985 rows).
    - Distribution list with Recipient type "Internal User - SAP-Office" as Spool list recipients in the Job.
    => Document is sent to Business Workplace
         Problem:  attachment is not complete, it contains only about 15 pages
    Any ideas how to get the complete spool list?
    Is there mayby a report around  that is sending a spool list as pdf-file via email to a number of recipients?
    (Would like to maintain this Report as an additional step in the job. The spool-number should be selected from the previous step.)
    Thank you for your help.
    Jens

    Oh sorry - here is the coding which is used in that program:
    First use function module  'CONVERT_ABAPSPOOLJOB_2_PDF' to convert the spool entry into pdf.
    Loop at output table PDF and concatenate all lines into a string. Convert string to xstring.
    Then call mail class:
    DATA: lv_pdf_x TYPE xstring,
            lv_subject TYPE string,
            lv_doc_desc TYPE so_obj_des,
            lv_mail_body TYPE soli_tab.
      DATA: ls_atta TYPE rcf_s_att4mail_hex,
            lt_atta TYPE rcf_t_att4mail_hex.
    * -- Fill parameter
      lv_subject = 'Requested Report'."#EC NOTEXT
      lv_doc_desc = 'Report XXL'."#EC NOTEXT
    *  lv_mail_body = ?
      ls_atta-name = lv_doc_desc.
      ls_atta-extension = 'PDF'.
      ls_atta-content = p_pdf_x. <- This is your xstring
      APPEND ls_atta TO lt_atta.
      TRY.
          CALL METHOD cl_hrrcf_services_mail=>send_web_mail
            EXPORTING
              p_subject              = lv_subject
              p_receiver             = p_receiver->email_address
              pt_atta_hex            = lt_atta
              p_sender               = p_sender->email_address
              p_body_c               = lv_mail_body.
        CATCH cx_hrrcf.
      ENDTRY.
    I hope that you have the above mentioned class in your system but it should work with other email functions as well.
    Regards
    Nicola

  • How do you send an attachment via email created on a mac

    how do you send an attachment via email to another recipient who does not have a mac?

    As long as you send it in a recognizable format such as a .jpeg (or .jpg) used for most photos/images or .pdf used for a lot of word processing docs, there is no problem. Also, while in the Mail window, choose "send Windows compatible". It's not who or what you create it on, it is the format you send it in.

  • How to send a mail with PDF attachment

    Hello
    Good Day!
    We have a requirement to send the mail with pdf attachment. Pdf file will be remain same for all mails and it will be placed at server. We are on R12.4 and below is the database information :
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE 11.2.0.3.0 Production
    TNS for Linux: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    Thanks a ton for your anticipated help!
    Thanks
    Gaurav

    The word URGENT is considered as rude in this forum.. Nobody here is getting paid for the ansers they are giving..
    Just have a look at These threads.Those will help you.

  • 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

  • To send the Payload as PDF Attachment in mail in PI 7.1

    Hi All,
    I have to send a file as PDF attachment using a mail adapter. I gave the Content_Type as 'application.pdf'. I am receiving the mail, but I am unable to open the PDF. It says 'Could not open because the type is not supported or unable to decode'. How do I resolve this?
    Thanks,
    Geetha

    Hi,
    You need to perform the conversion usign the PayloadSwapBean in the  Module tab.
    Please refer to the following link
    /people/sravya.talanki2/blog/2006/11/28/e-mail-xml-messages-in-pdf-format-from-sap-xi
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/bf37423cf7ab04e10000000a1550b0/frameset.htm
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/cd/5af7c0c994e24fb0d0088443513de2/content.htm
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/57/0b2c4142aef623e10000000a155106/frameset.htm
    hope this helps,
    Regards,
    Bhanu
    Edited by: nanduri bhanu on May 21, 2009 5:21 AM

Maybe you are looking for

  • Stop rolling the the paper out in dot matrix priner once the print is done

    Hi, I have used the below code to print a document and the printer used is dot matrix But,it rolls out the page once the print is done. I want to control the printer so that it stops rolling out the page once the print is done. Or set the print based

  • Suggestions for new mini

    I'm ready to buy a new mini to replace my current iBook. I'm considering buying a unit with 320g HD and 2g RAM or 250 HD and 4g RAM. I'm looking for enough processing power to do editing of photos using Photoshop Elements. I currently have an externa

  • VIZIO P602UI-B3 - Order Status

    I went to my local best buy store on this past weekend to buy a vizio 60 inch p series TV. The rep at the TV department told me they only had the 65 inch model in stock. Instead of purchasing the model they had in stock, I instead placed an order in

  • Automator workflows in Calender

    I have some Automator workflows which are scheduled to run from events in my calendar. The events are set up to open the workflow file and not do anything else, specifically not displaying any message. They are supposed to run on all my computers, so

  • I want to buy Production Premium CS6, but I already own Flash Professional.  Is there a way I can avoid paying for the same product twice?

    I have a feeling I already know the answer to this question, but I figured it was worth asking anyway. Just under a year ago, I purchased Flash Professional CS6 for school.  Now that I am expanding my practices, I am interested in purchasing the Prod