<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
<div><br></div>Hello Ibrahim,<div><br></div><div>I've done that in a different way and it was working fine with me. After you convert to pdf, you can call the method&nbsp;CL_FITV_GOS=&gt;GET_LINKS and pass it your BOR object along with the keys. The sofm table&nbsp;reference&nbsp;you get back you can then&nbsp;perform&nbsp;the&nbsp;following:&nbsp;</div><div><br></div><div><div>LOOP AT ex_sofm INTO ls_sofm.</div><div>&nbsp; CONCATENATE ls_sofm-foltp ls_sofm-folyr ls_sofm-folno</div><div>&nbsp; ls_sofm-doctp ls_sofm-docyr ls_sofm-docno ls_sofm-fortp</div><div>&nbsp;ls_sofm-foryr ls_sofm-forno INTO lv_key RESPECTING BLANKS.</div><div><br></div><div>&nbsp; swc_create_object lr_sofm 'SOFM' lv_key.</div><div>&nbsp; APPEND lr_sofm TO lt_sofm.</div><div>&nbsp; CLEAR: ls_sofm, lv_key,lr_sofm.</div><div>ENDLOOP.</div><div><br></div><div>swc_set_table container 'EX_SOFM' 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 id="SkyDrivePlaceholder"></div>&gt; From: sap-wug-request@mit.edu<br>&gt; Subject: SAP-WUG Digest, Vol 86, Issue 3<br>&gt; To: sap-wug@mit.edu<br>&gt; Date: Tue, 3 Jan 2012 12:13:09 -0500<br>&gt; <br>&gt; Send SAP-WUG mailing list submissions to<br>&gt;         sap-wug@mit.edu<br>&gt; <br>&gt; To subscribe or unsubscribe via the World Wide Web, visit<br>&gt;         http://mailman.mit.edu/mailman/listinfo/sap-wug<br>&gt; or, via email, send a message with subject or body 'help' to<br>&gt;         sap-wug-request@mit.edu<br>&gt; <br>&gt; You can reach the person managing the list at<br>&gt;         sap-wug-owner@mit.edu<br>&gt; <br>&gt; When replying, please edit your Subject line so it is more specific<br>&gt; than "Re: Contents of SAP-WUG digest..."<br>&gt; <br>&gt; <br>&gt; Today'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;ikhansap@gmail.com&gt;<br>&gt; Subject: Issue with attaching pdf in work item<br>&gt; To: "SAP Workflow Users' Group" &lt;SAP-WUG@mit.edu&gt;<br>&gt; Message-ID:<br>&gt;         &lt;CADb5asq-DCxY0HidihMp9BYmzuCb3BAF6CYJad33W25+2yeN-Q@mail.gmail.com&gt;<br>&gt; Content-Type: text/plain; charset="iso-8859-1"<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>&gt; error that "*There was an error opening this document, the file is damaged<br>&gt; and could not be repaired*". I tried to debug the method and everything<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 'WID' wid.<br>&gt;  swc_get_element container 'OP_LEN' op_len.<br>&gt;  swc_get_table container 'IT_SOLIX_TAB' it_solix_tab.<br>&gt; <br>&gt;  CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'<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 = 'B'.<br>&gt;  zswr_att_header-file_name = 'Attachment.pdf'.<br>&gt;  zswr_att_header-file_extension = 'PDF'.<br>&gt;  zswr_att_header-language = 'EN'.<br>&gt;  BREAK-POINT.<br>&gt;  CALL FUNCTION 'SAP_WAPI_ATTACHMENT_ADD'<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 'SOFM' zswr_att_id-doc_id.<br>&gt; swc_set_element container 'SOFM' lo_sofm.<br>&gt; -------------- next part --------------<br>&gt; An HTML attachment was scrubbed...<br>&gt; URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20120103/40efd24a/attachment-0001.htm<br>&gt; <br>&gt; ------------------------------<br>&gt; <br>&gt; _______________________________________________<br>&gt; SAP-WUG mailing list<br>&gt; SAP-WUG@mit.edu<br>&gt; http://mailman.mit.edu/mailman/listinfo/sap-wug<br>&gt; <br>&gt; <br>&gt; End of SAP-WUG Digest, Vol 86, Issue 3<br>&gt; **************************************<br></div>                                               </div></body>
</html>