<div dir="ltr">Hi Ali,<br>  Thanks for your reply. I have a doubt on your approach. Before calling CL_FITV_GOS=&gt;GET_LINKS  i think we should use CL_FITV_GOS=&gt;SAVE to save the pdf document(attachment) to GOS and then used GET_LINKS method to get the key of the attachment. Correct me if I am wrong.<br>

<br>Regards<br>Ibrahim<br><br><div class="gmail_quote">On Wed, Jan 4, 2012 at 1:49 PM, Ali Husain <span dir="ltr">&lt;<a href="mailto:mr_mago40@hotmail.com">mr_mago40@hotmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div><div dir="ltr">
<div><br></div>Hello Ibrahim,<div><br></div><div>I&#39;ve done that in a different way and it was working fine with me. After you convert to pdf, you can call the method CL_FITV_GOS=&gt;GET_LINKS and pass it your BOR object along with the keys. The sofm table reference you get back you can then perform the following: </div>

<div><br></div><div><div>LOOP AT ex_sofm INTO ls_sofm.</div><div>  CONCATENATE ls_sofm-foltp ls_sofm-folyr ls_sofm-folno</div><div>  ls_sofm-doctp ls_sofm-docyr ls_sofm-docno ls_sofm-fortp</div><div> ls_sofm-foryr ls_sofm-forno INTO lv_key RESPECTING BLANKS.</div>

<div><br></div><div>  swc_create_object lr_sofm &#39;SOFM&#39; lv_key.</div><div>  APPEND lr_sofm TO lt_sofm.</div><div>  CLEAR: ls_sofm, lv_key,lr_sofm.</div><div>ENDLOOP.</div><div><br></div><div>swc_set_table container &#39;EX_SOFM&#39; lt_sofm.</div>

</div><div><br></div><div>You can then bind lt_sofm with the attach_objects container element and the attachment should open when displaying the work item.</div><div><br></div><div>Hope this helps,</div><div>Ali</div><div>

<br></div><br><div><div></div>&gt; From: <a href="mailto:sap-wug-request@mit.edu" target="_blank">sap-wug-request@mit.edu</a><br>&gt; Subject: SAP-WUG Digest, Vol 86, Issue 3<br>&gt; To: <a href="mailto:sap-wug@mit.edu" target="_blank">sap-wug@mit.edu</a><br>

&gt; Date: Tue, 3 Jan 2012 12:13:09 -0500<br>&gt; <br>&gt; Send SAP-WUG mailing list submissions to<br>&gt;         <a href="mailto:sap-wug@mit.edu" target="_blank">sap-wug@mit.edu</a><br>&gt; <br>&gt; To subscribe or unsubscribe via the World Wide Web, visit<br>

&gt;         <a href="http://mailman.mit.edu/mailman/listinfo/sap-wug" target="_blank">http://mailman.mit.edu/mailman/listinfo/sap-wug</a><br>&gt; or, via email, send a message with subject or body &#39;help&#39; to<br>&gt;         <a href="mailto:sap-wug-request@mit.edu" target="_blank">sap-wug-request@mit.edu</a><br>

&gt; <br>&gt; You can reach the person managing the list at<br>&gt;         <a href="mailto:sap-wug-owner@mit.edu" target="_blank">sap-wug-owner@mit.edu</a><br>&gt; <br>&gt; When replying, please edit your Subject line so it is more specific<br>

&gt; than &quot;Re: Contents of SAP-WUG digest...&quot;<br>&gt; <br>&gt; <br>&gt; Today&#39;s Topics:<br>&gt; <br>&gt;    1. Issue with attaching pdf in work item (Ibrahim)<br>&gt; <br>&gt; <br>&gt; ----------------------------------------------------------------------<br>

&gt; <br>&gt; Message: 1<br>&gt; Date: Tue, 3 Jan 2012 16:06:34 +0400<br>&gt; From: Ibrahim &lt;<a href="mailto:ikhansap@gmail.com" target="_blank">ikhansap@gmail.com</a>&gt;<br>&gt; Subject: Issue with attaching pdf in work item<br>

&gt; To: &quot;SAP Workflow Users&#39; Group&quot; &lt;<a href="mailto:SAP-WUG@mit.edu" target="_blank">SAP-WUG@mit.edu</a>&gt;<br>&gt; Message-ID:<br>&gt;         &lt;<a href="mailto:CADb5asq-DCxY0HidihMp9BYmzuCb3BAF6CYJad33W25%2B2yeN-Q@mail.gmail.com" target="_blank">CADb5asq-DCxY0HidihMp9BYmzuCb3BAF6CYJad33W25+2yeN-Q@mail.gmail.com</a>&gt;<br>

