PDF attachment not proper in Mail

Hi All,
We are facing a problem with PDF attachment through workflows.
We are using CONVERT_ABAPSPOOLJOB_2_PDF to convert SPOOL to PDF and are getting binary file into it_xstring, pdf file into it_pdf. Now we are sending it_xstring to SAP_WAPI_ATTACHMENT_ADD for mail attachment. We are getting the PDF attachment, but the data is not fitting exactly onto the page. In other words, the entire data is being shown only in half of the page which in turn made the font size very small. But when we tried saving the PDF file it_pdf onto a local file through GUI_DOWNLOAD, it's giving the data correctly, as in, the output is being exactly fit into the page.
Can we stretch the output in XSTIRNG (binaryfile)? Is there any way to show the output data properly in PDF attachment?
Thanks a lot!!

Does the FM "CONVERT_ABAPSPOOLJOB_2_PDF" return string ?
The data that the FM returns if of the type "TLINE".
Convert the it_pdf using the below:
CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
    EXPORTING
         LINE_WIDTH_SRC              = 134
         LINE_WIDTH_DST              = 255
     TABLES
          CONTENT_IN                  = PDF_FILE
          CONTENT_OUT                 = PDF_FILE_OUT
     EXCEPTIONS
          ERR_LINE_WIDTH_SRC_TOO_LONG = 1
          ERR_LINE_WIDTH_DST_TOO_LONG = 2
          ERR_CONV_FAILED             = 3
          OTHERS                      = 4.
Use the method which suits you in the class "CL_BCS_CONVERT" and convert into XSTRING and pass it to the FM "SAP_WAPI_ATTACHMENT_ADD".
Regards,
PR.

