<?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' in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2/m-p/7557197#M1564007</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;the file name disappers but the files are there. &lt;/P&gt;&lt;P&gt;Perhaps you must filled the PT_FILES_X-FILENAME&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thierry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Jan 2011 15:15:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-01-10T15:15:06Z</dc:date>
    <item>
      <title>'BAPI_DOCUMENT_CREATE2'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2/m-p/7557191#M1564001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to create document "CV01N" with PDF attachment.&lt;/P&gt;&lt;P&gt; I am using BAPI 'BAPI_DOCUMENT_CREATE2' to create document. It is creating document but is not attaching the PDF document. I am running in foreground mode.  Tried to seach forum but did not find solution. &lt;/P&gt;&lt;P&gt;Following is the code i am using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;lv_docnum TYPE bapi_doc_aux-docnumber,&lt;/P&gt;&lt;P&gt;lw_docdata TYPE bapi_doc_draw2,&lt;/P&gt;&lt;P&gt;lw_return TYPE bapiret2,&lt;/P&gt;&lt;P&gt;lw_dsp TYPE bapi_doc_drat,&lt;/P&gt;&lt;P&gt;lw_objlink TYPE bapi_doc_drad,&lt;/P&gt;&lt;P&gt;lw_docfile TYPE bapi_doc_files2,&lt;/P&gt;&lt;P&gt;lt_dsp TYPE STANDARD TABLE OF bapi_doc_drat,&lt;/P&gt;&lt;P&gt;lt_objlink TYPE STANDARD TABLE OF bapi_doc_drad,&lt;/P&gt;&lt;P&gt;lt_docfile TYPE STANDARD TABLE OF bapi_doc_files2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  CLEAR lw_docdata.&lt;/P&gt;&lt;P&gt;  lw_docdata-documenttype = 'ZAC'.&lt;/P&gt;&lt;P&gt;  lw_docdata-documentversion = 'A0'.&lt;/P&gt;&lt;P&gt;  lw_docdata-documentpart = '000'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  lw_docdata-laboratory = '001'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR lw_dsp.&lt;/P&gt;&lt;P&gt;  lw_dsp-description = 'Test '.&lt;/P&gt;&lt;P&gt;  lw_dsp-language = 'E'.&lt;/P&gt;&lt;P&gt;  APPEND lw_dsp TO lt_dsp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  lw_docfile-docfile = 'C:\test.pdf'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; LW_DOCFILE-ORIGINALTYPE = '1'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  lw_docfile-storagecategory = 'SAP-SYSTEM'.&lt;/P&gt;&lt;P&gt;  lw_docfile-wsapplication = 'PDF'.&lt;/P&gt;&lt;P&gt;  lw_docfile-language = 'E'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; lw_docfile-checkedin = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; lw_docfile-active_version = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  APPEND lw_docfile TO lt_docfile.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR lw_objlink.&lt;/P&gt;&lt;P&gt;  lw_objlink-objecttype = 'VBAP'.&lt;/P&gt;&lt;P&gt;  lw_objlink-objectkey = '0040081239000010'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  lw_objlink-documentdirection = 'X'.&lt;/P&gt;&lt;P&gt;  APPEND lw_objlink TO lt_objlink.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      documentdata         = lw_docdata&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      documentnumber       = lv_docnum&lt;/P&gt;&lt;P&gt;      return               = lw_return&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      documentdescriptions = lt_dsp&lt;/P&gt;&lt;P&gt;      objectlinks          = lt_objlink&lt;/P&gt;&lt;P&gt;      documentfiles        = lt_docfile.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF lw_return-type CA 'EA'.&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.&lt;/P&gt;&lt;P&gt;    MESSAGE ID lw_return-id&lt;/P&gt;&lt;P&gt;    TYPE lw_return-type&lt;/P&gt;&lt;P&gt;    NUMBER lw_return-number.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        wait = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CLEAR lw_return.&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'BAPI_DOCUMENT_CHECKIN2'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        documenttype    = 'ZTR'&lt;/P&gt;&lt;P&gt;        documentnumber  = lv_docnum&lt;/P&gt;&lt;P&gt;        documentpart    = '000'&lt;/P&gt;&lt;P&gt;        documentversion = 'A0'&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        return          = lw_return&lt;/P&gt;&lt;P&gt;      TABLES&lt;/P&gt;&lt;P&gt;        documentfiles   = lt_docfile.&lt;/P&gt;&lt;P&gt;    IF lw_return-type CA 'EA'.&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.&lt;/P&gt;&lt;P&gt;      MESSAGE ID lw_return-id&lt;/P&gt;&lt;P&gt;      TYPE lw_return-type&lt;/P&gt;&lt;P&gt;      NUMBER lw_return-number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          wait = 'X'.&lt;/P&gt;&lt;P&gt;      WRITE: / 'document number = ', lv_docnum.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jan 2011 21:49:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2/m-p/7557191#M1564001</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-03T21:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: 'BAPI_DOCUMENT_CREATE2'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2/m-p/7557192#M1564002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the document must be exist for checkin a file.&lt;/P&gt;&lt;P&gt;In you code, you create a documenttype = 'ZAC' and you want to checkin on a documenttype = 'ZTR'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For checkin  a document, Y use BAPI_DOCUMENT_CHANGE2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR lt_documentfiles_new. REFRESH lt_documentfiles_new.&lt;/P&gt;&lt;P&gt;  lt_documentfiles_new-sourcedatacarrier = carrier.&lt;/P&gt;&lt;P&gt;  lt_documentfiles_new-storagecategory = storage.&lt;/P&gt;&lt;P&gt;  lt_documentfiles_new-wsapplication = dappl.&lt;/P&gt;&lt;P&gt;  lt_documentfiles_new-docfile = filep.&lt;/P&gt;&lt;P&gt;  APPEND lt_documentfiles_new.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'BAPI_DOCUMENT_CHANGE2'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            documenttype    = dokar&lt;/P&gt;&lt;P&gt;            documentnumber  = doknr&lt;/P&gt;&lt;P&gt;            documentpart    = doktl&lt;/P&gt;&lt;P&gt;            documentversion = dokvr&lt;/P&gt;&lt;P&gt;            documentdata    = ls_doc&lt;/P&gt;&lt;P&gt;            documentdatax   = ls_docx&lt;/P&gt;&lt;P&gt;            pf_ftp_dest     = 'SAPFTP'&lt;/P&gt;&lt;P&gt;            pf_http_dest    = 'SAPHTTP'&lt;/P&gt;&lt;P&gt;       IMPORTING&lt;/P&gt;&lt;P&gt;            return          = ls_return&lt;/P&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;            documentfiles   = lt_documentfiles_new.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this can help you&lt;/P&gt;&lt;P&gt;Thierry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jan 2011 13:11:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2/m-p/7557192#M1564002</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-04T13:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: 'BAPI_DOCUMENT_CREATE2'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2/m-p/7557193#M1564003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I made both the document types ZTR but still it does not work.&lt;/P&gt;&lt;P&gt;THanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jan 2011 14:11:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2/m-p/7557193#M1564003</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-04T14:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: 'BAPI_DOCUMENT_CREATE2'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2/m-p/7557194#M1564004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am able to create document and load attachments after applying oss note 0001173675. But some how it is uploading duplicate attachment instead of only one. Any suggestion?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jan 2011 20:51:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2/m-p/7557194#M1564004</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-05T20:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: 'BAPI_DOCUMENT_CREATE2'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2/m-p/7557195#M1564005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am able to attach only 2 files as attachment. How do you increase number in configuration.\&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also when i do file checkin the file name in disappearing. How can I keep the file name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jan 2011 22:05:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2/m-p/7557195#M1564005</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-07T22:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: 'BAPI_DOCUMENT_CREATE2'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2/m-p/7557196#M1564006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using FM 'BAPI_DOCUMENT_CREATE2' and FM ''CVAPI_DOC_CHECKIN''  to create document and attachment and then checkin the document.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am able to accomplish all the step. when i do file checkin the file name in disappearing. How can I keep the file name? When i attach the file I can see the name but when I checkin the file name disappers but the files are there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I am able to attach only 2 files as attachment. How do you increase number in configuration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jan 2011 14:38:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2/m-p/7557196#M1564006</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-10T14:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: 'BAPI_DOCUMENT_CREATE2'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2/m-p/7557197#M1564007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;the file name disappers but the files are there. &lt;/P&gt;&lt;P&gt;Perhaps you must filled the PT_FILES_X-FILENAME&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thierry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jan 2011 15:15:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2/m-p/7557197#M1564007</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-10T15:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: 'BAPI_DOCUMENT_CREATE2'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2/m-p/7557198#M1564008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Thierry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In FM ''CVAPI_DOC_CHECKIN''  I am passing the file to be updated in parameter PT_FILES_X-FILENAME. Still it is not working. If i do manual check in. It shows the file name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jan 2011 17:11:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2/m-p/7557198#M1564008</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-10T17:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: 'BAPI_DOCUMENT_CREATE2'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2/m-p/7557199#M1564009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And did you try to fill the PT_COMP_X-FILENAME ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is ok with manuel check, then the problem is on a paramter of the function &lt;/P&gt;&lt;P&gt;there is examples with that function on the forum : &lt;/P&gt;&lt;P&gt;- &lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1730023"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;- &lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="9571403"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thierry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jan 2011 07:22:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create2/m-p/7557199#M1564009</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-11T07:22:52Z</dc:date>
    </item>
  </channel>
</rss>

