Sending PDF output attachment in e-mail to external users from BSP

Hi All,
Please gothrough the below requirement details :
Requirement Details:
Need to achieve the functionality of sending a PDF attachment of invoice to an external
e-mail address from the BSP Application.
Implementation Details:
The Print out Output determination is already done in the system. We are using SAP R/3 4.7 (620)
In the Transaction VF03 in the initial screen there is a menubar "Billing document" and underneath that menu there is a menu item called "Issue". If we click the "Issue" menu item all the output that are already proposed will be visible and we can select the printout Output determination and can issue a printout.
I had created a FM to call from BSP and that function module will take the Invoice number as input and will call the "VF03" transaction using BDC and will trigger the Sapscript Printout . I see the the sapscript in the spool after I call the Function module .
But I don't know how I can get the Spool request number for that Function module call from BSP page ????
I got struck in this approach...
If I know the Spool number after calling the function module the it's very easy to call the following FM's for sending a e-mail with the Invoice PDF attachment.
CONVERT_OTFSPOOLJOB_2_PDF
QCE1_CONVERT
SO_NEW_DOCUMENT_ATT_SEND_API1
Please let me know if anyone can help me in this ...
Please reply ASAP.
Thanks,
Greetson

Check out these weblogs.
/people/sap.user72/blog/2004/11/10/bsphowto-generate-pdf-output-from-a-bsp
/people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface
Regards
Raja

