<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 CL_FITV_GOS=>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 'SOFM' 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 '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>> From: sap-wug-request@mit.edu<br>> Subject: SAP-WUG Digest, Vol 86, Issue 3<br>> To: sap-wug@mit.edu<br>> Date: Tue, 3 Jan 2012 12:13:09 -0500<br>> <br>> Send SAP-WUG mailing list submissions to<br>>         sap-wug@mit.edu<br>> <br>> To subscribe or unsubscribe via the World Wide Web, visit<br>>         http://mailman.mit.edu/mailman/listinfo/sap-wug<br>> or, via email, send a message with subject or body 'help' to<br>>         sap-wug-request@mit.edu<br>> <br>> You can reach the person managing the list at<br>>         sap-wug-owner@mit.edu<br>> <br>> When replying, please edit your Subject line so it is more specific<br>> than "Re: Contents of SAP-WUG digest..."<br>> <br>> <br>> Today's Topics:<br>> <br>> 1. Issue with attaching pdf in work item (Ibrahim)<br>> <br>> <br>> ----------------------------------------------------------------------<br>> <br>> Message: 1<br>> Date: Tue, 3 Jan 2012 16:06:34 +0400<br>> From: Ibrahim <ikhansap@gmail.com><br>> Subject: Issue with attaching pdf in work item<br>> To: "SAP Workflow Users' Group" <SAP-WUG@mit.edu><br>> Message-ID:<br>>         <CADb5asq-DCxY0HidihMp9BYmzuCb3BAF6CYJad33W25+2yeN-Q@mail.gmail.com><br>> Content-Type: text/plain; charset="iso-8859-1"<br>> <br>> Dear Friends,<br>> I am trying to attach Adobe form output to a work item and send it in for<br>> approval. I have converted the Adobe form output to binary format inside<br>> the program and passed it to the workflow container while starting the<br>> workflow and then inside the workflow i used the below method code to<br>> convert the binary to xstring format and then attach it to the workitem.<br>> But when I open the attachment from business workplace I am getting an<br>> error that "*There was an error opening this document, the file is damaged<br>> and could not be repaired*". I tried to debug the method and everything<br>> seems to be fine, even I check the Adobe output by sending it as an email<br>> attachment and I am able to open the same Adobe form attachment in the<br>> email. So I suspect that I am doing something wrong while converting the<br>> same in the workflow. Please advise what would be wrong with the below code.<br>> <br>> <br>> DATA: wid TYPE swwwihead-wi_id,<br>> op_len TYPE wsuser-wsuserinstanceno,<br>> it_solix_tab TYPE solix-line OCCURS 0.<br>> <br>> DATA : zswr_att_header TYPE swr_att_header,<br>> zswr_att_id TYPE swr_att_id,<br>> lo_sofm TYPE swc_object,<br>> zxstring TYPE xstring.<br>> <br>> swc_get_element container 'WID' wid.<br>> swc_get_element container 'OP_LEN' op_len.<br>> swc_get_table container 'IT_SOLIX_TAB' it_solix_tab.<br>> <br>> CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'<br>> EXPORTING<br>> input_length = op_len<br>> IMPORTING<br>> buffer = zxstring<br>> TABLES<br>> binary_tab = it_solix_tab.<br>> <br>> zswr_att_header-file_type = 'B'.<br>> zswr_att_header-file_name = 'Attachment.pdf'.<br>> zswr_att_header-file_extension = 'PDF'.<br>> zswr_att_header-language = 'EN'.<br>> BREAK-POINT.<br>> CALL FUNCTION 'SAP_WAPI_ATTACHMENT_ADD'<br>> EXPORTING<br>> workitem_id = wid<br>> att_header = zswr_att_header<br>> att_bin = zxstring<br>> IMPORTING<br>> att_id = zswr_att_id.<br>> <br>> swc_create_object lo_sofm 'SOFM' zswr_att_id-doc_id.<br>> swc_set_element container 'SOFM' lo_sofm.<br>> -------------- next part --------------<br>> An HTML attachment was scrubbed...<br>> URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20120103/40efd24a/attachment-0001.htm<br>> <br>> ------------------------------<br>> <br>> _______________________________________________<br>> SAP-WUG mailing list<br>> SAP-WUG@mit.edu<br>> http://mailman.mit.edu/mailman/listinfo/sap-wug<br>> <br>> <br>> End of SAP-WUG Digest, Vol 86, Issue 3<br>> **************************************<br></div>                                            </div></body>
</html>