<div dir="ltr">Hi Ali,<br> Thanks for your reply. I have a doubt on your approach. Before calling CL_FITV_GOS=>GET_LINKS i think we should use CL_FITV_GOS=>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"><<a href="mailto:mr_mago40@hotmail.com">mr_mago40@hotmail.com</a>></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'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></div>> From: <a href="mailto:sap-wug-request@mit.edu" target="_blank">sap-wug-request@mit.edu</a><br>> Subject: SAP-WUG Digest, Vol 86, Issue 3<br>> To: <a href="mailto:sap-wug@mit.edu" target="_blank">sap-wug@mit.edu</a><br>
> Date: Tue, 3 Jan 2012 12:13:09 -0500<br>> <br>> Send SAP-WUG mailing list submissions to<br>>         <a href="mailto:sap-wug@mit.edu" target="_blank">sap-wug@mit.edu</a><br>> <br>> To subscribe or unsubscribe via the World Wide Web, visit<br>
>         <a href="http://mailman.mit.edu/mailman/listinfo/sap-wug" target="_blank">http://mailman.mit.edu/mailman/listinfo/sap-wug</a><br>> or, via email, send a message with subject or body 'help' to<br>>         <a href="mailto:sap-wug-request@mit.edu" target="_blank">sap-wug-request@mit.edu</a><br>
> <br>> You can reach the person managing the list at<br>>         <a href="mailto:sap-wug-owner@mit.edu" target="_blank">sap-wug-owner@mit.edu</a><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 <<a href="mailto:ikhansap@gmail.com" target="_blank">ikhansap@gmail.com</a>><br>> Subject: Issue with attaching pdf in work item<br>
> To: "SAP Workflow Users' Group" <<a href="mailto:SAP-WUG@mit.edu" target="_blank">SAP-WUG@mit.edu</a>><br>> Message-ID:<br>>         <<a href="mailto:CADb5asq-DCxY0HidihMp9BYmzuCb3BAF6CYJad33W25%2B2yeN-Q@mail.gmail.com" target="_blank">CADb5asq-DCxY0HidihMp9BYmzuCb3BAF6CYJad33W25+2yeN-Q@mail.gmail.com</a>><br>
> Content-Type: text/plain; charset="iso-8859-1"<div class="im"><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></div>> 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<div>
<div></div><div class="h5"><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>
</div></div>> -------------- next part --------------<br>> An HTML attachment was scrubbed...<br>> 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>
> <br>> ------------------------------<br>> <br>> _______________________________________________<br>> SAP-WUG mailing list<br>> <a href="mailto:SAP-WUG@mit.edu" target="_blank">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>> <br>> End of SAP-WUG Digest, Vol 86, Issue 3<br>> **************************************<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>