Smartform PDF email attachment problem

I am not able to see the attachment of email which is PDF format of smartform. It showing me the blank PDF page. Please check the following code and let me know where is the problem.
Thanks in stack.
CONVERT PDF FORMAT
I_OTF[] = WA_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,
WA_DOC_CHNG.
I_OBJBIN[] = I_RECORD[].
Create Message Body**** Title and Description
I_OBJTXT = 'PDF ATTACHMENT 2 !'.
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.
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 = 'HELLO NILESH'.
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'
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.

Hai
go through the following code
REPORT ZRICH_0003.
DATA: ITCPO LIKE ITCPO,
      TAB_LINES LIKE SY-TABIX.
Variables for EMAIL functionality
DATA: MAILDATA   LIKE SODOCCHGI1.
DATA: MAILPACK   LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE.
DATA: MAILHEAD   LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE.
DATA: MAILBIN    LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: MAILTXT    LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: MAILREC    LIKE SOMLREC90 OCCURS 0  WITH HEADER LINE.
DATA: SOLISTI1   LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE.
PERFORM SEND_FORM_VIA_EMAIL.
      FORM  SEND_FORM_VIA_EMAIL                                      *
FORM  SEND_FORM_VIA_EMAIL.
  CLEAR:    MAILDATA, MAILTXT, MAILBIN, MAILPACK, MAILHEAD, MAILREC.
  REFRESH:  MAILTXT, MAILBIN, MAILPACK, MAILHEAD, MAILREC.
Creation of the document to be sent File Name
  MAILDATA-OBJ_NAME = 'TEST'.
Mail Subject
  MAILDATA-OBJ_DESCR = 'Subject'.
Mail Contents
  MAILTXT-LINE = 'Here is your file'.
  APPEND MAILTXT.
Prepare Packing List
  PERFORM PREPARE_PACKING_LIST.
Set recipient - email address here!!!
  MAILREC-RECEIVER = '[email protected]'.
  MAILREC-REC_TYPE  = 'U'.
  APPEND MAILREC.
Sending the document
  CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
       EXPORTING
            DOCUMENT_DATA              = MAILDATA
            PUT_IN_OUTBOX              = ' '
       TABLES
            PACKING_LIST               = MAILPACK
            OBJECT_HEADER              = MAILHEAD
            CONTENTS_BIN               = MAILBIN
            CONTENTS_TXT               = MAILTXT
            RECEIVERS                  = MAILREC
       EXCEPTIONS
            TOO_MANY_RECEIVERS         = 1
            DOCUMENT_NOT_SENT          = 2
            OPERATION_NO_AUTHORIZATION = 4
            OTHERS                     = 99.
ENDFORM.
     Form  PREPARE_PACKING_LIST
FORM PREPARE_PACKING_LIST.
  CLEAR:    MAILPACK, MAILBIN, MAILHEAD.
  REFRESH:  MAILPACK, MAILBIN, MAILHEAD.
  DESCRIBE TABLE MAILTXT LINES TAB_LINES.
  READ TABLE MAILTXT INDEX TAB_LINES.
  MAILDATA-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( MAILTXT ).
Creation of the entry for the compressed document
  CLEAR MAILPACK-TRANSF_BIN.
  MAILPACK-HEAD_START = 1.
  MAILPACK-HEAD_NUM = 0.
  MAILPACK-BODY_START = 1.
  MAILPACK-BODY_NUM = TAB_LINES.
  MAILPACK-DOC_TYPE = 'RAW'.
  APPEND MAILPACK.
Creation of the document attachment
This form gets the OTF code from the SAPscript form.
If you already have your OTF code, I believe that you may
be able to skip this form.  just do the following code, looping thru
your SOLISTI1 and updating MAILBIN.
  PERFORM GET_OTF_CODE.
  LOOP AT SOLISTI1.
    MOVE-CORRESPONDING SOLISTI1 TO MAILBIN.
    APPEND MAILBIN.
  ENDLOOP.
  DESCRIBE TABLE MAILBIN LINES TAB_LINES.
  MAILHEAD = 'TEST.OTF'.
  APPEND MAILHEAD.
Creation of the entry for the compressed attachment
  MAILPACK-TRANSF_BIN = 'X'.
  MAILPACK-HEAD_START = 1.
  MAILPACK-HEAD_NUM = 1.
  MAILPACK-BODY_START = 1.
  MAILPACK-BODY_NUM = TAB_LINES.
  MAILPACK-DOC_TYPE = 'OTF'.
  MAILPACK-OBJ_NAME = 'TEST'.
  MAILPACK-OBJ_DESCR = 'Subject'.
  MAILPACK-DOC_SIZE = TAB_LINES * 255.
  APPEND MAILPACK.
