PDF file is blank in external email attachment

Dear all,
I have successfully convert a SAPScript to PDF file and then attach in email to be sent to customer externally. However, the contents in the attachment is blank. It works properly if I remove the email function, and download it to front end pc. ANyone can give me solution or idea that why this problem happens and how to solve it? Thanks in advance.

Hi
After the FM: CONVERT_ABAPSPOOLJOB_2_PDF and before calling the FM: SO_NEW_DOCUMENT_ATT_SEND_API1 in ur code call one more FM: QCE1_CONVERT.
Hope it will work.
Regards,
Sreeram

Similar Messages

  • Pdf file increases when printing from email attachment

    We are using Windows XP and acrobat 7.0 professional. We are receiving files with a PDF attachment which is only about 1 MB When we send to the printer it then says the file is now approx 36mb and therefore crashes the printer and we can't print the file. Some of these files have images others don't but have the same problem. We are receiving them from at least 2 different companies - unknown what system they are using. How can we get around this

    Are you printing to a PCL or PostScript device? If you have a choice, try
    both and see if one works. You also might try using the "Print as image"
    feature from the advanced printing options.

  • IPAD3/IPAD2 :PDF files/ attachments  sent in an email  displayed inline ( embedded within the main email) in the message text on both my Ipad2 and Ipad three, however the same email displayed the PDF File icons/ attachment on both my Iphone and a friend's

    IPAD3/IPAD2 :PDF files/ attachments  sent in an email  displayed inline ( embedded within the main email) in the message text on both my Ipad2 and Ipad three, however the same email displayed the PDF File icons/ attachment on both my Iphone and a friend’s PC. How do i get both my IPAD devices to display the PDF icons/attachments? Bearing in mind if i open the same email over the internet the PDF Icons/attachments display OK!
    Has anyone come across this? Your advice/help would be most appreciated

    This happens to me all the time.
    If is a one page PDF it seems as though it comes over already open and inline in the body of the email. Multiple page PDF files show as the PDF icon.
    I can't find any official documentation of this - other than based on my own experience with PDF attachments in my various email accounts.
    Message was edited by: Demo

  • I'm using iphone 4S, and I can not open PDF file only from my husband email that using Mic outlook. It was very weird because I can received other email with pdf file from other people. can someone help.

    I'm using iphone 4S and ipad mini, and I can not open PDF file only from my husband email that using Mic outlook. It was very weird because I can received other email with pdf file from other people. Can someone help...
    Thanks in advance

    Hi Eidda,
    This may because the attachment is a winmail.dat file. I would recommend taking a look at the article below for more information. Note: the article is written for OS X mail, but does also apply to this situation.
    Mac OS X Mail: What is a winmail.dat attachment?
    http://support.apple.com/kb/HT2614
    -Griff W.

  • I can't open a jpg file directly from an Outlook email attachment into Photoshop CC.

    When I try to open a jpg file directly from an Outlook email attachment into Photoshop CC I get this error message " Photyoshop CC.exe - Entry Point not found" with this string:

    I don't think I have ever been able to open an image directly from Outlook into Photoshop.  What you can do, is drag from outlook to desktop, and then from desktop into Photoshop.  Or, if seeing the windows at the same time is a problem, drag onto desktop, then minimise everything, and drag onto the Photoshop icon (if you have a Photoshop shortcut on your desktop).

  • Why are pdf files opened automatically in iPad email. I need to save the pdf file itself.

    Why are pdf files opened automatically in iPad email?  I need to save the pdf file itself, so I can re-read them for later.  ANy fix.  Some pdf files I send are saved as pdf files unopened.

    I have no idea how an iPad works.
    [topic moved to iOS subforum]

  • How do I compress a large pdf file to fit in an email?

    how do I compress a large pdf file to fit in an email?

    No
    Envoyé depuis Molto pour iPad
    De: pwillener
    Envoyé: jeudi, février 12, 2015 07:14 AM
    À: René Allamelle
    Objet:  how do I compress a large pdf file to fit in an email?
    how do I compress a large pdf file to fit in an email?
    created by pwillener in Adobe Acrobat.com Services - View the full discussion
    But generally it is never a good idea to send e-documents as email attachments.  Better use a file sharing service (Acrobat.com, Dropbox, Google Drive, Microsoft OneDrive, ..), upload the document, then send the shared download link via email.
    If the reply above answers your question, please take a moment to mark this answer as correct by visiting: https://forums.adobe.com/message/7187079#7187079 and clicking ‘Correct’ below the answer
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    Please note that the Adobe Forums do not accept email attachments. If you want to embed an image in your message please visit the thread in the forum and click the camera icon: https://forums.adobe.com/message/7187079#7187079
    To unsubscribe from this thread, please visit the message page at , click "Following" at the top right, & "Stop Following"
    Start a new discussion in Adobe Acrobat.com Services by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to https://forums.adobe.com/thread/1516624.

  • I tried sending the Adobe pdf file of a poster via email and it said the file was too large to send.  How do I remedy this?

    I tried sending an Adobe pdf file of a poster via email and it wouldn't go through because it said the file was too large.  How do I remedy this?

    Lots of free file hosters out there. Mediafire.com as an example. Upload a file there, copy and paste the download link you are given into your email to the client, then delete it as soon as the client successfully downloads it. Mediafire has 10 gb storage for free accounts.
    Email is limited to 10 MB on attachments. So that's where file hosting comes in.

  • Sending PDF file in presentation layer as a attachment to Email

    Hi,
    I have a PDF file in my Presentation layer, I want to send it as a attachment to Email. Is there any Function Module or sample code to it.
    Regards,
    Adithya M.

    Hi Maha,
    Go through this hope u can understand. also check this link
    http://abapcode.blogspot.com/2007/05/convert-spool-request-to-pdf-and-send.html.
    Here is the code to send the Smartform to mail as PDF attachment.
    *& Report ZTEST_NREDDY_PDF_MAIL
    REPORT ZTEST_NREDDY_PDF_MAIL.
    Internal Table declarations
    DATA: I_OTF TYPE ITCOO OCCURS 0 WITH HEADER LINE,
    I_TLINE TYPE TABLE OF TLINE WITH HEADER LINE,
    I_RECEIVERS TYPE TABLE OF SOMLRECI1 WITH HEADER LINE,
    I_RECORD LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
    Objects to send mail.
    I_OBJPACK LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
    I_OBJTXT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
    I_OBJBIN LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
    I_RECLIST LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE,
    Work Area declarations
    WA_OBJHEAD TYPE SOLI_TAB,
    W_CTRLOP TYPE SSFCTRLOP,
    W_COMPOP TYPE SSFCOMPOP,
    W_RETURN TYPE SSFCRESCL,
    WA_DOC_CHNG TYPE SODOCCHGI1,
    W_DATA TYPE SODOCCHGI1,
    WA_BUFFER TYPE STRING, "To convert from 132 to 255
    Variables declarations
    V_FORM_NAME TYPE RS38L_FNAM,
    V_LEN_IN LIKE SOOD-OBJLEN,
    V_LEN_OUT LIKE SOOD-OBJLEN,
    V_LEN_OUTN TYPE I,
    V_LINES_TXT TYPE I,
    V_LINES_BIN TYPE I.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    FORMNAME = 'ZTEST'
    IMPORTING
    FM_NAME = V_FORM_NAME
    EXCEPTIONS
    NO_FORM = 1
    NO_FUNCTION_MODULE = 2
    OTHERS = 3.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    W_CTRLOP-GETOTF = 'X'.
    W_CTRLOP-NO_DIALOG = 'X'.
    W_COMPOP-TDNOPREV = 'X'.
    CALL FUNCTION V_FORM_NAME
    EXPORTING
    CONTROL_PARAMETERS = W_CTRLOP
    OUTPUT_OPTIONS = W_COMPOP
    USER_SETTINGS = 'X'
    IMPORTING
    JOB_OUTPUT_INFO = W_RETURN
    EXCEPTIONS
    FORMATTING_ERROR = 1
    INTERNAL_ERROR = 2
    SEND_ERROR = 3
    USER_CANCELED = 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.
    I_OTF[] = W_RETURN-OTFDATA[].
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
    FORMAT = 'PDF'
    MAX_LINEWIDTH = 132
    IMPORTING
    BIN_FILESIZE = V_LEN_IN
    TABLES
    OTF = I_OTF
    LINES = I_TLINE
    EXCEPTIONS
    ERR_MAX_LINEWIDTH = 1
    ERR_FORMAT = 2
    ERR_CONV_NOT_POSSIBLE = 3
    OTHERS = 4.
    IF SY-SUBRC <> 0.
    ENDIF.
    LOOP AT I_TLINE.
    TRANSLATE I_TLINE USING '~'.
    CONCATENATE WA_BUFFER I_TLINE INTO WA_BUFFER.
    ENDLOOP.
    TRANSLATE WA_BUFFER USING '~'.
    DO.
    I_RECORD = WA_BUFFER.
    APPEND I_RECORD.
    SHIFT WA_BUFFER LEFT BY 255 PLACES.
    IF WA_BUFFER IS INITIAL.
    EXIT.
    ENDIF.
    ENDDO.
    Attachment
    REFRESH: I_RECLIST,
    I_OBJTXT,
    I_OBJBIN,
    I_OBJPACK.
    CLEAR WA_OBJHEAD.
    I_OBJBIN[] = I_RECORD[].
    Create Message Body Title and Description
    I_OBJTXT = 'test with pdf-Attachment!'.
    APPEND I_OBJTXT.
    DESCRIBE TABLE I_OBJTXT LINES V_LINES_TXT.
    READ TABLE I_OBJTXT INDEX V_LINES_TXT.
    WA_DOC_CHNG-OBJ_NAME = 'smartform'.
    WA_DOC_CHNG-EXPIRY_DAT = SY-DATUM + 10.
    WA_DOC_CHNG-OBJ_DESCR = 'smartform'.
    WA_DOC_CHNG-SENSITIVTY = 'F'.
    WA_DOC_CHNG-DOC_SIZE = V_LINES_TXT * 255.
    Main Text
    CLEAR I_OBJPACK-TRANSF_BIN.
    I_OBJPACK-HEAD_START = 1.
    I_OBJPACK-HEAD_NUM = 0.
    I_OBJPACK-BODY_START = 1.
    I_OBJPACK-BODY_NUM = V_LINES_TXT.
    I_OBJPACK-DOC_TYPE = 'RAW'.
    APPEND I_OBJPACK.
    Attachment (pdf-Attachment)
    I_OBJPACK-TRANSF_BIN = 'X'.
    I_OBJPACK-HEAD_START = 1.
    I_OBJPACK-HEAD_NUM = 0.
    I_OBJPACK-BODY_START = 1.
    DESCRIBE TABLE I_OBJBIN LINES V_LINES_BIN.
    READ TABLE I_OBJBIN INDEX V_LINES_BIN.
    I_OBJPACK-DOC_SIZE = V_LINES_BIN * 255 .
    I_OBJPACK-BODY_NUM = V_LINES_BIN.
    I_OBJPACK-DOC_TYPE = 'PDF'.
    I_OBJPACK-OBJ_NAME = 'smart'.
    I_OBJPACK-OBJ_DESCR = 'test'.
    APPEND I_OBJPACK.
    CLEAR I_RECLIST.
    I_RECLIST-RECEIVER = '[email protected]'.
    I_RECLIST-REC_TYPE = 'U'.
    APPEND I_RECLIST.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    DOCUMENT_DATA = WA_DOC_CHNG
    PUT_IN_OUTBOX = 'X'
    COMMIT_WORK = 'X'
    TABLES
    PACKING_LIST = I_OBJPACK
    OBJECT_HEADER = WA_OBJHEAD
    CONTENTS_BIN = I_OBJBIN
    CONTENTS_TXT = I_OBJTXT
    RECEIVERS = I_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.
    WRITE:/ 'Error When Sending the File', SY-SUBRC.
    ELSE.
    WRITE:/ 'Mail sent'.
    ENDIF.
    If you want to send some text as Body of the Mail then follow this once
    when u r callin the FM'SO_NEW_DOCUMENT_ATT_SEND_API1'.. points to remember
    1.u have to pass the body of content in table CONTENTS_TXT(ia m using I_OBJBIN) (each line a record) then. suppose i have appended 11 records to the table CONTENTS_TXT .
    2.PACKING_LIST(iam usign I_OBJPACK) table u ahve to append a redord as follows
    I_OBJPACK-TRANSF_BIN = ' '.
    I_OBJPACK-HEAD_START = 000000000000001.
    I_OBJPACK-HEAD_NUM = 000000000000001.
    I_OBJPACK-BODY_START = 000000000000002
    I_OBJPACK-BODY_NUM = 000000000000010.
    I_OBJPACK-DOC_TYPE = 'RAW'.
    append I_OBJPACK-.
    by the above code system treat the first line in table I_OBJBIN as header and the 2nd line to 10 lines tread as body.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    DOCUMENT_DATA = WA_DOC_CHNG
    PUT_IN_OUTBOX = 'X'
    TABLES
    PACKING_LIST = I_OBJPACK
    OBJECT_HEADER = WA_OBJHEAD
    CONTENTS_BIN = I_OBJBIN
    CONTENTS_TXT = I_OBJTXT
    RECEIVERS = I_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.
    *& Report ZSPOOLTOPDF *
    *& Converts spool request into PDF document and emails it to *
    *& recipicant. *
    *& Execution *
    *& This program can be run in background or online and a spool request *
    *& will still be created *
    REPORT zspooltopdf.
    PARAMETER: p_email1 LIKE somlreci1-receiver
    DEFAULT ‘[email protected]’,
    p_sender LIKE somlreci1-receiver
    DEFAULT ‘[email protected]’,
    p_delspl AS CHECKBOX,
    p_online no-display.
    *DATA DECLARATION
    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,
    w_spool_nr like sy-spono.
    %_print LIKE pri_params.
    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’.
    *START-OF-SELECTION.
    START-OF-SELECTION.
    Write statement to represent report output. Spool request is created
    if write statement is executed in background. This could also be an
    ALV grid which would be converted to PDF without any extra effort
    WRITE ‘Hello World’.
    new-page.
    commit work.
    new-page print off.
    If p_online = ‘X’.
    Processing performed when program calls itself when run online
    gd_spool_nr = sy-spono.
    EXPORT gd_spool_nr TO MEMORY ID ‘SPOOLTOPDF’.
    EXIT.
    endif.
    IF sy-batch EQ ‘X’.
    PERFORM get_job_details.
    PERFORM obtain_spool_id.
    ELSE.
    gd_spool_nr = sy-spono.
    If executed online, it submits a program to perform the write
    statements
    instructing it to create a spool request, this could be another
    program
    which just performs the write statements and then exports sy-spono
    to memory. But in this example it calls itself passing X to parameter
    p_online, which takes it down an alternative procesing path.
    submit ZSPOOLTOPDF
    with p_online = ‘X’
    to sap-spool
    spool parameters %_print
    archive parameters %_print
    without spool dynpro
    and return.
    ENDIF.
    Get spool id from program called above
    IMPORT gd_spool_nr FROM MEMORY ID ‘SPOOLTOPDF’.
    PERFORM convert_spool_to_pdf.
    PERFORM process_email.
    if p_delspl EQ ‘X’.
    PERFORM delete_spool.
    endif.
    IF sy-sysid = c_dev.
    wait up to 5 seconds.
    SUBMIT rsconn01 WITH mode = ‘INT’
    WITH output = ‘X’
    AND RETURN.
    ENDIF.
    FORM obtain_spool_id *
    FORM obtain_spool_id.
    CHECK NOT ( gd_jobname IS INITIAL ).
    CHECK NOT ( gd_jobcount IS INITIAL ).
    SELECT * FROM tbtcp
    INTO TABLE it_tbtcp
    WHERE jobname = gd_jobname
    AND jobcount = gd_jobcount
    AND stepcount = gd_stepcount
    AND listident ‘0000000000&#8242;
    ORDER BY jobname
    jobcount
    stepcount.
    READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
    IF sy-subrc = 0.
    message s004(zdd) with gd_spool_nr.
    gd_spool_nr = wa_tbtcp-listident.
    MESSAGE s004(zdd) WITH gd_spool_nr.
    ELSE.
    MESSAGE s005(zdd).
    ENDIF.
    ENDFORM.
    FORM get_job_details *
    FORM get_job_details.
    Get current job details
    CALL FUNCTION ‘GET_JOB_RUNTIME_INFO’
    IMPORTING
    eventid = gd_eventid
    eventparm = gd_eventparm
    external_program_active = gd_external_program_active
    jobcount = gd_jobcount
    jobname = gd_jobname
    stepcount = gd_stepcount
    EXCEPTIONS
    no_runtime_info = 1
    OTHERS = 2.
    ENDFORM.
    FORM convert_spool_to_pdf *
    FORM convert_spool_to_pdf.
    CALL FUNCTION ‘CONVERT_ABAPSPOOLJOB_2_PDF’
    EXPORTING
    src_spoolid = gd_spool_nr
    no_dialog = c_no
    dst_device = c_device
    IMPORTING
    pdf_bytecount = gd_bytecount
    TABLES
    pdf = it_pdf_output
    EXCEPTIONS
    err_no_abap_spooljob = 1
    err_no_spooljob = 2
    err_no_permission = 3
    err_conv_not_possible = 4
    err_bad_destdevice = 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
    OTHERS = 12.
    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.
    ENDFORM.
    FORM process_email *
    FORM process_email.
    DESCRIBE TABLE it_mess_att LINES gd_recsize.
    CHECK gd_recsize > 0.
    PERFORM send_email USING p_email1.
    perform send_email using p_email2.
    ENDFORM.
    FORM send_email *
    –> p_email *
    FORM send_email USING p_email.
    CHECK NOT ( p_email IS INITIAL ).
    REFRESH it_mess_bod.
    Default subject matter
    gd_subject = ‘Subject’.
    gd_attachment_desc = ‘Attachname’.
    CONCATENATE ‘attach_name’ ‘ ‘ INTO gd_attachment_name.
    it_mess_bod = ‘Message Body text, line 1&#8242;.
    APPEND it_mess_bod.
    it_mess_bod = ‘Message Body text, line 2…’.
    APPEND it_mess_bod.
    If no sender specified - default blank
    IF p_sender EQ space.
    gd_sender_type = space.
    ELSE.
    gd_sender_type = ‘INT’.
    ENDIF.
    Send file by email as .xls speadsheet
    PERFORM send_file_as_email_attachment
    tables it_mess_bod
    it_mess_att
    using p_email
    ‘Example .xls documnet attachment’
    ‘PDF’
    gd_attachment_name
    gd_attachment_desc
    p_sender
    gd_sender_type
    changing gd_error
    gd_reciever.
    ENDFORM.
    FORM delete_spool *
    FORM delete_spool.
    DATA: ld_spool_nr TYPE tsp01_sp0r-rqid_char.
    ld_spool_nr = gd_spool_nr.
    CHECK p_delspl c_no.
    CALL FUNCTION ‘RSPO_R_RDELETE_SPOOLREQ’
    EXPORTING
    spoolid = ld_spool_nr.
    ENDFORM.
    *& Form SEND_FILE_AS_EMAIL_ATTACHMENT
    Send email
    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-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&#8242;
    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.
    Reward points if helpful
    Thanks
    Naveen khan

  • How do I send a .pdf file in the body of email, not as attachment?

    Hello to all you MAC geniuses out there. I am using Pages to design flyers for my business. Then exporting them to a pdf file and trying to figure out how to send them in the BODY of an email and not an attachemnt that they have to open. Not really sure if this is a mail or pages question. It is probably a very simple step I am missing, but never the less can't seem to fiugre it out. Thanks in advance!
    Genn

    You must take into consideration that HTML & PDF are very different formats with conflicting purposes: HTML is by design intended for flexibility in appearance in such things as font & location of displayed elements, & has no fixed page size. PDF is intended to produce WYSIWYG documents, exactly the same regardless of platform, but requires either the Adobe Acrobat application or a PDF plug-in to do so.
    Because of this, there is no way to convert a PDF document into HTML that will completely preserve the PDF's appearance. You can more or less force elements into the same relative position using tables & other HTML features, but pagination cannot be preserved, since no HTML formatted documents will have page breaks.
    You also should consider that the appearance of an email message depends on the application used to view it. Most email, including what Mail generates, follows a standard known as MIME 1.0. MIME is designed to identify each element in the message such that different applications can process them according to their capabilities. Thus, since Mail knows how to display image files like gifs, tiffs, or jpegs, they will be displayed as if they were embedded in the text if the MIME tags indicate they should be. Anything Mail doesn't know how to process into displayable text or images, such as PDF's, will be displayed only as an attachment. The same will be true for other email reading applications.
    IOW, email is not WYSIWYG. Some apps will show displayable items inline, some won't, even if the MIME type is displayable on your Mac in Mail.
    There are several ways you can deal with this. You can try to convert the PDF into HTML, as suggested earlier. You will probably have to tweak the HTML so generated with an editor to get the best results, & deal with such things as pagination, image conversion or resizing, so-called web safe colors, etc. (PDF's are compressed & usually optimized for high resolution printing; to keep the message size down, you may want to convert images to lower resolution jpegs.)
    Or, you can convert the entire flyer to a jpeg or png image, which insures WYSIWYG output, but may make text harder to read.
    Alternately, you can compose a new message as plain text or as HTML that refers to the PDF's content & either includes it as an attachment or furnishes a link to a web page that contains it. This allows you to reach the widest audience, including those who do not have a PDF app or plug-in.
    Whatever you elect to do, remember that what you send in the email is actually a combination of content & instructions about how to deal with it, & that not all recipients will see it the same way, no matter what you do.

  • How to attach the PDF file in spool to an email?

    Dear friends,
        I need to attach the PDF file generated in the spool (SP01) to email.
    The PDF file is generated from VL02N at the time of Post Goods Issue .
    Thanks,
    Vidya.

    Hi,
    Refer to the link it is explained how to configure the output type to send the email with PDF attachment on saving the Billing Document.. you need to do the same way..
    Email Billing document as PDF Attachment while saving from VF01/02

  • Sending a pdf file using submit without client email program.

    I need a solution on sending a completed pdf file to my email address without the clients email program poping up.  My website has a small pdf file that users can complete and return to me.  I get many complaints from users stating it requires them to save the file first and then they are unsure were it saved or how to attach it to a email.  To make this easer on my users I want the submit button to simply send me the file using some method from my website.  I use iPage to host the site now.  I was looking for a script to call or some way to do this automaticly.  I was woundering if urs/sbin/sendmail might work.  I am simply at a loss on this.

    Using a sendmail type script will send you the form data in the body of an email message, if the form is set up to submit as "HTML". You can create your own script to attach the form data as an FDF, XFDF, or even the complete PDF, but it's unlikely your provider supplies a script for this, so you'd have some custom programming to do.
    Sending just the form data also avoids the licensing restrictions for Reader-enabled forms. You can easily import an FDF or XFDF into a blank form to create a filled-in form.

  • .pdf is missing when send as email attachment (Outlook) from Adobe Reader 11.0.06

    The PDF is streamed from our webserver application to an IFRAME in Internet Explorer 9.
    The headers Content-type (application/pdf), Content-disposition (random-unique-filename.pdf), Content-length are all set.
    Acrobat Reader plugin opens up inside the IFRAME and presents the PDF without problems.
    When our users try "Send file as email attachment" Outlook 2010 opens up and the file is attached - without the file extension.
    The name of the attachment is the same name as the Java Servlet that delivered the streamed file.
    If we save the streamed PDF to disc, open it in Acrobat and do the same maneuver - the file extension is added to the attached file name in Outlook.
    Message was edited by: Solson

    We have the same problem !
    Tested this today with adobe reader 9.5.x , file is attached as  "filename.do.pdf"
    If we use adobe reader 11.0.x file is attached as "filename.do"
    If you use save file as , it does get the "pdf" extension automatically
    Solution appreciated !

  • How to send pdf files from local dir through emails attachments

    I have some pdf documents in some directory, I want to send those pdf's as an attachment throu emails to the concerned person.
    Please let me know how to attach the files and send through email.
    Thanks.

    You are using Forms 4.5, which is a client/server configuration. When you create a pdf file, the file has to be written to a directory that is accessible from your PC. D:\ is acessible, /tmp/ not (that is a directory on some Unix server). If you want to write files to a Unix server, you have to set up Samba and map a drive from your PC to he Unix directory.
    Since you are creating multiple pdf files, you will have to wait until all reports are finished and mail them afterwards. You can create a batch script to mail the files.

  • Sending PDF forms (created using SFP) as Email Attachment

    Hi,
         I have created bunch of ADOBE forms using SFP. They are not interactive forms. created using ADOBE Live cycle designer.
    I have the Function module and by executing I can view the PDF form in print preview mode. But I have to save this in backend and attach to email.
    I have a program that have to send one of the forms created in SFP as email attachment to outside SAP.
    Please advice how to achieve this.
    Thanks,
    Sanjeev

    Hi ,
    Please find below a code sample for your requirement
    *& Report  ZENVOI_PDF_MAIL
    REPORT  zenvoi_pdf_mail MESSAGE-ID ad.
    TYPE-POOLS : abap .
    DATA : data_for_update TYPE zdemopdf ,
           hexa            TYPE solix_tab.
    DATA : fm_name   TYPE funcname ,
           param     TYPE sfpoutputparams,
           doc_param TYPE sfpdocparams ,
           output    TYPE fpformoutput .
    param-nodialog = abap_true. " suppress printer dialog popup
    param-getpdf = abap_true.
    doc_param-langu = sy-langu.
    doc_param-country = 'FR'.
    doc_param-fillable = abap_true.
    doc_param-dynamic = abap_true.
    CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
      EXPORTING
        i_name     = 'ZDEMO_PDF'
      IMPORTING
        e_funcname = fm_name.
    CALL FUNCTION 'FP_JOB_OPEN'
      CHANGING
        ie_outputparams = param
      EXCEPTIONS
        cancel          = 1
        usage_error     = 2
        system_error    = 3
        internal_error  = 4.
    CHECK sy-subrc EQ 0.
    CALL FUNCTION fm_name
      EXPORTING
        /1bcdwb/docparams  = doc_param
        data_for_update    = data_for_update
      IMPORTING
        /1bcdwb/formoutput = output
      EXCEPTIONS
        usage_error        = 1
        system_error       = 2
        internal_error     = 3.
    CALL FUNCTION 'FP_JOB_CLOSE'
      EXCEPTIONS
        usage_error    = 1
        system_error   = 2
        internal_error = 3
        OTHERS         = 4.
    CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
      EXPORTING
        buffer     = output-pdf "PDF file from function module
      TABLES
        binary_tab = hexa.
    * Envoi du mail
    ** CLASS-DEFINITIONS
    DATA: send_request       TYPE REF TO cl_bcs.
    DATA: document           TYPE REF TO cl_document_bcs.
    *DATA: sender             TYPE REF TO cl_sapuser_bcs.
    data: sender            TYPE REF TO if_sender_bcs.
    DATA: recipient          TYPE REF TO if_recipient_bcs.
    ** INTERNAL TABLES
    DATA: l_mailtext TYPE soli_tab.
    DATA: iaddsmtp   TYPE TABLE OF bapiadsmtp.
    DATA: ireturn    TYPE TABLE OF bapiret2.
    ** VARIABLES
    DATA: mail_line  LIKE LINE OF l_mailtext.
    DATA: bapiadsmtp         TYPE bapiadsmtp.
    DATA: subject    TYPE so_obj_des.
    DATA : att_subject TYPE so_obj_des.
    DATA : w_except TYPE REF TO cx_root .
    CONSTANTS : c_defmail TYPE ad_smtpadr VALUE
                     '[email protected]' .
    FIELD-SYMBOLS : <smtp> TYPE bapiadsmtp.
    *Set subject of the mail
    subject = 'Exemple de PDF interactif'.
    * Set text of the mail
    mail_line = 'Merci de remplir le formulaire et nous le retourner'.
    APPEND mail_line TO l_mailtext .
    att_subject = 'Template du PDF'.
    TRY.
    * Create persistent send request
        send_request = cl_bcs=>create_persistent( ).
    * Get sender object
        sender = cl_sapuser_bcs=>create( sy-uname ).
    *    sender =
    *      cl_cam_address_bcs=>create_internet_address( '[email protected]' ) .
    * Add sender
        CALL METHOD send_request->set_sender
          EXPORTING
            i_sender = sender.
    * Read the E-Mail address for the user
    *    CALL FUNCTION 'BAPI_USER_GET_DETAIL'
    *      EXPORTING
    *        username = sy-uname
    *      TABLES
    *        return   = ireturn
    *        addsmtp  = iaddsmtp.
    *    LOOP AT iaddsmtp ASSIGNING <smtp> WHERE std_no = 'X'.
    *      CLEAR bapiadsmtp.
    *      MOVE <smtp> TO bapiadsmtp.
    *    ENDLOOP.
    *    CASE bapiadsmtp-e_mail.
    *      WHEN space.
            recipient =
         cl_cam_address_bcs=>create_internet_address( c_defmail ).
    *      WHEN OTHERS.
    *        recipient =
    *     cl_cam_address_bcs=>create_internet_address( bapiadsmtp-e_mail ).
    *    ENDCASE.
    * Add recipient with its respective attributes to send request
        CALL METHOD send_request->add_recipient
          EXPORTING
            i_recipient  = recipient
            i_express    = 'X'
            i_copy       = space
            i_blind_copy = space
            i_no_forward = space.
    * Set that you don't need a Return Status E-mail
        CALL METHOD send_request->set_status_attributes
          EXPORTING
            i_requested_status = 'E'
            i_status_mail      = 'E'.
    * set send immediately flag
        send_request->set_send_immediately( 'X' ).
    *Build Document
        document = cl_document_bcs=>create_document(
                            i_type    = 'RAW'
                            i_text    = l_mailtext
                            i_subject = subject ).
    *     add attachment to document
        CALL METHOD document->add_attachment
          EXPORTING
            i_attachment_type    = 'PDF'
            i_attachment_subject = att_subject
            i_att_content_hex    = hexa.
    * Add document to send request
        CALL METHOD send_request->set_document( document ).
    * Send document
        CALL METHOD send_request->send( ).
        COMMIT WORK.
      CATCH cx_send_req_bcs INTO w_except.
      CATCH cx_address_bcs INTO w_except.
      CATCH cx_document_bcs INTO w_except.
    ENDTRY.
    Hope this help you .
    Best regards

Maybe you are looking for

  • How do I find more info of images in iPhoto 11?

    I older versions of iPhoto, as I recall, when an image was open, there was file data including the filename and path for the file that was displayed in the lower left corner of the iPhoto window. Is there any way to get this type of information in iP

  • Dynamically pass the date to all the programs in a chain

    Hi, I have a requirement to pass the date to all the programs in the chain. The first step when the chain starts should be to calculate the next batch date from a oracle table, and then pass that date as an argument to all the programs. For example,

  • How to give amadmin the role:Top-level Admin Role?

    hi, To the user amAdmin , i cancel the role:Top-level Admin Role,as a result, amadmin becomes a common user without the priveleges such as creating users!how to restore the role for amAdmin?thanks in advace

  • HOW MANUALLY OFFSET PARTIAL PAYMENT

    Hi Gurus Please provide a step by step guide to offset partial payments against Invoices. Full posints will be assigned Thank you KP

  • Block plant for all postings permenantly

    Dear All, We have created new plant & business area.Henceforth, I want that all postings be made through this plant only & no posting should be allowed to be carried out in old plant.(Posting like creating sales order, PR,PO,MIGO etc.). Since I want