<?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 cannot post to posting key 25 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-cannot-post-to-posting-key-25/m-p/12272297#M1987972</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;
  &lt;P&gt;How do I post to posting key 25?&lt;/P&gt;
  &lt;P&gt;I am checking for posting key = 25 then set the relevant gl account number.&lt;/P&gt;
  &lt;P&gt;However I got the wrong result in FB03. It is automatically set to posting key 40 instead. &lt;/P&gt;
  &lt;P&gt;Anyone have any idea??&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1858786-wrong-posting-key-to-40-instead.png" /&gt;&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;gw_accountgl-bus_area = 'RFBU'.
    gw_accountgl-doc_type = 'ZP'.
    gw_accountgl-itemno_acc  = g_doc_count. "g_doc_line.
*    gw_accountgl-gl_account  = gw_post_rec-saknr.
*    gw_accountgl-vendor_no   = '1001941'.
    IF gw_post_rec-bschl = '25'.
*      gw_accountgl-gl_account  = space.
      IF gw_post_rec-gsber = 'RDF'.
        gw_accountgl-gl_account  = '561004'.
      ELSE.
        gw_accountgl-gl_account  = '561002'.

      ENDIF.
*      gw_accountgl-vendor_no   = '1001941'.

    ELSEIF gw_post_rec-bschl = '50'.
      IF gw_post_rec-gsber = 'RDF'.
        gw_accountgl-gl_account  = '561004'.
      ELSE.
        gw_accountgl-gl_account  = '561002'.&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 02 Nov 2020 10:08:05 GMT</pubDate>
    <dc:creator>siongchao_ng</dc:creator>
    <dc:date>2020-11-02T10:08:05Z</dc:date>
    <item>
      <title>BAPI_ACC_DOCUMENT_POST cannot post to posting key 25</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-cannot-post-to-posting-key-25/m-p/12272297#M1987972</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
  &lt;P&gt;How do I post to posting key 25?&lt;/P&gt;
  &lt;P&gt;I am checking for posting key = 25 then set the relevant gl account number.&lt;/P&gt;
  &lt;P&gt;However I got the wrong result in FB03. It is automatically set to posting key 40 instead. &lt;/P&gt;
  &lt;P&gt;Anyone have any idea??&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1858786-wrong-posting-key-to-40-instead.png" /&gt;&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;gw_accountgl-bus_area = 'RFBU'.
    gw_accountgl-doc_type = 'ZP'.
    gw_accountgl-itemno_acc  = g_doc_count. "g_doc_line.
*    gw_accountgl-gl_account  = gw_post_rec-saknr.
*    gw_accountgl-vendor_no   = '1001941'.
    IF gw_post_rec-bschl = '25'.
*      gw_accountgl-gl_account  = space.
      IF gw_post_rec-gsber = 'RDF'.
        gw_accountgl-gl_account  = '561004'.
      ELSE.
        gw_accountgl-gl_account  = '561002'.

      ENDIF.
*      gw_accountgl-vendor_no   = '1001941'.

    ELSEIF gw_post_rec-bschl = '50'.
      IF gw_post_rec-gsber = 'RDF'.
        gw_accountgl-gl_account  = '561004'.
      ELSE.
        gw_accountgl-gl_account  = '561002'.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Nov 2020 10:08:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-cannot-post-to-posting-key-25/m-p/12272297#M1987972</guid>
      <dc:creator>siongchao_ng</dc:creator>
      <dc:date>2020-11-02T10:08:05Z</dc:date>
    </item>
  </channel>
</rss>

