<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: problem opening attached pdf file in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-opening-attached-pdf-file/m-p/4409565#M1047856</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am also facing the same problem ...any answers ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Nov 2008 14:57:24 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-11-25T14:57:24Z</dc:date>
    <item>
      <title>problem opening attached pdf file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-opening-attached-pdf-file/m-p/4409560#M1047851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;I'm trying to open a pdf file attached in a mail, but when i try to open it adobe acrobat gives me this error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adobe Reader could not open &amp;lt;doc1.pdf&amp;gt; because it is either not a supported file type or the file has been damaged (for eg:it was sent as an email attachment and wasn't correctly decoded.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've read many posts related to this problem but i haven't found the solution yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me?&lt;/P&gt;&lt;P&gt;Thanx!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Sep 2008 15:14:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-opening-attached-pdf-file/m-p/4409560#M1047851</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-08T15:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: problem opening attached pdf file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-opening-attached-pdf-file/m-p/4409561#M1047852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you show how did you create the pdf as attachment.&lt;/P&gt;&lt;P&gt;Did you fill the lenght of the attachment correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Dieter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Sep 2008 15:32:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-opening-attached-pdf-file/m-p/4409561#M1047852</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-08T15:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: problem opening attached pdf file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-opening-attached-pdf-file/m-p/4409562#M1047853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dieter,&lt;/P&gt;&lt;P&gt;Here is the code,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;doc_chng-obj_name = 'Nomina'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;doc_chng-obj_descr = 'Nomina de empleado'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;objtxt = '&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;Reserve price : &amp;lt;b&amp;gt;$250000&amp;lt;/b&amp;gt;'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND objtxt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;objtxt = 'A reproduction of the painting to be auctioned'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND objtxt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;objtxt = 'is enclosed as an attachment.&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND objtxt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DESCRIBE TABLE objtxt LINES tab_lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE objtxt INDEX tab_lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Creating the entry for the compressed document&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR objpack-transf_bin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;objpack-head_start = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;objpack-head_num   = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;objpack-body_start = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;objpack-body_num   = tab_lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;objpack-doc_type   = 'PDF'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND objpack.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Crecion de attachments&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;(Assume the data in OBJBIN are given in PDF format)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DESCRIBE TABLE data_tab LINES tab_lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;objhead = 'nomina.pdf'. APPEND objhead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Creating the entry for the compressed attachment&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;objpack-transf_bin = 'X'.&lt;/P&gt;&lt;P&gt;objpack-head_start = 1.&lt;/P&gt;&lt;P&gt;objpack-head_num   = 1.&lt;/P&gt;&lt;P&gt;objpack-body_start = 1.&lt;/P&gt;&lt;P&gt;objpack-body_num   = tab_lines.&lt;/P&gt;&lt;P&gt;objpack-doc_type   = 'PDF'.&lt;/P&gt;&lt;P&gt;objpack-obj_name   = 'ATTACHMENT'.&lt;/P&gt;&lt;P&gt;objpack-obj_descr = 'Nomina Empleado'.&lt;/P&gt;&lt;P&gt;objpack-doc_size   = tab_lines * 255.&lt;/P&gt;&lt;P&gt;APPEND objpack.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Entering names in the distribution list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reclist-receiver = 'kkkkkkkkk'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reclist-rec_type = 'U'.&lt;/P&gt;&lt;P&gt;append reclist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sending the document&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    document_data              = doc_chng&lt;/P&gt;&lt;P&gt;    put_in_outbox              = 'X'&lt;/P&gt;&lt;P&gt;    commit_work                = 'X'&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    packing_list               = objpack&lt;/P&gt;&lt;P&gt;    object_header              = objhead&lt;/P&gt;&lt;P&gt;    contents_bin               = objbin&lt;/P&gt;&lt;P&gt;    contents_txt               = objtxt&lt;/P&gt;&lt;P&gt;    receivers                  = reclist&lt;/P&gt;&lt;P&gt;  EXCEPTIONS&lt;/P&gt;&lt;P&gt;    too_many_receivers         = 1&lt;/P&gt;&lt;P&gt;    document_not_sent          = 2&lt;/P&gt;&lt;P&gt;    operation_no_authorization = 4&lt;/P&gt;&lt;P&gt;    OTHERS                     = 99.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Sep 2008 15:47:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-opening-attached-pdf-file/m-p/4409562#M1047853</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-08T15:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: problem opening attached pdf file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-opening-attached-pdf-file/m-p/4409563#M1047854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a simillar thread posted ,gothrough the below thread you will  find the solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.sdn.sap.com/click.jspa?searchID=16029226&amp;amp;messageID=3918233" target="test_blank"&gt;https://forums.sdn.sap.com/click.jspa?searchID=16029226&amp;amp;messageID=3918233&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best WIshes,&lt;/P&gt;&lt;P&gt;Raj.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Sep 2008 15:51:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-opening-attached-pdf-file/m-p/4409563#M1047854</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-08T15:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: problem opening attached pdf file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-opening-attached-pdf-file/m-p/4409564#M1047855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raja,&lt;/P&gt;&lt;P&gt;I've tried to do the same as the code you post me in the link but i still have the same problem.&lt;/P&gt;&lt;P&gt;Thanx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2008 16:30:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-opening-attached-pdf-file/m-p/4409564#M1047855</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-11T16:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: problem opening attached pdf file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-opening-attached-pdf-file/m-p/4409565#M1047856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am also facing the same problem ...any answers ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Nov 2008 14:57:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-opening-attached-pdf-file/m-p/4409565#M1047856</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-25T14:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: problem opening attached pdf file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-opening-attached-pdf-file/m-p/4409566#M1047857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody, finally i was able to solve my problem. here is the source code.&lt;/P&gt;&lt;P&gt;bye&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
