<?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 BAPI_ACC_DOCUMENT_POST returns non-sequential numbers in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-returns-non-sequential-numbers/m-p/1681379#M300301</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am fixing someone's program that is using BAPI_ACC_DOCUMENT_POST.  It creates the document correctly, but if you run it multiple times, the document numbers that it creates are not sequential.  There doesn't seem to be a pattern for the document number gaps.  Here is how the header is created and the BAPI is called.  Maybe it will give you some insight.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      T_BAPIACHE09-OBJ_TYPE =  'BKPFF'.&lt;/P&gt;&lt;P&gt;      T_BAPIACHE09-BUS_ACT = 'RFBU'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      T_BAPIACHE09-OBJ_KEY = '001000000000000000'.&lt;/P&gt;&lt;P&gt;      CONCATENATE '0010' SY-UZEIT SY-DATUM INTO T_BAPIACHE09-OBJ_KEY.&lt;/P&gt;&lt;P&gt;      WRITE: / 'Object Key ', T_BAPIACHE09-OBJ_KEY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CONCATENATE SY-SYSID 'CLNT' SY-MANDT INTO T_BAPIACHE09-OBJ_SYS.&lt;/P&gt;&lt;P&gt;      WRITE: / 'Object System ', T_BAPIACHE09-OBJ_SYS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      T_BAPIACHE09-USERNAME = SY-UNAME.&lt;/P&gt;&lt;P&gt;      T_BAPIACHE09-COMP_CODE = WA_HEADER-BUKRS.&lt;/P&gt;&lt;P&gt;      T_BAPIACHE09-FISC_YEAR = SY-DATUM(4).&lt;/P&gt;&lt;P&gt;      T_BAPIACHE09-DOC_DATE = SY-DATUM.&lt;/P&gt;&lt;P&gt;      T_BAPIACHE09-PSTNG_DATE = SY-DATUM.&lt;/P&gt;&lt;P&gt;      T_BAPIACHE09-FIS_PERIOD = SY-DATUM+4(2).&lt;/P&gt;&lt;P&gt;      T_BAPIACHE09-DOC_TYPE = 'SA'.&lt;/P&gt;&lt;P&gt;      T_BAPIACHE09-HEADER_TXT  = WA_HEADER-BKTXT.&lt;/P&gt;&lt;P&gt;      T_BAPIACHE09-AC_DOC_NO = SPACE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      DOCUMENTHEADER = T_BAPIACHE09&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      ACCOUNTGL      = T_BAPIACGL09&lt;/P&gt;&lt;P&gt;      CURRENCYAMOUNT = T_BAPIACCR09&lt;/P&gt;&lt;P&gt;      RETURN         = T_BAPIRET2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated and rewarded with points.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Nov 2006 12:30:32 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-09T12:30:32Z</dc:date>
    <item>
      <title>BAPI_ACC_DOCUMENT_POST returns non-sequential numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-returns-non-sequential-numbers/m-p/1681379#M300301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am fixing someone's program that is using BAPI_ACC_DOCUMENT_POST.  It creates the document correctly, but if you run it multiple times, the document numbers that it creates are not sequential.  There doesn't seem to be a pattern for the document number gaps.  Here is how the header is created and the BAPI is called.  Maybe it will give you some insight.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      T_BAPIACHE09-OBJ_TYPE =  'BKPFF'.&lt;/P&gt;&lt;P&gt;      T_BAPIACHE09-BUS_ACT = 'RFBU'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      T_BAPIACHE09-OBJ_KEY = '001000000000000000'.&lt;/P&gt;&lt;P&gt;      CONCATENATE '0010' SY-UZEIT SY-DATUM INTO T_BAPIACHE09-OBJ_KEY.&lt;/P&gt;&lt;P&gt;      WRITE: / 'Object Key ', T_BAPIACHE09-OBJ_KEY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CONCATENATE SY-SYSID 'CLNT' SY-MANDT INTO T_BAPIACHE09-OBJ_SYS.&lt;/P&gt;&lt;P&gt;      WRITE: / 'Object System ', T_BAPIACHE09-OBJ_SYS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      T_BAPIACHE09-USERNAME = SY-UNAME.&lt;/P&gt;&lt;P&gt;      T_BAPIACHE09-COMP_CODE = WA_HEADER-BUKRS.&lt;/P&gt;&lt;P&gt;      T_BAPIACHE09-FISC_YEAR = SY-DATUM(4).&lt;/P&gt;&lt;P&gt;      T_BAPIACHE09-DOC_DATE = SY-DATUM.&lt;/P&gt;&lt;P&gt;      T_BAPIACHE09-PSTNG_DATE = SY-DATUM.&lt;/P&gt;&lt;P&gt;      T_BAPIACHE09-FIS_PERIOD = SY-DATUM+4(2).&lt;/P&gt;&lt;P&gt;      T_BAPIACHE09-DOC_TYPE = 'SA'.&lt;/P&gt;&lt;P&gt;      T_BAPIACHE09-HEADER_TXT  = WA_HEADER-BKTXT.&lt;/P&gt;&lt;P&gt;      T_BAPIACHE09-AC_DOC_NO = SPACE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      DOCUMENTHEADER = T_BAPIACHE09&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      ACCOUNTGL      = T_BAPIACGL09&lt;/P&gt;&lt;P&gt;      CURRENCYAMOUNT = T_BAPIACCR09&lt;/P&gt;&lt;P&gt;      RETURN         = T_BAPIRET2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated and rewarded with points.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2006 12:30:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-returns-non-sequential-numbers/m-p/1681379#M300301</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-09T12:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ACC_DOCUMENT_POST returns non-sequential numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-returns-non-sequential-numbers/m-p/1681380#M300302</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 the folowing,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a new entry (i.e. ZCUS) in table TTYP (it has manteinance view --&amp;gt; SM30).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Repace value BKPFF by the one you just created ZCUS in header field object type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Jose&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2006 12:35:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-returns-non-sequential-numbers/m-p/1681380#M300302</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-09T12:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ACC_DOCUMENT_POST returns non-sequential numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-returns-non-sequential-numbers/m-p/1681381#M300303</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;But have you some gaps in the document numerations?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you use the COMMIT after calling the BAPI for posting?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2006 12:54:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-returns-non-sequential-numbers/m-p/1681381#M300303</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-09T12:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ACC_DOCUMENT_POST returns non-sequential numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-returns-non-sequential-numbers/m-p/1681382#M300304</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;We use the BAPI as I told you and we don´t have problems with the numbering. I´m not sure if replacing the object type will solve your problem, but I remember having read somewhere that using standard sap object types with this BAPI could cause problems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, you must do a commit after calling the BAPI, if you don´t it will not create the document. You can use BAPI_TRANSACTION_COMMIT instead of doing the commit directly in your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Jose&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2006 13:51:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-returns-non-sequential-numbers/m-p/1681382#M300304</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-09T13:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ACC_DOCUMENT_POST returns non-sequential numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-returns-non-sequential-numbers/m-p/1681383#M300305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;we get the next available number with the FM NUMBER_GET_NEXT before we pass it to the obj_key so that the numbers can be sequential.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2006 14:00:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-returns-non-sequential-numbers/m-p/1681383#M300305</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-09T14:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ACC_DOCUMENT_POST returns non-sequential numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-returns-non-sequential-numbers/m-p/1681384#M300306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should not have to use the number_get_next for a standard BAPI that creates these documents.  When I run mine, it creates the document, but there are gaps between the runs.  For example, the first time I run it it creates document 1, the second time 15, then 35, then 37, and so on.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2006 19:12:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-returns-non-sequential-numbers/m-p/1681384#M300306</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-09T19:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ACC_DOCUMENT_POST returns non-sequential numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-returns-non-sequential-numbers/m-p/1681385#M300307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am already doing the bapi commit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2006 19:12:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-returns-non-sequential-numbers/m-p/1681385#M300307</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-09T19:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ACC_DOCUMENT_POST returns non-sequential numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-returns-non-sequential-numbers/m-p/1681386#M300308</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;That's ok, but are there the document beetween 2 and 14, 16 and 34 and so.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The range depends on only document type, so before creating the next document check if the range is currectly updated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2006 19:23:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-returns-non-sequential-numbers/m-p/1681386#M300308</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-09T19:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ACC_DOCUMENT_POST returns non-sequential numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-returns-non-sequential-numbers/m-p/1681387#M300309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;as Max says try the check. Also just wanted to make sure you do not have a test run on this program. If  test run then do you rollback. Even if you test it SE37 the number gets alloted but the document is not posted as there is no commit unless its update. Just a thought. Anyways do let us know how you solved it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2006 19:54:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-returns-non-sequential-numbers/m-p/1681387#M300309</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-09T19:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ACC_DOCUMENT_POST returns non-sequential numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-returns-non-sequential-numbers/m-p/1681388#M300310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As already said: If a numer is drawn from the numer range (i.e. test without commit) this numer cannot be used again - it is lost.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Possibly your program tries to post a document and in error case drops it - numers are lost.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another possible situation is using inbound IDOCS: IDOCS are processed in parrallel processing and it depends highly on the actual processing circumstances who comes first and how fast which document goes through. In that case the document number are anything but sequential.&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;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2006 23:42:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-returns-non-sequential-numbers/m-p/1681388#M300310</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2006-11-09T23:42:12Z</dc:date>
    </item>
  </channel>
</rss>