Similar Messages

  • Want to send PDF as attachement using Java Mail

    HI,
    I am using Java mail API for sending PDF as attachment. Here is my sample code
    messageBodyPart = new MimeBodyPart();
    messageBodyPart.setDataHandler(new DataHandler("String data for PDF using iText", "text/plain" ));
    I am generating String for PDF file using iTEXT but I am unable to find out mimetype for passing into DataHandler as second paramete.
    Any idea?
    Thanks
    Shailesh

    Don't convert the data to String. It isn't text so
    you'll damage the binary content by doing that. In
    the "demos" directory of your JavaMail download
    you'll find a ByteArrayDataSource class you can use
    instead of a FileDataSource. Yes, this worked for me. I create the pdf in memory as as StringBuffer and I just changed the code from
    messageBodyPart.setDataHandler(new DataHandler(pdf.toString(), "application/pdf"));
    to
    messageBodyPart.setDataHandler(new DataHandler(new ByteArrayDataSource(pdf.toString(), "application/pdf")));
    and it worked.
    Thanks a lot for your help,
    Dennis

  • Problem in sending PDF as attachment in E-Mail

    Hi All,
    I have developed a program to convert the spool request as PDF file and sending it to an E-Mail address.
    But when i'm opening the file,  I'm getting an error in Adobe Reader.
    I'm attaching the code here.
    Please give me the suggestions along with example Program.
    Sorry, I could not attach the program here.
    Thanks and regards,
    Jagan Mohan.

    DATA:ig_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
         ig_pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE.
    DATA : ig_pdf1 TYPE TABLE OF solisti1.
    DATA: g_tab_lines LIKE sy-tabix.
    DATA: ig_objpack LIKE sopcklsti1 OCCURS 2  WITH HEADER LINE,
          ig_objhead LIKE solisti1   OCCURS 1  WITH HEADER LINE,
          ig_objbin LIKE solisti1   OCCURS 10 WITH HEADER LINE,
          ig_reclist LIKE somlreci1  OCCURS 5  WITH HEADER LINE,
          ig_objtxt LIKE solisti1   OCCURS 10 WITH HEADER LINE.
    DATA: wg_doc_chng LIKE sodocchgi1.
    PERFORM convert_pdf.
    PERFORM sendmail.
    FORM convert_pdf .
      REFRESH : ig_otf , ig_pdf_tab.
      ig_otf[] = wg_otf_from_fm-otfdata[].
      CALL FUNCTION 'CONVERT_OTF'
        EXPORTING
          format                = 'PDF'
          max_linewidth         = 132
        IMPORTING
          bin_filesize          = wg_bin_fsize
        TABLES
          otf                   = ig_otf
          lines                 = ig_pdf_tab
        EXCEPTIONS
          err_max_linewidth     = 1
          err_format            = 2
          err_conv_not_possible = 3
          err_bad_otf           = 4
          OTHERS                = 5.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " convert_pdf
    FORM sendmail .
      REFRESH : ig_pdf1.
      CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
        EXPORTING
          line_width_dst              = '255'
        TABLES
          content_in                  = ig_pdf_tab[]
          content_out                 = ig_pdf1[]
        EXCEPTIONS
          err_line_width_src_too_long = 1
          err_line_width_dst_too_long = 2
          err_conv_failed             = 3
          OTHERS                      = 4.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      MOVE : 'U'   TO ig_reclist-rec_type,
             '.....'   TO ig_reclist-receiver, " move email id here
             'X'    TO ig_reclist-express,
             'INT' TO ig_reclist-com_type.
      APPEND ig_reclist.
      REFRESH ig_objtxt.
      CONCATENATE 'Payslip of employee -' wg_vbak-vbeln INTO ig_objtxt SEPARATED BY ' '.
      APPEND ig_objtxt.
    Creating the document to be sent
      wg_doc_chng-obj_descr = 'Pay Slip'.
      wg_doc_chng-obj_name  = 'PAYSLIP'.
      wg_doc_chng-obj_langu = sy-langu.
    Get length of objtxt.
      DESCRIBE TABLE ig_objtxt LINES g_tab_lines.
      READ TABLE ig_objtxt INDEX g_tab_lines.
      wg_doc_chng-doc_size = ( g_tab_lines - 1 ) * 255 + STRLEN( ig_objtxt ).
    Creating the entry for the compressed document
      CLEAR ig_objpack-transf_bin.
      ig_objpack-head_start = 1.
      ig_objpack-head_num   = 0.
      ig_objpack-body_start = 1.
      ig_objpack-body_num   = g_tab_lines.
      ig_objpack-doc_type   = 'RAW'.
      APPEND ig_objpack.
      DESCRIBE TABLE ig_pdf1 LINES g_tab_lines.
      g_tab_lines = g_tab_lines + 1.
      ig_objhead-line = 'PAYSLIP'.
      APPEND ig_objhead.
    Creating the entry for the compressed attachment
      ig_objpack-transf_bin = 'X'.
      ig_objpack-head_start = 1.
      ig_objpack-head_num   = 1.
      ig_objpack-body_start = 1.
      ig_objpack-body_num   = g_tab_lines.
      ig_objpack-doc_type   = 'PDF'.
      ig_objpack-obj_name   = 'PAYSLIP'.
      ig_objpack-obj_descr  = 'Pay Slip'.
      ig_objpack-doc_size   = g_tab_lines * 255.
      APPEND ig_objpack.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
        EXPORTING
          document_data                    = wg_doc_chng
         put_in_outbox                    = 'X'
          commit_work                      = 'X'
        TABLES
          packing_list                     = ig_objpack
          object_header                    = ig_objhead
          contents_bin                     = ig_pdf1
          contents_txt                     = ig_objtxt
          receivers                        = ig_reclist
       EXCEPTIONS
         too_many_receivers               = 1
         document_not_sent                = 2
         document_type_not_exist          = 3
         operation_no_authorization       = 4
         parameter_error                  = 5
         x_error                          = 6
         enqueue_error                    = 7
         OTHERS                           = 8 .
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.

  • I have to send a mail to external User from Migo.

    Hi All,
    I have an requirement that when i press the button post in MIGO, then the details
    should be emailed to the Client.
    I have to Use Badi....
    So pls help me out....
    Its very Urgent.....Pls
    Thanks in Advance.
    Regards,
    Shah

    You can use the BADI MB_DOCUMENT_BADI, and put your code in MB_DOCUMENT_BEFORE_UPDATE method.  This is called when the 101 material document is posted.
    Albert

  • Auto pdf mail to external users

    Dear Gurus,
    how can we send pdf output format to external users of standard report automatically..??
    how to configure the same...??
    Regards

    To send e-mails of any SAP report in PDF format. Follow these steps.
    Activate smtp and go to transaction sicf.
    Right click in SAPconnect and select activate SMTP host.
    Configure smtp and go to transaction scot.
    Double click in the SMTP node of INT.
    Select "node in use".
    In SMTP connection enter the smtp address of your company (i.e., smtp.company.com) and the mail port (usually 25).
    Click the SET Internet button and put * as the address (you can make some restrictions here, i.e., *.company.com).
    Click OK.
    Select settings. The default is domain.
    Execute the RSPO0075 report in se38 trx and create the e-mail method "M".
    Create a new output device in the SPAD transaction and enter PDF1 as the device type and M as the access method. No e-mail is required.
    Thats all. Then, when you want to send any report by e-mail in a PDF format, you should pull up the report to your screen. Then go to print, select the output device created before and enter the destination e-mail address. Don't forget to select "print out immediately."
    You also need to be sure to have the RSCONN01 report scheduled to run periodicaly (i.e., every 15 minutes). This report is resposible to deliver the SAPconnect objects

  • Sending mail to external mailid from user exit EXIT_SAPLEBNF_005

    Hai ALL,
    iam facing problem with sending mail to external id from user exit exit_saplebnf_005 , this user exit for ROLE Determination of releasing of PO .
    in this user exit i passed a user name for this role from one z table.
    through workflow the mails are send to workplace of resposible person maintained in ztable.
    now user requirement is they want some intimation in their outlook for they got mail in workplace .
    can anybody help me.
    Thanks .
    sushmita.k

    they can either define automatic forwarding in their SAP office to external e-mail OR they can set their external e-mail as preferred method of communication and they should receive mail to their external mailbox assuming that sending to external mail is supported in your system (check with BASIS folks).

  • Send pdf email attachment

    Hi,
    I m running the custom concurrent program through pl-sql code and sending the output of the same conc program on to the email id of vendor.
    When i was tryng to send the output in text file it was allowing me to send the text message as well as attachment.
    But with the same code I want to send the pdf output.
    so earlier I was using the UTL_MAIL.send_attach_varchar2 .
    And for pdf attachment I am using the UTL_MAIL.send_attach_raw.
    So custom program is generating the output but
    while sending an email, it is not attaching the output into the email.
    What could be the problem.
    Please help as I needed it urgently.
    revert me if anyone has any query.
    Thanks,
    Bluetooth_25

    No it's not generating the .pdf file.
    It's only generating the .out file.
    so is that the possibility that it is not attaching the pdf in email.
    Here is my code:
    /*Variable declaration*/
    fhandle UTL_FILE.file_type;
    flen NUMBER;
    bsize NUMBER;
    ex BOOLEAN;
    vtextout RAW (32767);
    UTL_FILE.fgetattr ('EMAIL_OUTPUT','o'||v_request_id ||'.out',ex,flen,bsize);
    fhandle := UTL_FILE.fopen('EMAIL_OUTPUT','o'||v_request_id ||'.out', 'r');
    LOOP
    BEGIN
    UTL_FILE.get_raw (fhandle,vtextout,flen);
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    EXIT;
    END;
    END LOOP;
    UTL_FILE.fCLOSE(fhandle);
    FOR email_rec in c2_vendor_email_add(po_rec.po_header_id)
    LOOP
    UTL_MAIL.send_attach_raw
    sender => '[email protected]',
    recipients => email_rec.email_address,
    subject => 'Testmail',
    MESSAGE => 'This is test mail',
    attachment => vtextout,
    att_mime_type =>'application/pdf',
    att_filename =>'o'||v_request_id ||'.out'
    and i have one more question how to send an email to multiple recipients using utl_mail.send_attach_raw

  • Service command in Preview.app - Send PDF as attachment doesn't work

    I have used the following workflow for month on all my three macs.
    I open up a PDF file in Preview and select "eMail PDF as attachment" from the Edit menu at the top of the screen. This will attach the current viewed PDF file to a new mail message.
    I guess after updating to 10.7.2 somehow it stopped working on MacBook Pro and iMac. My Mac mini is fine. 
    When I do use this command I get two error messages. Service not available. Can't attach PDF to mail. Import failed. Something like that.
    Does anyone know how to fix that? I repaired permissions and did all that kind of stuff.
    Thanks in advance!

    Would it be possible, please, for someone who has/had this issue to send me the com.apple.ServicesMenu.Services.plist files from ~/Library/Containers/com.apple.Preview/Data/Library/Preferences and from ~/Library/Preferences?
    Thank you.

  • Sap adobeform sending pdf as attachment with specific name

    Hi Experts,
    Need your help in solving my problem !!
    My requirement is to send adobe form as mail attachment in PDF format, Which I am able to do.
    My Problem is PDF attachment should be generated with specific name.
    For example my scenario (below given screen shot),
    When i click on submit by email button, PDF will be attached to my mail,
    with some random name such as "d4811f8_45171.pdf" Instead it should be generated with
    fixed name such as "new_attach.pdf" or dynamic name using user name such as
    "Vishwa_attachment.pdf".
    Kindly help to achieve my needs.
    Any help will be greatly appreciated and rewarded.
    Thanks in advance,
    Regards,
    Vishwa

    Hi Naveen,
    please read through my query again, I should generate pdf when I click on "submit by email button".
    I am not using any function for conversion it will happen automatically.
    thanks,
    Vishwa

  • Not Able to send pdf as attachment through email

    Hi,
    I am trying to send the generated pdf as attachment throught email and for the same i am referring to this blog
    http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417100)ID1409662650DB01562818410448928630End?blog=/pub/wlg/8551
    but when i am trying to send the mail using the method given in this blog , i am getting this error
    com.sap.tc.adobe.pdfobject.core.PDFObjectRuntimeException: Processing exception during a "MergeData" operation. Request start time: Fri Dec 11 18:05:24 IST 2009 com.adobe.ProcessingException: PDF is not interactive. Data can only be imported into interactive forms. Exception Stack Trace: com.adobe.ProcessingException: PDF is not interactive
    and at the backend i am getting the error as
    #com.sun.mail.smtp.SMTPSendFailedException: 501 Bad address syntax
    Can any one please help me out with a solution ?? Any suggestions are welcomed
    Thanks a lot in advance

    Hi,
    Thanks for your reply , but i cannot set the enabled property of the form as true as we are not using the licensed version of the live cycle designer . But if i try the example step by step then even by setting the enabled property as false , the pdf is generated and sent through the email and when i am trying to do the same thing in one of my applications its not working . The pdf is generated but as soon as i click on the button send mail the above told error is displayed .
    There needs to be some other explaination for the error

  • Can't open a pdf file attachement to e-mail

    I canot open an e-mail pdf file attachment..I get a message
    You have chosen to open Invoice---pdf
    which is: Firefox HTML Document (479kB)
    What should Thunderbird do with this file?
    Open with Firefox (default)
    I do all of the above but nothing happens and I keep getting the same message over andf over again??
    Please advise what I should do
    Thanksd

    Thanks. I disabled Protected Mode, and I was able to open the pdf attachment. Just to make sure, I enabled it and then disabled it again, and when I tried to open the attachment, it did as before – Adobe Reader (Not Responding) and Internal Error message. Tried it several more times, (enable and then disable Protected Mode) and each time, Adobe Reader wouldn’t launch (Not Responding, Internal Error).
    Morris Davidson

  • Send a file attached to a mail send with sendmail

    Hello,
    I'd like to send a report with a short mail to a mailing list. This task will be done every day by executing a ksh script.
    May I do it with sendmail ? how ?
    Is there another way to do it ?
    Thanks for your help.
    Ncg

    Sorry,
    question already posted on kernel Forum: "Command line mail - attachment"

  • Opening PDF files attached to e-mails

    Hi there
    I experience problems opening pdf attachements to e-mails. I have an error message telling me that the file is damaged and cannot be open.
    Nevertheless I can read the exact same attachment from mail on my iPad, I have that problem with my Mac Book Pro only.
    I use the Apple Mail software in both cases.
    This is recent, no new software installed, and Adobe Reader is up to date on both devices.
    Any hint? I'm getting fed up about these Apple specific issues, what a loss of time I've never experienced such things with PCs.
    Eric

    Did you find a solution to this issue? I am facing the same problem. It was fine before, suddenly it says that all files are damaged and cannot be opened.
    Thanks so much!
    Krystel

  • Sending an Excel Attachment in E-mail, where linesize 255 characters

    Hi,
    I have a requirement where I need to send an Excel attachment of around 150 columns and the line-size is around 2000 characters.
    I was planning to use SO_DOCUMENT_SEND_API1.
    But, it appears that because of the restriction of 255 characters as SOLISTI1 structure has the field size of 255 characters.
    Please note, I cannot use any of the OLE or foreground Excel functions, as the job runs in the background.
    Please let me know if you have any solutions or work around.
    Hoiping to hear from all of the experts out there.
    Regards,
    Ani

    try to use the following classes :       
    send_request  TYPE REF TO cl_bcs,
            document      TYPE REF TO cl_document_bcs,
            conlengths    TYPE        so_obj_len,
            html          TYPE STANDARD TABLE OF w3html,
            sender_id     TYPE REF TO if_sender_bcs,
            recipient     TYPE REF TO if_recipient_bcs,
            sent_to_all   TYPE        os_boolean,
            bcs_exception TYPE REF TO cx_bcs,
            bcs_message   TYPE        string.

  • Groupwise not send mails to external users

    Hello everyone.
    I did a clean install of SBE with eDirectory, iManager, and Groupwise. Just when the installation can send emails to a user outside the domain (external user), but after restarting the mail server does not come to any external users, but if I receive them.

    Originally Posted by amoron
    Hello everyone.
    I did a clean install of SBE with eDirectory, iManager, and Groupwise. Just when the installation can send emails to a user outside the domain (external user), but after restarting the mail server does not come to any external users, but if I receive them.
    Did you setup internet addressing? Currently you have to manually setup internet addressing in Console One when setting up groupwise8 (see the docs for a how-to, its very easy). Without internet addressing, you'll be able to send emails to internal users, but not to external users, which seems to be the problem you are having.
    Just FYI, this internet addressing problem is being addressed in the next patch, which is currently in testing.
    -Hart

Maybe you are looking for

  • Issue with Overall Result - Help

    Hello, I have a query with two restricted keyfigures (0amount used) as actual and forecast. While drilldown by fiscal period, the overall result shows totals for actual and plan separately. Business point of view, they want to have total of both (act

  • Music videos don't display on ipod

    I have all my music videos on itunes but they won't go on my ipod nano 5g after synciing several times.

  • Preview and printing

    Still new to iMac. In preview i've found some pdf that it will not open. Why is this and how does one get to make it/them display? Does i depend on what program made the pdf or something else? Thanks, larryJay

  • Print Location Case sensitivity

    Hi all, Recently, we've engaged in a project and the server has 2 folders, FOLDER and folder. For which, FOLDER is where we wish the pdfs will be printed and the printer tags in the ini files point to the capitalized version. When we run the sh file

  • From where text comes for std. unit & time characteristics

    Hi Experts, Can anyone pls.tell me from where master data like text data comes for standard unit,time characteristics like cal.day,fiscal year,posting year, currency etc.. In info object maintainance screen, master data/text tab, I have seen Master d