<?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: problem with BAPI_DOCUMENT_CREATE2 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-document-create2/m-p/1499108#M231397</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The same problem i faced some days back.&lt;/P&gt;&lt;P&gt;Version is sutomatically assigned to the document and is always 1 more than the version present.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DOCUMENT FROM EXISTING - &lt;/P&gt;&lt;P&gt;use BAPI_DOCUMENT_CREATENEWVERSION this will create copy of the existing document with new version.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NEW DOCUMENT -&lt;/P&gt;&lt;P&gt;use BAPI_DOCUMENT_CREATE instead.&lt;/P&gt;&lt;P&gt;*...Create new document record for the given Document type, Document&lt;/P&gt;&lt;P&gt;*...number and Document Version&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'BAPI_DOCUMENT_CREATE'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      documentdata = gw_documentdata&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      doctype      = lw_outdocdata-documenttype&lt;/P&gt;&lt;P&gt;      docnumber    = lw_outdocdata-documentnumber&lt;/P&gt;&lt;P&gt;      docpart      = lw_outdocdata-documentpart&lt;/P&gt;&lt;P&gt;      docversion   = lw_outdocdata-documentversion&lt;/P&gt;&lt;P&gt;      return       = gw_bapiret2&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      objectlinks  = gi_linked_material.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;other useful BAPIS in this regard:&lt;/P&gt;&lt;P&gt;BAPI_DOCUMENT_CHANGE&lt;/P&gt;&lt;P&gt;BAPI_TRANSACTION_COMMIT&lt;/P&gt;&lt;P&gt;BAPI_DOCUMENT_GETOBJECTDOCS&lt;/P&gt;&lt;P&gt;BAPI_DOCUMENT_CREATEFROMSOURCE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the best &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regs,&lt;/P&gt;&lt;P&gt;AGS...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 Aug 2006 08:32:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-08-31T08:32:15Z</dc:date>
    <item>
      <title>problem with BAPI_DOCUMENT_CREATE2</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-document-create2/m-p/1499106#M231395</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 have a probleme using BAPI_DOCUMENT_CREATE2. The goal of the development is to create a document that will be linked to the activity of a network in PS module.&lt;/P&gt;&lt;P&gt; So I first tried to create a similar doc using CN22 transaction (network change).&lt;/P&gt;&lt;P&gt;After this, I look at table DRAD to have the data concerning the created doc , this is what i see :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DOKAR = ZCL&lt;/P&gt;&lt;P&gt;DOKNR = the aufnr of my network&lt;/P&gt;&lt;P&gt;DOKVR = 00&lt;/P&gt;&lt;P&gt;DOKOB = VORGNET&lt;/P&gt;&lt;P&gt;OBJKY = SUY10010 ( = aufnr of network + vornr of activity)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I try to create an empty document the following source code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;* Fill Document ID
    ls_doc-documentnumber = lw_aufnr.
    ls_doc-documenttype = 'ZCL'.
    ls_doc-documentversion = '00'.
    ls_doc-documentpart = '000'.
*    ls_doc-description = 'Morgan test Dir Creation'.

* Determin Link Between Document And Network Activitie
    li_objectlinks-objectkey = lw_dockey.
    li_objectlinks-objecttype = lk_dokob_vorgnet.
    APPEND li_objectlinks.

*
    CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
      EXPORTING
        documentdata               = ls_doc

     IMPORTING
*    DOCUMENTTYPE               =
*    DOCUMENTNUMBER             =
    DOCUMENTPART               = lw_docpart
    DOCUMENTVERSION            = lw_docversion
       return                   = ls_return
     TABLES
       objectlinks                = li_objectlinks.


    IF ls_return IS INITIAL .


                CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
                 EXPORTING
                   WAIT          = 'X'.
                          .

    ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in ls_return I have this message : E26 Version assigned automatically for document type ZCL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I conclude that I musn't specify the DocVersion and Doc Part and I comment these 2 lines :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*    ls_doc-documentversion = '00'.
*    ls_doc-documentpart = '000'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the result is exactly the same and I don't understand why ...please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Morgan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Aug 2006 08:15:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-document-create2/m-p/1499106#M231395</guid>
      <dc:creator>former_member246786</dc:creator>
      <dc:date>2006-08-31T08:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: problem with BAPI_DOCUMENT_CREATE2</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-document-create2/m-p/1499107#M231396</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;Try to find out this bapi in "BAPI" t-code. &lt;/P&gt;&lt;P&gt;There you can find the usefull information about this bapi . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers. &lt;/P&gt;&lt;P&gt;santosh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Aug 2006 08:26:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-document-create2/m-p/1499107#M231396</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-31T08:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: problem with BAPI_DOCUMENT_CREATE2</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-document-create2/m-p/1499108#M231397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The same problem i faced some days back.&lt;/P&gt;&lt;P&gt;Version is sutomatically assigned to the document and is always 1 more than the version present.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DOCUMENT FROM EXISTING - &lt;/P&gt;&lt;P&gt;use BAPI_DOCUMENT_CREATENEWVERSION this will create copy of the existing document with new version.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NEW DOCUMENT -&lt;/P&gt;&lt;P&gt;use BAPI_DOCUMENT_CREATE instead.&lt;/P&gt;&lt;P&gt;*...Create new document record for the given Document type, Document&lt;/P&gt;&lt;P&gt;*...number and Document Version&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'BAPI_DOCUMENT_CREATE'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      documentdata = gw_documentdata&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      doctype      = lw_outdocdata-documenttype&lt;/P&gt;&lt;P&gt;      docnumber    = lw_outdocdata-documentnumber&lt;/P&gt;&lt;P&gt;      docpart      = lw_outdocdata-documentpart&lt;/P&gt;&lt;P&gt;      docversion   = lw_outdocdata-documentversion&lt;/P&gt;&lt;P&gt;      return       = gw_bapiret2&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      objectlinks  = gi_linked_material.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;other useful BAPIS in this regard:&lt;/P&gt;&lt;P&gt;BAPI_DOCUMENT_CHANGE&lt;/P&gt;&lt;P&gt;BAPI_TRANSACTION_COMMIT&lt;/P&gt;&lt;P&gt;BAPI_DOCUMENT_GETOBJECTDOCS&lt;/P&gt;&lt;P&gt;BAPI_DOCUMENT_CREATEFROMSOURCE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the best &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regs,&lt;/P&gt;&lt;P&gt;AGS...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Aug 2006 08:32:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-document-create2/m-p/1499108#M231397</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-31T08:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: problem with BAPI_DOCUMENT_CREATE2</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-document-create2/m-p/1499109#M231398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried with the BAPI_DOCUMENT_CREATE instaed of BAPI_DOCUMENt_CREATE2 as you said but now I have an other error message I don't understand at all :&lt;/P&gt;&lt;P&gt;E26 ID 300:  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Knowledge Provider is using document type ZCL as a storage system&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Morgan Bourgeois&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Aug 2006 08:53:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-document-create2/m-p/1499109#M231398</guid>
      <dc:creator>former_member246786</dc:creator>
      <dc:date>2006-08-31T08:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: problem with BAPI_DOCUMENT_CREATE2</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-document-create2/m-p/1499110#M231399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm facing the same problem "The Knowledge Provider is using document type DRW as a storage system". Can you tell me how to solve this issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2007 07:10:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-document-create2/m-p/1499110#M231399</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-06T07:10:33Z</dc:date>
    </item>
  </channel>
</rss>