Similar Messages

  • How Do I Open a PDF attachment in IOS 8 mail app?

    Hi all,
    I am curious how do I open a pdf attachment in IOS 8 mail app?

    Hi,
    My friend has what you stated = a square with and arrow coming out the top and works as expected
    BUT I don't
    what happens to me - is the small muti page opens and does NOT show a pdf ICON - BUT DOES show only the first page and I DO NOT GET = a square with and arrow coming out the top TO CLICK ON!
    So it seems the normal behavior is not happening - how can I fix this - to see ALL pages and or open pdf in another pdf app?

  • Cannot open pdf attachment in my e-mail

    Cannot open pdf attachment in my e-mail                 I can open pdf files on the hard drive
    I am using Windows Internet Explorer 9, Microsoft Vista
    When I receive an e-mail with a pdf attachment a box pops up
    What do you want to do with
    get attachment __ aspx ? file =
    size: 3.11 kb
    from: blu166.mail.live.com
    open
    the file won't be saved automatically
    save
    save as
    cancel
    Your help will be appreciated

    Hi Pat
    Microsoft upgraded Hotmail e-mail accounts to Outlook.com
    The Print Screen key has no function.....when the 2 boxes mentioned above appear on the monitor (which I have detailed) they require action or I cannot proceed to another screen or function.
    Maybe my problem should also be sent to Microsoft Customer Service...your thoughts.
    I note there has been 106 views hard to believe that no one else has had this problem.
    Appreciate your time

  • 2 PDF attachment in a single mail

    Hi All ,
      Have any body seen the functionality of sending 2 PDF attachment in a mail .
    If yes please provide some pointers .
    Regards
    Saurabh Garg

    Hi,
    I have develop this code to send multiple HTML attachments using CL_BCS class
    Form f_send_html_mail.
      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: recipient          type ref to if_recipient_bcs.
      data: exception_info     type ref to if_os_exception_info,
      bcs_exception            type ref to cx_document_bcs.
      data i_attachment_size type sood-objlen.
      data v_status          type bcs_stml.
      data v_request_status  type bcs_rqst.
      data : v_desc like sopcklsti1-obj_descr.
          concatenate 'Doc-' pdocno into v_desc.
          condense v_desc no-gaps.
          submit yttcr0001 exporting list to memory
                   with p_docno = pdocno
                   and return.
        call function 'LIST_FROM_MEMORY'
          tables
            listobject = report_list
          exceptions
            not_found  = 1
            others     = 2.
        call function 'WWW_HTML_FROM_LISTOBJECT'
          exporting
            template_name = 'WEBREPORTING_REPORT'
          tables
            html          = report_html
            listobject    = report_list.
        describe table objbin lines tab_lines.
        v_lines = tab_lines + 1.
        loop at report_html.
          move report_html to it_attach1.
          append it_attach1.
        endloop.
      send_request = cl_bcs=>create_persistent( ).
      try.
          document = cl_document_bcs=>create_document(
                                        i_type    = 'RAW'
                                        i_text = it_content[]
                                        i_subject = subject ).
          if not attach_name1 is initial.
            call method document->add_attachment
              exporting
                i_attachment_type    = attach_ext1
                i_attachment_subject = attach_name1
                i_att_content_text   = it_attach1[].
          endif.
         "<<< if you want multiple attachment then use this
          if not attach_name2 is initial.
            call method document->add_attachment
              exporting
                i_attachment_type    = attach_ext2
                i_attachment_subject = attach_name2
                i_att_content_text   = it_attach2[].
          endif.
          call method send_request->set_document( document ).
          sender = cl_sapuser_bcs=>create( sy-uname ).
          call method send_request->set_sender
            exporting
              i_sender = sender.
          loop at it_recipient.
            translate it_recipient-smtp_addr to lower case.
            recipient = cl_cam_address_bcs=>create_internet_address( it_recipient-smtp_addr ).
            call method send_request->add_recipient
              exporting
                i_recipient  = recipient
                i_express    = ' '
                i_copy       = ' '
                i_blind_copy = ' '
                i_no_forward = ' '.
          endloop.
          move : 'E' to v_request_status.
          v_status = v_request_status.
          call method send_request->set_status_attributes
            exporting
              i_requested_status = v_request_status
              i_status_mail      = v_status.
          call method send_request->send( ).
          commit work.
        catch cx_document_bcs into bcs_exception.
      endtry.
    endform.                               

  • PDF Attachment not able to view

    Dear Guys,
    I am not able to view the PDF attachment in SAP Office. I am getting error as 'Database error for <GET DATA FROM KPRO> <>' which is information message. When I click OK it display another error message 'Windows cannot find 'c:\winnt\desktop\<filename>'. I guess the PDF file is uploaded in worng directory. Is it anyway to find out at which directory the attachement of the mail are actualy stored.
    Could anybody help to sort this issue ?
    Regards
    Nilesh Shete

    HI,
    May i know which Function Module you have used and how you have configured?
    Thanks!
    Brunda
    'Reward if useful'.

  • Email PDF attachment not opening error

    Hi All,
    I am sending the PDF attachment through email when i get the mail and opening the attachment the PDF says "A drawing error occurred'. Can any one tell me how to solve this problem.
    i am doing otf to pdf conversion and the populate all the field related to the email.
    Is there any specific solution for this error.
    Regards,
    Lakshmikanth

    Hi All,
    I am sending the PDF attachment through email when i get the mail and opening the attachment the PDF says "A drawing error occurred'. Can any one tell me how to solve this problem.
    i am doing otf to pdf conversion and the populate all the field related to the email.
    Is there any specific solution for this error.
    Regards,
    Lakshmikanth

  • External Send PO as email with PDF attachment not working

    hi,
    we are using ECC6, and in txn NACT, Processing routine we can use Sapscript External send > SAPFM06P > ENTRY_NEU > MEDRUCK > PDF and in MN04/5 i create Output record, and in SCOT my PO is ready for transmission from either ME21N/2 and ME9F - works well - email sent with pdf PO attached.
    <b>HOWEVER,</b> we have just created a SMARTFORM PO, and with similar settings, i cannot create External send OUTPUT!!! (Output failed in ME9F/ME23N) NACT settings External Send > /SMB40/FM06P > Z_MMPO_A > PDF
    In SCOT > SMTP > Internet X > Sapscript/SmartForm = PDF.
    Does special code need to be entered into Smartform to generate PDF email similar to Sapscript? Any code would be appreciated.
    regards Adam

    Hi,
    You need to build a code to create the Spool OTF output into PDF.
    This can be done in Print program, which converts the spool into PDF & sends a mail with PDF attachment.
    Please refer this sample program:
    http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
    Best regards,
    Prashant

  • PDF attachment not getting sent via email. This occurs intermittently.

    Hi All,
    There is a concurrent program which sends report on Purchase Orders. The report is sent as a PDF attachment via email.
    The report is getting attached sometimes and not getting attached sometimes giving an empty email. Checked the log files and output files of the program and couldnt find any issue. There is no specific time/PO/vendor pattern wherein the program fails.
    Please let me know what needs to be done to get this resolved.
    Regards,
    Radhika.

    Hi,
    I am facing this issue with Oracle 11i - US Purchasing SuperUser responsiblity.
    There is a concurrent program which generates a report and then sends the report to printer. The report is not getting stored in a temp file in any directory. It is directly emailed as a PDF attachment.
    Sometimes the attachment is getting sent while sometimes it is not getting attached.
    Please let me know if any other information is required.
    Regards,
    Radhika.

  • Why don't PDF attachments not visible in mail.

    Mail is not displaying PDF's that are attached in the body of the email.  We have been dragging and dropping pdf and jpeg images into emails for years. The images are visible
    in the anders email but not to the receiver.  What changed?  Why are they not visible. We shouldn't have to down load or use quick view to see them.  The image files are under 1 mb.

    Hi,
    Similar problem here with me.
    Also this thread - http://discussions.apple.com/thread.jspa?threadID=1997630
    Hopefully we can find a solution.
    I've rebuilt mailboxes and re-added accounts to no avail.
    Attachments are working fine in the web interface but when syched with IMAP to Mail - no worky.
    I get a winmail.dat file instead.
    Cheers

  • Mail/Gmail/PDF attachments not shown in mail.

    I currently use apple mail to access my gmail emails however every so often I notice that some of the emails that mail picks up from gmail do not contain attachments (.pdf) that are visible when I log into gmail. Any suggestions as to how I can make them appear in mail? It is often very irritating.
    Mail version 3.5.

    Hi,
    Similar problem here with me.
    Also this thread - http://discussions.apple.com/thread.jspa?threadID=1997630
    Hopefully we can find a solution.
    I've rebuilt mailboxes and re-added accounts to no avail.
    Attachments are working fine in the web interface but when syched with IMAP to Mail - no worky.
    I get a winmail.dat file instead.
    Cheers

  • Sapscript/Smartform via mail with PDF attachment: logo is missing

    Hi all
    I'm implementing my function to send Sapscript/smartform via mail.
    I need to do it because when a message needs to be sent, I have to insert the message as attachment but also to add a text in the body mail.
    So I've just created a simple sapscript having a logo (as graphic) and a little text.
    I use the fm CONVERT_OTF to convert the OTF to PDF format and the following code to increase the pdf string from 132 to 255 char:
    LOOP AT t_pdf.
          TRANSLATE t_pdf USING ' ~'.
          CONCATENATE l_buffer t_pdf INTO l_buffer.
        ENDLOOP.
        TRANSLATE l_buffer USING '~ '.
        DO.
          MOVE l_buffer TO l_attachment.
          APPEND l_attachment TO x_attachment.
          SHIFT l_buffer LEFT BY 255 PLACES.
          IF l_buffer IS INITIAL.
            EXIT.
          ENDIF.
        ENDDO.
    All seem to work fine, but as soon as I open the pdf file attached to the mail I can't see the logo
    So after calling fm CONVERT_OTF, I've created a pdf file by method GUI_DOWNLOAD, and then upload this file (by GUI_UPLOAD) into internal table for attachment and send the mail.
    Now really all work very fine, becaus I can see the logo
    Of course I don't want to dowload the file before sending a mail, but I need to send my print directly as pdf attachment
    The two ways seem to be equal, they use the same print and the same functions, only the way to upload the internal table for attachment is different:
    1) tha abap code above to expand the line from 132 to 255
    2) the method GUI_UPLOAD
    So something seems to be wrong in the first way because ithe logo is missing in the pdf attachment generated for the mail
    Max

    Hi
    I'm not working on unicode system, anyway I didn't see that parameter BIN_FILE, so I didn't use it
    I've read the note 1324547 and I've done just as it explaines: now works fine
    I don't know why it doesn't work with old manner (i.e data is treated as character-type), but it worls with the new one (If the data is treated as xstring-type)
    I can only suppose the data are corrupted while being elaborated for expand to 255 char....but I don't why
    Anyway your suggestion works for me
    Thank
    Max

  • Can't open .pdf attachment to e-mail

    After straightening out the conflict between Reader & Acrobat (deleted Reader per suggestion on this forum), I now have a new problem.  When I double click a .pdf attachment to an e-mail (I use Thunderbird), I get the following message:
    "C:\DOCUME~1\HP_ADM~1\LOCALS~1\Temp\ADOBE.pdf could not be opened because the associated helper application does not exist. Change the association in your preferences."
    I went to Preferences of Acrobat 9 std but couldn't find anything that seemed to relate to a helper application.
    Any suggestions?
    Thanks.

    Turns out I found a note from Mozilla when this was a problem with
    reader that said to simply delete that preference for acrobat.  Then,
    when I click to open the .pdf file, Thunderbird asks me if I want to use
    Acrobat 9.1 and has a box to click to enable this to occur every time.
    It worked.
    If anyone else encounters this, here's the website containing the
    solution for both Firefox & Thunderbird.
    http://kb.mozillazine.org/The_associated_helper_application_does_not_exist
    Cheers,
    Keith

  • Sending mails from sap to outlook with pdf attachment

    Hi All
    I am using the function module 'SO_NEW_DOCUMENT_ATT_SEND_API1' to send
    mail with the pdf attachment to a SMTP mail id(outlook). I have done all the configuration settings in SCOT transaction. But still i am not able to get the mail in my outlook mailbox. Following are the details of the steps i have followed.
    step1.
    Get the OTF data output from the SMARTFORMS function module.
    step2,
    convert the OTF output data to PDF format.
    step3.
    populate all the required table to pass data to the function
    module 'SO_NEW_DOCUMENT_ATT_SEND_API1' -
                packing_list              
                contents_bin              
                contents_txt              
                receivers 
    and call the function module.
    After doing the above steps still i am not able to get the mail in my outlook mailbox. Please Help.
    Thanks
    Jitendra Kumar Tripathy.

    hi,
    kindly chk the code i wrote for my program.
    it will  solve ur issue.
    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           = 'ZZZ_TEST1'
         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.
      Fehlerhandling
      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
    wa_doc_chng-doc_size = ( v_lines_txt - 1 ) * 255 + strlen( i_objtxt )
      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.
    Länge des Attachment ermitteln
      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'
             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 helped rwrd points
    anver

  • How do I send a adobe pdf attachment to a flash drive from e-mail account?

    How do I send a pdf attachment from my e-mail to a flash drive?
    Thank you for your assisttance.

    In the email client save the attachment to the flash drive.

  • Outlook2013 email message goes behind main Outlook window when opening PDF attachment with Reader 11

    Problem statement: Outlook 2013 email message goes behind main Outlook window when opening PDF attachment with Adobe Reader 11.0.3
    Environment: Windows 8 x64; Office 2013; Adobe Reader 11.0.3
    Steps to reproduce bug:
    1. Open Outlook 2013
    2. Open email message with PDF attachment
    3. Open PDF attachment (with Adobe Reader as default PDF viewer)
    4. Close Adobe Reader
    Results: Original email message with PDF attacment now sits behind the main Outlook window
    Expected results: Original email message should be on top of main Outlook window as it was when opening the PDF attachment
    Note: Adobe Acrobat Profession performs as expected - the original email is on top of the main Outlook window - This only seems to be a problem with Adobe Reader.
    Has anyone else experience this problem?  If so, have you found a work-around?
    Thanks,
    Mike

    From: new window opens behind existing window - how to modify?
    I had this problem happening in Outlook.
    If I tried to open an email, it would open behind the main Outlook window.
    The same happened if I opened a link in the email - it would open behind the mail.
    The fix that was suggested to me was so simple that I still don't believe it.
    Right click on the task bar and unlock the taskbar, then lock it again.
    Close down Outlook and re-start it.
    Problem solved! Just dont know how  or why.
    Proposed as answer byalfreelandTuesday, January 08, 2013 4:52 PM
    It worked for me with Win 7 and OL 2003. Why? Who cares ... It is working.
    Liviu 2014-09-17