ENDFORM.
     Form  GET_OTF_CODE
FORM  GET_OTF_CODE.
  DATA: BEGIN OF OTF OCCURS 0.
          INCLUDE STRUCTURE ITCOO .
  DATA: END OF OTF.
  DATA: ITCPO LIKE ITCPO.
  DATA: ITCPP LIKE ITCPP.
  CLEAR ITCPO.
  ITCPO-TDGETOTF = 'X'.
Start writing OTF code
  CALL FUNCTION 'OPEN_FORM'
       EXPORTING
            FORM     = 'ZTEST_FORM'
            LANGUAGE = SY-LANGU
            OPTIONS  = ITCPO
            DIALOG   = ' '
       EXCEPTIONS
            OTHERS   = 1.
  CALL FUNCTION 'START_FORM'
       EXCEPTIONS
            ERROR_MESSAGE = 01
            OTHERS        = 02.
  CALL FUNCTION 'WRITE_FORM'
       EXPORTING
            WINDOW        = 'MAIN'
       EXCEPTIONS
            ERROR_MESSAGE = 01
            OTHERS        = 02.
Close up Form and get OTF code
  CALL FUNCTION 'END_FORM'
       EXCEPTIONS
            ERROR_MESSAGE = 01
            OTHERS        = 02.
  MOVE-CORRESPONDING ITCPO TO ITCPP.
  CALL FUNCTION 'CLOSE_FORM'
       IMPORTING
            RESULT  = ITCPP
       TABLES
            OTFDATA = OTF
       EXCEPTIONS
            OTHERS  = 1.
Move OTF code to structure SOLI form email
  CLEAR SOLISTI1. REFRESH SOLISTI1.
  LOOP AT OTF.
    SOLISTI1-LINE = OTF.
    APPEND SOLISTI1.
  ENDLOOP.
ENDFORM.
Thanks & Regards
Sreenivasulu P