&gt; Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<div class="im"><br>&gt; <br>&gt; Dear Friends,<br>&gt;   I am trying to attach Adobe form output to a work item and send it in for<br>&gt; approval. I have converted the Adobe form output to binary format inside<br>

&gt; the program and passed it to the workflow container while starting the<br>&gt; workflow and then inside the workflow i used the below method code to<br>&gt; convert the binary to xstring format and then attach it to the workitem.<br>

&gt; But when I open the attachment from business workplace I am getting an<br></div>&gt; error that &quot;*There was an error opening this document, the file is damaged<br>&gt; and could not be repaired*&quot;. I tried to debug the method and everything<div>

<div></div><div class="h5"><br>&gt; seems to be fine, even I check the Adobe output by sending it as an email<br>&gt; attachment and I am able to open the same Adobe form attachment in the<br>&gt; email. So I suspect that I am doing something wrong while converting the<br>

&gt; same in the workflow. Please advise what would be wrong with the below code.<br>&gt; <br>&gt; <br>&gt;  DATA:  wid TYPE swwwihead-wi_id,<br>&gt;             op_len TYPE wsuser-wsuserinstanceno,<br>&gt;            it_solix_tab TYPE solix-line OCCURS 0.<br>

&gt; <br>&gt;  DATA : zswr_att_header TYPE swr_att_header,<br>&gt;            zswr_att_id     TYPE swr_att_id,<br>&gt;            lo_sofm TYPE swc_object,<br>&gt;            zxstring TYPE xstring.<br>&gt; <br>&gt;  swc_get_element container &#39;WID&#39; wid.<br>

&gt;  swc_get_element container &#39;OP_LEN&#39; op_len.<br>&gt;  swc_get_table container &#39;IT_SOLIX_TAB&#39; it_solix_tab.<br>&gt; <br>&gt;  CALL FUNCTION &#39;SCMS_BINARY_TO_XSTRING&#39;<br>&gt;    EXPORTING<br>&gt;      input_length = op_len<br>

&gt;    IMPORTING<br>&gt;      buffer       = zxstring<br>&gt;    TABLES<br>&gt;      binary_tab   = it_solix_tab.<br>&gt; <br>&gt;  zswr_att_header-file_type = &#39;B&#39;.<br>&gt;  zswr_att_header-file_name = &#39;Attachment.pdf&#39;.<br>

&gt;  zswr_att_header-file_extension = &#39;PDF&#39;.<br>&gt;  zswr_att_header-language = &#39;EN&#39;.<br>&gt;  BREAK-POINT.<br>&gt;  CALL FUNCTION &#39;SAP_WAPI_ATTACHMENT_ADD&#39;<br>&gt;    EXPORTING<br>&gt;      workitem_id = wid<br>

&gt;      att_header  = zswr_att_header<br>&gt;      att_bin     = zxstring<br>&gt;   IMPORTING<br>&gt;     att_id      = zswr_att_id.<br>&gt; <br>&gt; swc_create_object lo_sofm &#39;SOFM&#39; zswr_att_id-doc_id.<br>&gt; swc_set_element container &#39;SOFM&#39; lo_sofm.<br>

</div></div>&gt; -------------- next part --------------<br>&gt; An HTML attachment was scrubbed...<br>&gt; URL: <a href="http://mailman.mit.edu/pipermail/sap-wug/attachments/20120103/40efd24a/attachment-0001.htm" target="_blank">http://mailman.mit.edu/pipermail/sap-wug/attachments/20120103/40efd24a/attachment-0001.htm</a><br>

&gt; <br>&gt; ------------------------------<br>&gt; <br>&gt; _______________________________________________<br>&gt; SAP-WUG mailing list<br>&gt; <a href="mailto:SAP-WUG@mit.edu" target="_blank">SAP-WUG@mit.edu</a><br>&gt; <a href="http://mailman.mit.edu/mailman/listinfo/sap-wug" target="_blank">http://mailman.mit.edu/mailman/listinfo/sap-wug</a><br>

&gt; <br>&gt; <br>&gt; End of SAP-WUG Digest, Vol 86, Issue 3<br>&gt; **************************************<br></div>                                               </div></div>
<br>_______________________________________________<br>
SAP-WUG mailing list<br>
<a href="mailto:SAP-WUG@mit.edu">SAP-WUG@mit.edu</a><br>
<a href="http://mailman.mit.edu/mailman/listinfo/sap-wug" target="_blank">http://mailman.mit.edu/mailman/listinfo/sap-wug</a><br>
<br></blockquote></div><br></div>