Maybe you are looking for

  • Error: Message no. BUPA_DIALOG_JOEL126

    Hi experts, I am a new person in Treasury I am facing with the problem when I create a Loan Contract Area General Data contains errors Message no. BUPA_DIALOG_JOEL126 Please help me fix it Thank you very much Ms. Minh

  • Macbook pro flashing question mark folder, won't recognize hard drive

    My 2010 macbook pro froze and after restarting I was greeted with a flashing question mark folder. I then restarted again and held down "option" key and went into Mac OS X utilities then into disk utilities. In disk utilities, my only drive options a

  • Elemnts 12: Says I am not connected to Internet!

    When installed and I want to use the edit function - asked for registration - I click "sign in" - Getting message: I have to be connected to internet! So E12 does not register that my PC is connected to internet. What do I do? I have disabled my regu

  • Importing the word document in RoboHelp

    Hi, I am importing a word document into Robohelp 7 HTML. But after the import is completed, the entire word document is converted into a single HTML page. My requirement is that each chapter should be created into seperate HTML file based on the head

  • Why is there no option to "hide sensitive notifications" on my phone?

    Why is there no option to "hide sensitive notifications" on my phone? (LG G3) I just updated to Lollipop, and it now it shows all my emails and texts on the lock screen which is not cool. When I tried to search for a fix, I found that you need to cho