<?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_ACC_DOCUMENT_POST to modify an accounting document in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-to-modify-an-accounting-document/m-p/2482667#M559615</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;             see note 487722.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The posting key is automatically assigned by the BAPI, u can't transfer it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The BAPI decides which posting key ahs to be used in order on the kind of item and operation key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you can try to drive the posting key assigning a certain operation key in the item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to check the fm FI_GET_POSTING_KEY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe you can decide which operation key to be used only in the G/L items (BAPIACGL09-ACCT_KEY), for the customer the BAPI uses the keys 01 and 11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can see how the BAPI decides which posting keys has to be used in the form fill_acct_key in the include LACC9F20.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the therads.&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="218109"&gt;&lt;/A&gt;&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="64263"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward points&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarsd&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Jun 2007 08:08:02 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-21T08:08:02Z</dc:date>
    <item>
      <title>BAPI_ACC_DOCUMENT_POST to modify an accounting document</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-to-modify-an-accounting-document/m-p/2482666#M559614</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;somebody knows how to use the FM BAPI_ACC_DOCUMENT_POST to modify an accounting document?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

lw_cab-username   = sy-uname.
lw_cab-doc_type   = 'KR'.
lw_cab-comp_code  = '0001'.
lw_cab-bus_act = 'RFBU'.
lw_cab-obj_type = 'BKPFF'.
lw_cab-obj_key = '190000032000012007'.
lw_cab-obj_sys = 'HRDCLNT100'.


* I only want to modify this field.
lw_cab-ref_doc_no = 'NEW'.


CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
    EXPORTING
      documentheader = lw_cab
    IMPORTING
      obj_key        = l_obj
    TABLES
      currencyamount = li_currencyamount
      return         = li_return.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also need to reverse an accounting document with BAPI_ACC_DOCUMENT_REV_POST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Somebody knows an example that works?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ángel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2007 06:24:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-to-modify-an-accounting-document/m-p/2482666#M559614</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-21T06:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ACC_DOCUMENT_POST to modify an accounting document</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-to-modify-an-accounting-document/m-p/2482667#M559615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;             see note 487722.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The posting key is automatically assigned by the BAPI, u can't transfer it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The BAPI decides which posting key ahs to be used in order on the kind of item and operation key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you can try to drive the posting key assigning a certain operation key in the item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to check the fm FI_GET_POSTING_KEY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe you can decide which operation key to be used only in the G/L items (BAPIACGL09-ACCT_KEY), for the customer the BAPI uses the keys 01 and 11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can see how the BAPI decides which posting keys has to be used in the form fill_acct_key in the include LACC9F20.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the therads.&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="218109"&gt;&lt;/A&gt;&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="64263"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward points&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarsd&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2007 08:08:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-to-modify-an-accounting-document/m-p/2482667#M559615</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-21T08:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ACC_DOCUMENT_POST to modify an accounting document</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-to-modify-an-accounting-document/m-p/2482668#M559616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm sorry to trouble you,angel..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I met the same problem as follows:&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="2959297"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;would you please share your code with me?&lt;/P&gt;&lt;P&gt;I'll meet the deadline in a few days..&lt;/P&gt;&lt;P&gt;Thank you..&lt;/P&gt;&lt;P&gt;my e-mail:ice916001@163.com&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2007 07:14:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-to-modify-an-accounting-document/m-p/2482668#M559616</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-09T07:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ACC_DOCUMENT_POST to modify an accounting document</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-to-modify-an-accounting-document/m-p/2482669#M559617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check this FM for modifing a field: CHANGE_DOCUMENT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: rev like BAPIACREV,&lt;/P&gt;&lt;P&gt;      bus like bAPIACHE09-BUS_ACT,&lt;/P&gt;&lt;P&gt;      ret like table of bapiret2 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: flg(1) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rev-obj_type = 'BKPFF'.&lt;/P&gt;&lt;P&gt;rev-obj_key = 'docnocompcodeyear'.&lt;/P&gt;&lt;P&gt;REV-OBJ_KEY_R = 'docnocompcodeyear'.&lt;/P&gt;&lt;P&gt;rev-PSTNG_DATE = '20070611'.&lt;/P&gt;&lt;P&gt;rev-FIS_PERIOD = '06'.&lt;/P&gt;&lt;P&gt;rev-COMP_CODE = 'comp_code'.&lt;/P&gt;&lt;P&gt;REV-REASON_REV = '02'.&lt;/P&gt;&lt;P&gt;REV-obj_sys = sy-mandt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_ACC_DOCUMENT_REV_POST'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    REVERSAL       = rev&lt;/P&gt;&lt;P&gt;    BUS_ACT        = 'RFBU'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  OBJ_TYPE       =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  OBJ_KEY        =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  OBJ_SYS        =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    RETURN         = ret.&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2007 20:53:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-to-modify-an-accounting-document/m-p/2482669#M559617</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-09T20:53:18Z</dc:date>
    </item>
  </channel>
</rss>