Similar Messages

  • New document: How to avoid known PDF email attachment problems

    Have you ever had problems with PDF attachments sent from Adobe Reader for iOS using Share > E-mail Document?
    You may find this document useful to avoid the problems.
    How to avoid known PDF email attachment problems
    Please let us know if you have encountered different types of problems with PDF attachments.  We can look for solutions or workarounds for you.

    Unfortunately, we (Adobe Reader mobile team) do not know if/when Apple will fix the attachment problems (software defects) in Apple Mail.
    In particular, the attachment problem with Microsoft Outlook (See Problem #2 in How to avoid known PDF email attachment problems) appears to be a long-standing defect that has been known for years.  However, Apple has not provided any fix for Apple Mail yet.
    Adobe Reader for iOS merely launches Apple Mail (the default mail app on iOS) to send a PDF document as an attachment.  Adobe Reader has no control over whether or not to embed a preview image of an attachment in the body of an email message, which is known to cause the problem with Microsoft Outlook (on the receiving side).  The same problem happens when you send a single-page PDF document as an attachment along with an email signature from Apple iBooks on iOS.
    For now, all iPad/iPhone users can do is to avoid the problems by using the workarounds that are described in How to avoid known PDF email attachment problems.
    When new and different problems with PDF attachments are reported by Adobe Reader for iOS users, we will update the document above.
    Sorry for the inconvenience.

  • Web OS 1.4, PDF email attachment problem

    Since 1.4 I can no longer expand/zoom in on a PDF page email attachment. I get a lot of my purchase orders by email this way and now I can no longer read them when on the road. Gee thanks PALM, you just set me back to the dark ages.
    Anyone else having this problem?
    This question was solved.
    View Solution.

    Thanks for such a speedy solution - I will scamper back into my cave now........
    Kevin

  • Problem pdf email attachment

    Hi Friends,
    I need expertise help in pdf email attachment. I have data in internal table which has to be sent as pdf mail attachment. I need help in converting the data to pdf format. After conversion I can use SO_NEW_DOCUMENT_ATT_SEND_API1 to send the mail.
    Expect earliest reply.
    Thanks,
    Nidhya

    Dear Friends,
    Thanks for your reply, but I need help in converting the data in internal table to pdf.
    Pls find my code below: With this code, I get email send with PDF attach, but the data inside the file is not in correct format.
    Pls help me to correct.
    DATA : mailrec    LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
           mailbin    LIKE solisti1 OCCURS 0 WITH HEADER LINE,
           mailbin1   LIKE solisti1 OCCURS 0 WITH HEADER LINE,
           mailtxt    LIKE solisti1 OCCURS 0 WITH HEADER LINE,
           mailhead   LIKE solisti1 OCCURS 0 WITH HEADER LINE,
           i_otf      LIKE solisti1 OCCURS 0 WITH HEADER LINE,
           i_pdf      LIKE solisti1 OCCURS 0 WITH HEADER LINE,
           mailstruc  LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
           maildata   LIKE sodocchgi1 OCCURS 0 WITH HEADER LINE.
    DATA : BEGIN OF i_sotf OCCURS 0.
           INCLUDE STRUCTURE itcoo.
    DATA : END OF i_sotf.
    DATA : i_itcpo LIKE itcpo,
           i_itcpp LIKE itcpp.
    DATA : v_tlines   TYPE i,
           v_len_in   LIKE  sood-objlen,
           v_len_out  LIKE sood-objlen.
    maildata-obj_name = 'Document'.
    maildata-obj_descr = 'Transfer Details'.
    maildata-obj_prio = 1.
    maildata-doc_size = strlen( mailtxt ).
    mailstruc-head_start = 1.
    mailstruc-head_num = 0.
    mailstruc-body_start = 1.
    mailstruc-body_num = 1.
    mailstruc-obj_name = 'transfer'.
    mailstruc-doc_type = 'RAW'.
    APPEND mailstruc.
    mailrec-receiver = '[email protected]'.
    mailrec-rec_type = 'U'.
    APPEND mailrec.
    CLEAR i_itcpo.
    i_itcpo-tdgetotf = 'X'.
    REFRESH mailbin.CLEAR mailbin.
    WRITE 'Report Title:' TO mailbin-line+3.
    WRITE sy-repid         TO mailbin-line+18.
    APPEND mailbin. CLEAR mailbin.
    WRITE  'User : ' TO mailbin-line.
    WRITE  sy-uname TO mailbin-line+11.
    APPEND mailbin. CLEAR mailbin.
    WRITE  'Date of Report : ' TO mailbin-line+3.
    WRITE sy-datum USING EDIT MASK mask MM/DD/YYYY TO mailbin-line+21.
    APPEND mailbin. CLEAR mailbin.
    WRITE  'Time of Report : ' TO mailbin-line+3.
    WRITE  sy-uzeit TO mailbin-line+21.
    APPEND mailbin. CLEAR mailbin.
    APPEND mailbin.
    WRITE  'Transfer ' to mailbin-line+3.
    APPEND mailbin. CLEAR mailbin.
    APPEND mailbin.
    WRITE  sy-uline TO mailbin-line+3.
    APPEND mailbin. CLEAR mailbin.
    LOOP AT i_disp.
    SHIFT i_disp-index LEFT DELETING LEADING '0'.
    WRITE i_disp-index TO mailbin+3.
    WRITE i_disp-pernr TO mailbin+6.
    WRITE i_disp-ename TO mailbin+16.
    WRITE i_disp-persk TO mailbin+57.
    WRITE i_disp-btrtl TO mailbin+60.
    APPEND mailbin. CLEAR mailbin.
    ENDLOOP.
    CALL FUNCTION 'SX_OBJECT_CONVERT_SCR_OTF'
      EXPORTING
        FORMAT_SRC            = 'RAW'
        FORMAT_DST            = 'OTF'
        DEVTYPE               = 'POSTSCPT'
        FUNCPARA              = ''
        LEN_IN                = v_len_in
    IMPORTING
       LEN_OUT               = v_len_out
      TABLES
        CONTENT_IN            = mailbin
        CONTENT_OUT           = mailbin1
    EXCEPTIONS
       ERR_CONV_FAILED       = 1
       OTHERS                = 2 .
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    REFRESH mailbin.
    CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'
      EXPORTING
        FORMAT_SRC            = 'OTF'
        FORMAT_DST            = 'PDF'
        DEVTYPE               = 'POSTSCPT'
      FUNCPARA              =
        LEN_IN                = v_len_in
    IMPORTING
       LEN_OUT               = v_len_out
      TABLES
        CONTENT_IN            = mailbin1
        CONTENT_OUT           = mailbin
    EXCEPTIONS
       ERR_CONV_FAILED       = 1
       OTHERS                = 2 .
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    REFRESH mailbin1.
    DESCRIBE TABLE mailbin LINES v_tlines.
    mailstruc-head_start = 1.
    mailstruc-head_num = 0.
    mailstruc-body_start = 1.
    mailstruc-body_num = v_tlines.
    mailstruc-transf_bin = 'X'.
    mailstruc-doc_type = 'PDF'.
    mailstruc-obj_name = 'Mid-month transfer'.
    mailstruc-doc_size = v_tlines * 255.
    APPEND mailstruc.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
      EXPORTING
        DOCUMENT_DATA                    = maildata
       PUT_IN_OUTBOX                    = 'X'
      TABLES
        PACKING_LIST                     = mailstruc
       OBJECT_HEADER                    = mailhead
       CONTENTS_BIN                     = mailbin
        RECEIVERS                        = mailrec
    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.
    But i dont get the result in expected format. I am not getting first 2 characers of the line. instead of report, date, time in separate line I get everything in a single line as follows :
    Report Title: ZHRPY0003
    er : VACNIDHYA Date of Report : 02.05.2007 Time of Report
    : 10:31:27 Mid-month Inter-Company Transfer
    --- 1 00002609 Carla Pineda FT
    2010
    - 1 -

  • Acrobat can not open pdf email attachment

    Acrobat 8 Professional.<br /><br />A user gets this error message when he tries to open up a pdf email attachment:<br /><br />"Acrobat could not open <File Name> because it is either not a supported file type or because the file has been corrupted (for example, it was sent as an email attachment and wasn't correctly decoded)."<br /><br />I can open up the attachment without any issues.<br /><br />Anybody else have this issue?

    Yes, Ron Green here at the NYS Insurance Department. I now have two clients and counting that have somewhat of an identical problem.
    Client #1 has Adobe 8 Professional installed on his pc which is running Widnows XP Professsional. Files are scanned using a XEROX MFP network scanner and client is able to open those scanned documents within adobe and then saves them to a network share. Problem arises whenever he attempts to attach the saved document to another application. Once he attempts viewing the scanned document at that point Adobe blows up with the same error message stating the file is corrupt.
    Client #2 has Adobe 9 Reader but is still able to follow the same network scanning scenario aforementioned but encounters the exact same problem when attempting to attach the scanned PDF documents.
    Is there any type of fix out there for this???

  • Canu2019t view Chinese characters in a PDF email attachment sent via SAP.

    Canu2019t view Chinese characters in a PDF email attachment sent via SAP.
                     When open the Chinese characters come out funny.
                     Note: The document looks okay when previewed in SAP.
    Tried the following:
    FM CONVERT_OTF_2_PDF
    CNSONG is one of our u201CSystem fontsu201D
    Attempted with both ZH(Chinese simplified) and ZF(Chinese traditional) languages
    Tried using a printer that is set up as u201CDevice Typeu201D PDF1
    Tried using a printer that is set up as u201CDevice Typeu201D ZHKPDF
    Tried passing device type as u201CCNSAPWINu201D
    The following ADODE software was loaded: Chinese simplified, Chinese traditional,
                                                                              Korean and Japanese

    Hi,
    As a try, can you check this.
    SET COUNTRY 'CN'. China country code.
    SET LOCALE LANGUAGE 'CN'.
    Thanks,
    Vinod.

  • PDF email attachment logo problem

    Hi All,
    Can any one tell me how to solve the problem with Email attachment in PDF. If i remove the logo of the client in the Smartform i am getting the Email attachment fine but when i put back the image in the smartform the PDF is giving error and not opening the attachment.
    The image is working fine in 4.6 system but the problem with ECC6.
    Regards,
    Lakshmikanth.

    Hi All,
    Can any one tell me how to solve the problem with Email attachment in PDF. If i remove the logo of the client in the Smartform i am getting the Email attachment fine but when i put back the image in the smartform the PDF is giving error and not opening the attachment.
    The image is working fine in 4.6 system but the problem with ECC6.
    Regards,
    Lakshmikanth.

  • BEx Broadcast email attachment problem with Lotus

    In our BW system, broadcasting with email have attachment problem when we look at SOST we can see email has mhtml attachment and looks fine but end-user does not get the attachment. Email server is Lotus and we think that problem is Lotus configuration related. Anyone having same problem come to a solution, help would be appreciated.
    Thanks in advance

    OK.

  • How to print a pdf email attachment in android system

    How to print a PDF email attachment

    You need
    - an application server JAVA with Adobe Document Service installed
    - you need to configure the connection between that Java instance and your ERP system
    https://www.sdn.sap.com/irj/sdn/adobe
    Markus

  • Error in SAPscript pdf email attachment

    Hi All,
             I have implemented the functionality in ABAP where I can send SAPscript output to user via pdf-email in its inbox.The functionality is working fine in Dev n Test system with no issues.As the form is moved into Prod system, the user is complaining that after opening the mail of pdf, a mail is sent to unknown, unexisting email id indicating that user opened the mail.As the email id is unexisting, the user receives back the mail of Delivery failure.
    Please help in this.Rest is working fine.

    Hi Neeraj_C ,
      I have also a same requirement . i don't know much about Script.Can you please send me the procedure how do u achieve this scenario . If u give the sample code of this scenario it will be very helpful for me.
    Thanks & Regards,
    Kumaran Duraiswamy.

  • Email Attachment Problem

    Hi Gurus!!!
    We are sending email in HTML format and has the option of attaching PDF, Excel and Text files. Now the problem occurs in attaching text file, when the email is received the contents of the email is unrecognizable. <b>It converted the format of the email to TEXT</b>. I don't know what causing this but in PDF and Excel attachments it has no problem at all. Its seems that that HTML format email doesn't recognize <b>.txt</b> attachments.  We are using class <b>CL_DOCUMENT_BCS</b> for the email. Does anyone knows how to fix this?
    Thanks and Best regards,
          JP

    I've been having the same problem attaching documents with Firefox. I finally sent a large file for free through YouSendIt.com. Take a look. It's free unless you want special services.

  • Scanned pdf email attachment - converted to text pdf - file then renamed to specific contents

    Hi All,
    Im new to the world of programming, So forgive me if this is a stupid request.
    I'm wanting to use a mail rule in outlook to call a vba script, to save all attachments from a certain email address. I have successfully done this part. Using the below code:
    Public Sub saveAttachtoDisk(itm As Outlook.MailItem)
    Dim objAtt As Outlook.Attachment
    Dim saveFolder As String
    saveFolder = "c:\temp\"
    For Each objAtt In itm.Attachments
    objAtt.SaveAsFile saveFolder & "\" & objAtt.DisplayName
    Set objAtt = Nothing
    Next
    End Sub
    Now my problem is the saved attachment is a scanned pdf (non readable). I'm wanting to convert this into a readable text pdf, then extract certain data from the now readable PDF and use this data to rename the pdf.
    Now i've done some reasearch on the subject and I believe adobe SDK has a function to allow this, I was wondering if anyone could give me any pointers or code to achieve what im trying to do here.
    Im using windows xp
    Adobe Acrobat 6.0 ( I know it's old but its the only licence we own)
    Microsoft Outlook 2007
    Any help would be GREATLY appreciated.
    Nick

    Hi Thanks for your reply, please can you confirm which version of adobe acrobat I would need that will work with outlook 2007? Also could you please supply me with pointers and/or the code to make this work with the correct version.
    Many Thanks

  • 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

  • Clarification needed regarding Smartform to email attachment.

    Hi All,
    I have tried creating PDF file and save the same on to my local drive.It worked fine and then i tried to send pdf thru e-mail. I encountered error and the changed contents_hex to contents_bin in FM SO_NEW_DOCUMENT_ATT_SEND_API1. But i didnt receive the attachment to my id. Do we need to do any system settings for this. I didnt do any cofiguration settings. Please let me know incase of anything needs to be taken care of.
    Thanks,
    Udaya.

    hi,
    chk ur code with this sample code and compare.
    REPORT y_cb_test_051 .
    DATA DECLARATION
    TYPE-POOLS: meein.
    TABLES: toa_dara,
    nast,
    tnapr,
    arc_params.
    DATA: ent_retco TYPE sy-subrc,
    ent_screen TYPE c,
    l_xkomk LIKE TABLE OF komk WITH HEADER LINE,
    xscreen. "Kz. Probeausgabe
    DATA: i_texto_cuerpo LIKE solisti1 OCCURS 0 WITH HEADER LINE.
    SELECT OPTIONS / PARAMETERS
    PARAMETERS:
    p_kappl LIKE nast-kappl OBLIGATORY DEFAULT 'EF',
    p_objky LIKE nast-objky OBLIGATORY DEFAULT '0010001125',
    p_kschl LIKE nast-kschl OBLIGATORY DEFAULT 'NEU',
    p_spras LIKE nast-spras OBLIGATORY DEFAULT 'EN',
    p_parnr LIKE nast-parnr OBLIGATORY DEFAULT '50009123',
    p_parvw LIKE nast-parvw OBLIGATORY DEFAULT 'BA',
    p_erdat LIKE nast-erdat OBLIGATORY DEFAULT '20050908',
    p_eruhr LIKE nast-eruhr OBLIGATORY DEFAULT '130105',
    p_aende LIKE nast-aende DEFAULT 'X',
    p_nacha LIKE nast-nacha DEFAULT '1',
    p_ndialo TYPE tdsfflag DEFAULT ' ',
    p_telfx LIKE nast-telfx DEFAULT '1-920-721-0284',
    p_tland LIKE nast-tland DEFAULT 'US',
    p_sform TYPE tdsfname DEFAULT 'ZMMNABPR3PFMMPO_L3' OBLIGATORY.
    *PDF TABLES
    DATA: tb_pdf LIKE tline OCCURS 0.
    DATA: tb_pdf255 TYPE so_text255 OCCURS 0.
    MAIN PROCESSING SECTION
    START-OF-SELECTION.
    SELECT SINGLE *
    INTO nast
    FROM nast
    WHERE kappl = p_kappl
    AND objky = p_objky
    AND kschl = p_kschl
    AND spras = p_spras
    AND parnr = p_parnr
    AND parvw = p_parvw
    AND erdat = p_erdat
    AND eruhr = p_eruhr.
    IF sy-subrc <> 0.
    MESSAGE s000(00) WITH 'Record in NAST not found.'.
    nast-kappl = p_kappl.
    nast-objky = p_objky.
    nast-kschl = p_kschl.
    nast-spras = p_spras.
    nast-parnr = p_parnr.
    nast-parvw = p_parvw.
    nast-erdat = p_erdat.
    nast-eruhr = p_eruhr.
    nast-nacha = p_nacha.
    nast-telfx = p_telfx.
    nast-tland = p_tland.
    ENDIF.
    nast-aende = p_aende.
    tnapr-sform = p_sform.
    PERFORM entry_neu
    USING
    ent_retco
    ent_screen.
    FORMS
    *& Form entry_neu
    text
    -->ENT_RETCO text
    -->ENT_SCREEN text
    FORM entry_neu
    USING
    ent_retco
    ent_screen.
    DATA: l_druvo LIKE t166k-druvo,
    l_nast LIKE nast,
    l_from_memory,
    l_doc TYPE meein_purchase_doc_print.
    DATA: ls_print_data_to_read TYPE lbbil_print_data_to_read.
    DATA: ls_bil_invoice TYPE lbbil_invoice.
    DATA: lf_fm_name TYPE rs38l_fnam.
    DATA: ls_control_param TYPE ssfctrlop.
    DATA: ls_composer_param TYPE ssfcompop.
    DATA: ls_recipient TYPE swotobjid.
    DATA: ls_sender TYPE swotobjid.
    DATA: lf_formname TYPE tdsfname.
    DATA: ls_addr_key LIKE addr_key.
    xscreen = ent_screen.
    clear ent_retco.
    IF nast-aende EQ space.
    l_druvo = '1'.
    ELSE.
    l_druvo = '2'.
    ENDIF.
    CALL FUNCTION 'ME_READ_PO_FOR_PRINTING'
    EXPORTING
    ix_nast = nast
    ix_screen = ent_screen
    IMPORTING
    ex_retco = ent_retco
    ex_nast = l_nast
    doc = l_doc
    CHANGING
    cx_druvo = l_druvo
    cx_from_memory = l_from_memory.
    CHECK ent_retco EQ 0.
    IF nast-adrnr IS INITIAL.
    PERFORM get_addr_key
    CHANGING ls_addr_key.
    ELSE.
    ls_addr_key = nast-adrnr.
    ENDIF.
    *Set the print Parameters
    PERFORM set_print_param USING ls_addr_key
    CHANGING ls_control_param
    ls_composer_param
    ls_recipient
    ls_sender
    ent_retco.
    *Get the Smart Form name.
    IF NOT tnapr-sform IS INITIAL.
    lf_formname = tnapr-sform.
    ELSE.
    lf_formname = tnapr-fonam.
    ENDIF.
    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'.
    DATA: l_document_output_info TYPE ssfcrespd,
    l_job_output_info TYPE ssfcrescl,
    l_job_output_options TYPE ssfcresop.
    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
    user_settings = ' '
    zxekko = l_doc-xekko
    zxpekko = l_doc-xpekko
    zxaend = l_doc-xaend
    IMPORTING
    document_output_info = l_document_output_info
    job_output_info = l_job_output_info
    job_output_options = l_job_output_options
    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_xaend = l_doc-xaend[]
    l_xkomk = l_xkomk
    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.
    BREAK-POINT.
    ENDIF.
    Converts OTF to PDF
    DATA: v_len_in TYPE i.
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
    format = 'PDF'
    max_linewidth = 132
    IMPORTING
    bin_filesize = v_len_in
    TABLES
    otf = l_job_output_info-otfdata
    lines = tb_pdf
    EXCEPTIONS
    err_max_linewidth = 0
    err_format = 1
    err_conv_not_possible = 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.
    Change the PDF format from 132 to 255.
    CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
    EXPORTING
    line_width_src =
    line_width_dst =
    transfer_bin = 'X'
    TABLES
    content_in = tb_pdf
    content_out = tb_pdf255
    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.
    DATA: lw_subject TYPE so_obj_des.
    DATA: lwa_body TYPE solisti1.
    DATA: ltb_body TYPE TABLE OF solisti1.
    DATA: lw_filename TYPE char100.
    DATA: ltb_recipients TYPE TABLE OF somlreci1.
    DATA: lwa_recipients TYPE somlreci1.
    lw_subject = 'This is the email subject'.
    lwa_body-line = 'This is the email body - Line1'.
    APPEND lwa_body TO ltb_body.
    lwa_body-line = 'This is the email body - Line2'.
    APPEND lwa_body TO ltb_body.
    lwa_body-line = 'This is the email body - Line3'.
    APPEND lwa_body TO ltb_body.
    lwa_body-line = 'This is the email body - Line4'.
    APPEND lwa_body TO ltb_body.
    lw_filename = 'Contract'.
    *RECIPIENTS
    lwa_recipients-rec_type = 'U'.
    lwa_recipients-express = 'X'.
    lwa_recipients-receiver = sy-uname.
    lwa_recipients-copy = ''.
    APPEND lwa_recipients TO ltb_recipients.
    RECIPIENTS
    lwa_recipients-rec_type = 'U'.
    lwa_recipients-express = 'X'.
    lwa_recipients-receiver = '[email protected]'.
    lwa_recipients-copy = ''.
    APPEND lwa_recipients TO ltb_recipients.
    RECIPIENTS
    lwa_recipients-rec_type = 'U'.
    lwa_recipients-express = 'X'.
    lwa_recipients-receiver = '[email protected]'.
    lwa_recipients-copy = ''.
    APPEND lwa_recipients TO ltb_recipients.
    Sends the PDF by email.
    PERFORM f_send_pdf_by_email
    TABLES
    tb_pdf255
    ltb_body
    ltb_recipients
    USING
    lw_subject
    lw_filename.
    ENDFORM. "entry_neu
    *& Form ZCA_MAIL_BIN
    text
    FORM f_send_pdf_by_email
    TABLES
    ptb_pdf255 STRUCTURE solisti1
    ptb_body STRUCTURE solisti1
    ptb_recipients STRUCTURE somlreci1
    USING
    pw_subject TYPE so_obj_des
    pw_filename TYPE char100.
    *-DATA DECLARATION----
    Variables y tablas internas.
    DATA: BEGIN OF ltb_objbin OCCURS 0.
    INCLUDE STRUCTURE solisti1.
    DATA: END OF ltb_objbin.
    DATA: lwa_doc_chng LIKE sodocchgi1,
    lw_tab_lines LIKE sy-tabix,
    ltb_objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
    ltb_objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
    *-MAIN PROCESSING SECTION----
    clear: ltb_objbin, ltb_objtxt, ltb_objpack, lwa_doc_chng.
    refresh: ltb_objbin, ltb_objtxt, ltb_objpack.
    Control Data
    lwa_doc_chng-obj_name = 'URGENT'.
    lwa_doc_chng-sensitivty = 'P'.
    lwa_doc_chng-no_change = 'X'.
    lwa_doc_chng-priority = '1'.
    lwa_doc_chng-obj_prio = '1'.
    lwa_doc_chng-obj_langu = sy-langu.
    lwa_doc_chng-no_change = 'X'.
    Email Subject
    lwa_doc_chng-obj_descr = pw_subject.
    Email Body
    ltb_objtxt[] = ptb_body[].
    CLEAR ltb_objtxt.
    DESCRIBE TABLE ltb_objtxt LINES lw_tab_lines.
    IF lw_tab_lines GT 0.
    READ TABLE ltb_objtxt INDEX lw_tab_lines.
    lwa_doc_chng-doc_size =
    ( lw_tab_lines - 1 ) * 255 + STRLEN( ltb_objtxt ).
    CLEAR ltb_objpack-transf_bin.
    ltb_objpack-body_start = 1.
    ltb_objpack-body_num = lw_tab_lines.
    ltb_objpack-doc_type = 'RAW'.
    APPEND ltb_objpack.
    ENDIF.
    Attachment
    Move the binary attachment to other internal table.
    ltb_objbin[] = ptb_pdf255[].
    ltb_objpack-transf_bin = 'X'.
    ltb_objpack-body_start = 1.
    Get the number of lines in the Attachment (PDF FILE)
    DESCRIBE TABLE ltb_objbin LINES lw_tab_lines.
    ltb_objpack-body_num = lw_tab_lines.
    ltb_objpack-doc_type = 'PDF'.
    ltb_objpack-obj_descr = pw_filename.
    ltb_objpack-obj_name = pw_filename.
    ltb_objpack-doc_size = lw_tab_lines * 255.
    APPEND ltb_objpack.
    Call the function to send the PDF file by email
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    document_data = lwa_doc_chng
    put_in_outbox = 'X'
    TABLES
    packing_list = ltb_objpack
    contents_bin = ltb_objbin
    contents_txt = ltb_objtxt
    receivers = ptb_recipients
    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.
    CASE sy-subrc.
    WHEN 0.
    WHEN 1. RAISE too_many_receivers.
    WHEN 2. RAISE document_not_sent .
    WHEN 3. RAISE document_type_not_exist.
    WHEN 4. RAISE operation_no_authorization.
    WHEN 5. RAISE parameter_error.
    WHEN 7. RAISE enqueue_error .
    WHEN OTHERS. RAISE x_error.
    ENDCASE.
    COMMIT WORK.
    ENDFORM. "ZCA_MAIL_BIN
    *& Form get_addr_key
    text
    -->P_CS_BIL_INVOICE_HD_ADR text
    <--P_CS_ADDR_KEY text
    FORM get_addr_key
    CHANGING l_addr_key LIKE addr_key.
    DATA: l_lfa1 LIKE lfa1.
    SELECT SINGLE * FROM lfa1 INTO l_lfa1
    WHERE lifnr = nast-parnr.
    IF sy-subrc = 0.
    MOVE l_lfa1-adrnr TO l_addr_key.
    ENDIF.
    ENDFORM. " get_addr_key
    *& Form set_print_param
    text
    -->P_LS_ADDR_KEY text
    <--P_LS_CONTROL_PARAM text
    <--P_LS_COMPOSER_PARAM text
    <--P_LS_RECIPIENT text
    <--P_LS_SENDER text
    <--P_CF_RETCODE text
    FORM set_print_param USING is_addr_key LIKE addr_key
    CHANGING cs_control_param TYPE ssfctrlop
    cs_composer_param TYPE ssfcompop
    cs_recipient TYPE swotobjid
    cs_sender TYPE swotobjid
    cf_retcode TYPE sy-subrc.
    DATA: ls_itcpo TYPE itcpo.
    DATA: lf_repid TYPE sy-repid.
    DATA: lf_device TYPE tddevice.
    DATA: ls_recipient TYPE swotobjid.
    DATA: ls_sender TYPE swotobjid.
    lf_repid = sy-repid.
    CALL FUNCTION 'WFMC_PREPARE_SMART_FORM'
    CALL FUNCTION 'Z_MMNA_WFMC_PREPARE_SMART_FORM'
    EXPORTING
    pi_nast = nast
    pi_addr_key = is_addr_key
    pi_repid = lf_repid
    IMPORTING
    pe_returncode = cf_retcode
    pe_itcpo = ls_itcpo
    pe_device = lf_device
    pe_recipient = cs_recipient
    pe_sender = cs_sender.
    IF cf_retcode = 0.
    MOVE-CORRESPONDING ls_itcpo TO cs_composer_param.
    cs_composer_param-tdimmed = ' '.
    cs_control_param-device = lf_device.
    cs_control_param-no_dialog = 'X'.
    cs_control_param-no_dialog = p_ndialo.
    cs_control_param-preview = xscreen.
    cs_control_param-getotf = ls_itcpo-tdgetotf.
    cs_control_param-langu = nast-spras.
    ENDIF.
    ENDFORM. "set_print_param
    rgds
    anver
    if helped rwrd points

  • Email attachment problem on iOS 5.1

    Since the update to ios 5.1 all attachments sent from my work email arrive on my iPad as Winmail.dat files.  This does not happen on my android phone (the same email has the File correctly attached and readable.  Furthermore, this problem did not exist prior to updating my iPad this weekend.

    Troubleshooting winmail.dat files: http://support.apple.com/kb/TS1506
    There are also a number of apps that support winmail.dat files

Maybe you are looking for