call function fm_name
  EXPORTING
    /1bcdwb/docparams  = fp_docparams
    param              = wa_form1
    param1             = wa_form1_mes
    iv_image_url       = gv_image_url
  IMPORTING
    /1BCDWB/FORMOUTPUT = fp_result
  EXCEPTIONS
    usage_error        = 1
    system_error       = 2
    internal_error     = 3
    others             = 4.


call function 'FP_JOB_CLOSE'
  EXCEPTIONS
    usage_error    = 1
    system_error   = 2
    internal_error = 3
    others         = 4.

data: pdf type fpformoutput-pdf.
pdf = fp_result-pdf.


data: bcs_exception type ref to cx_bcs.
try.

  l_subject = 'Ikastaroen finantzaketa'.
  concatenate 'XXXXXXXXXXXXXXXXXX'
  'YYYYYYYYYYYYYYYYY'
  into l_bodytext_row.
  append l_bodytext_row to lt_bodytext.


* Create the email document object
  data: document TYPE REF TO cl_document_bcs,
  num_rows type i,
  textlength type so_obj_len.
  describe table lt_bodytext lines num_rows.
  num_rows = num_rows * 255.
  move num_rows to textlength.
  document = cl_document_bcs=&amp;gt;create_document(
    i_type = 'RAW'
    i_text = lt_bodytext
    i_length = textlength
    i_subject = l_subject ).


*   Add attachment
  data: attdoctype type soodk-objtp,
  atttitle type SOOD-OBJDES,
  attsize type SOOD-OBJLEN,
  pdftab type SOLIX_TAB.
  attdoctype = 'pdf'.
  atttitle = 'XXXXX'.
  attsize = xstrlen( pdf ).
  pdftab = cl_document_bcs=&amp;gt;xstring_to_solix(
  ip_xstring = pdf ).
  document-&amp;gt;add_attachment( exporting I_ATTACHMENT_TYPE = attdoctype
    I_ATTACHMENT_SUBJECT = atttitle
    I_ATTACHMENT_SIZE = attsize
    I_ATTACHMENT_LANGUAGE = sy-langu
    I_ATT_CONTENT_HEX = pdftab ).

*   Create persistent send request
    data:send_request TYPE REF TO cl_bcs.
    send_request = cl_bcs=&amp;gt;create_persistent( ).
*    Add document to send_request.
    send_request-&amp;gt;set_document( document ).

* Create sender
DATA:
  lo_sender TYPE REF TO if_sender_bcs VALUE IS INITIAL,
  l_send type ADR6-SMTP_ADDR value 'email address'.
  lo_sender = cl_cam_address_bcs=&amp;gt;create_internet_address( l_send ).
* Set sender
  send_request-&amp;gt;set_sender(
    EXPORTING
  i_sender = lo_sender ).

  p_email = 'XXXXXXXX'.

*   Create recipient.
* Create recipient.
data: recipient TYPE REF TO if_recipient_bcs.
      recipient = cl_cam_address_bcs=&amp;gt;create_internet_address( p_email ).
  send_request-&amp;gt;add_recipient(
    EXPORTING
      i_recipient = recipient
      i_express = 'X' ).

*   Set send immediately
    send_request-&amp;gt;set_send_immediately( 'X' ).
*   Send document
    send_request-&amp;gt;send( ).
    COMMIT WORK.
message 'E-Maila bidalia izan da' type 'I'.
catch cx_bcs into bcs_exception.
  data: ex_msg type string.
  ex_msg = bcs_exception-&amp;gt;get_text( ).
  write: 'Caught exception.', ex_msg.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Jon Azkorra Olano on May 21, 2010 1:25 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Jon Azkorra Olano on May 21, 2010 1:26 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Nov 2008 15:20:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-opening-attached-pdf-file/m-p/4409566#M1047857</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-25T15:20:08Z</dc:date>
    </item>
  </channel>
</rss>

