<?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: BAPI_DOCUMENT_CREATE2 - Copy Attached file issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2-copy-attached-file-issue/m-p/10637426#M1865065</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;Is it possible to handle this directly using this BAPI_DOCUMENT_CREATE2 or should i proceed the following approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Get the document file content using SCMS_DOCUMENT_READ&lt;/P&gt;&lt;P&gt;2) Use write dataset to write in the application server.&lt;/P&gt;&lt;P&gt;3) Then use the&amp;nbsp; BAPI_DOCUMENT_CREATE2 to attach that file updated in step 2 in the document in cv01.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Prabu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Sep 2014 02:56:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2014-09-16T02:56:46Z</dc:date>
    <item>
      <title>BAPI_DOCUMENT_CREATE2 - Copy Attached file issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2-copy-attached-file-issue/m-p/10637425#M1865064</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 trying to create a document with attachment in CV01 using the BAPI BAPI_DOCUMENT_CREATE2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here my requirement is to copy the attached files from a document to another document (which I will be creating newly).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I mean attachments from document 1 to document 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try using this bapi BAPI BAPI_DOCUMENT_CREATE2, what should I give in the docpath parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have storage category to maintain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even though if I pass storage category, the parameter is not checked in. So, it is throwing with error as “Error while checking and sorting”.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, In debugging , I set to checked in again and ran successfully.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;But, when I try to open the attached file in newly created document 2.&amp;nbsp; Getting error as could not be accessed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adding one more point is that, the fiel might have been uploaded from application server earlier and they might have removed that file from the application server. So, i should not access this file again trough application server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest if I am doing anything wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Prabu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: prabu kailasam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Sep 2014 20:40:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2-copy-attached-file-issue/m-p/10637425#M1865064</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-09-15T20:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_DOCUMENT_CREATE2 - Copy Attached file issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2-copy-attached-file-issue/m-p/10637426#M1865065</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;Is it possible to handle this directly using this BAPI_DOCUMENT_CREATE2 or should i proceed the following approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Get the document file content using SCMS_DOCUMENT_READ&lt;/P&gt;&lt;P&gt;2) Use write dataset to write in the application server.&lt;/P&gt;&lt;P&gt;3) Then use the&amp;nbsp; BAPI_DOCUMENT_CREATE2 to attach that file updated in step 2 in the document in cv01.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Prabu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Sep 2014 02:56:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2-copy-attached-file-issue/m-p/10637426#M1865065</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-09-16T02:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_DOCUMENT_CREATE2 - Copy Attached file issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2-copy-attached-file-issue/m-p/10637427#M1865066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prabhu,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Obviously this FM checks the storage category and file location in database so if it does not exist it will give you an error so your above approach will be a correct approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check it like this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;** Check in original 1 simultaneously in the SAP Database&lt;/P&gt;&lt;P&gt;REFRESH lt_files.&lt;/P&gt;&lt;P&gt;CLEAR lt_files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lt_files-storagecategory = 'SAP-SYSTEM'.&lt;/P&gt;&lt;P&gt;lt_files-docfile&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 'c:\temp\drawing.txt'.&lt;/P&gt;&lt;P&gt;lt_wsapplication = 'TXT'.&lt;/P&gt;&lt;P&gt;APPEND lt_files.&lt;/P&gt;&lt;P&gt;&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, 16 Sep 2014 03:06:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2-copy-attached-file-issue/m-p/10637427#M1865066</guid>
      <dc:creator>aarif_baig</dc:creator>
      <dc:date>2014-09-16T03:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_DOCUMENT_CREATE2 - Copy Attached file issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2-copy-attached-file-issue/m-p/10637428#M1865067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your response. I found the solution. Used the FM CV120_KPRO_LOIO_COPY&amp;nbsp; to solve this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Prabu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Sep 2014 19:14:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2-copy-attached-file-issue/m-p/10637428#M1865067</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-09-26T19:14:36Z</dc:date>
    </item>
  </channel>
</rss>

