<?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: how BAPI recognize negative value amount? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-bapi-recognize-negative-value-amount/m-p/1803760#M345030</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;You can't do it, because you can indicate any posting key in the BAPI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The BAPI decides automatically the posting key to be used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your question should be how the BAPI get the posting key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just as I said before, if the type of account of item is vendor and the amount is negative the posting key'll be 31 by default, if the account type is G/L and the amount is positive the posting key will be 40 by dafault.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I.e. the system'll use these posting key if the business transaction is &amp;lt;b&amp;gt;RFBU&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you should fill the structure in this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- G/L Item 1:&lt;/P&gt;&lt;P&gt;BAPIACGL09-ITEMNO_ACC = '001'.&lt;/P&gt;&lt;P&gt;BAPIACGL09-ACCT_KEY     = 'RFBU'.&lt;/P&gt;&lt;P&gt;....................................................&lt;/P&gt;&lt;P&gt;APPEND BAPIACGL09 TO ACCOUNTGL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPIACCR09-ITEMNO_ACC = '001'.&lt;/P&gt;&lt;P&gt;BAPIACCR09-CURRENCY    = 'RMB'.&lt;/P&gt;&lt;P&gt;MOVE '324.14' TO BAPIACCR09-AMT_DOCCUR.&lt;/P&gt;&lt;P&gt;APPEND BAPIACCR09 TO CURRENCYAMOUNT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- G/L Item 2:&lt;/P&gt;&lt;P&gt;BAPIACGL09-ITEMNO_ACC = '002'.&lt;/P&gt;&lt;P&gt;BAPIACGL09-ACCT_KEY     = 'RFBU'.&lt;/P&gt;&lt;P&gt;....................................................&lt;/P&gt;&lt;P&gt;APPEND BAPIACGL09 TO ACCOUNTGL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPIACCR09-ITEMNO_ACC = '002'.&lt;/P&gt;&lt;P&gt;BAPIACCR09-CURRENCY    = 'RMB'.&lt;/P&gt;&lt;P&gt;MOVE '6000.00' TO BAPIACCR09-AMT_DOCCUR.&lt;/P&gt;&lt;P&gt;APPEND BAPIACCR09 TO CURRENCYAMOUNT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Vendore Item 3:&lt;/P&gt;&lt;P&gt;BAPIACAP09-ITEMNO_ACC = '003'.&lt;/P&gt;&lt;P&gt;BAPIACAP09-ACCT_KEY     = 'RFBU'.&lt;/P&gt;&lt;P&gt;....................................................&lt;/P&gt;&lt;P&gt;APPEND BAPIACAP09 TO ACCOUNTPAYABLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPIACCR09-ITEMNO_ACC = '003'.&lt;/P&gt;&lt;P&gt;BAPIACCR09-CURRENCY    = 'RMB'.&lt;/P&gt;&lt;P&gt;MOVE '6324.14-' TO BAPIACCR09-AMT_DOCCUR.&lt;/P&gt;&lt;P&gt;APPEND BAPIACCR09 TO CURRENCYAMOUNT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this way the system'll use those key, so the problem is if you need to use different posting key. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To indicate it needs to use different posting key it has to indicate a different &amp;lt;b&amp;gt;BUSINESS TRANSACTION&amp;lt;/b&amp;gt; (see the fm FI_GET_POSTING_KEY).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Dec 2006 09:04:03 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-01T09:04:03Z</dc:date>
    <item>
      <title>how BAPI recognize negative value amount?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-bapi-recognize-negative-value-amount/m-p/1803755#M345025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I use BAPI_ACC_DOCUMENT_CHECK and have 3 tables: &lt;/P&gt;&lt;P&gt;gl_account, py_account and curr_amount. &lt;/P&gt;&lt;P&gt;I have a negative value amount, how to let this FM recognize the negative value amount?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

FORM bapi_check . 
  CALL FUNCTION 'BAPI_ACC_DOCUMENT_CHECK'
    EXPORTING
      DOCUMENTHEADER    = bapiache09
    TABLES
      ACCOUNTGL         = gl_account
      ACCOUNTPAYABLE    = py_account
      CURRENCYAMOUNT    = curr_amt
      RETURN            = ret_tab.
ENDFORM.                    " bapi_check
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the curr_amt table, I have 3 items with the amount:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
itemno_acc      currency       amount        "the posting key is
001              RMB            324.14       " 40
002              RMB           6000.00       " 40
003              RMB           6324.14-      " 31&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Nov 2006 17:17:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-bapi-recognize-negative-value-amount/m-p/1803755#M345025</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-30T17:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: how BAPI recognize negative value amount?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-bapi-recognize-negative-value-amount/m-p/1803756#M345026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The bapi has a inside functionality to handle -ve amounts...U just need to pass -ve amounts and it will be handled.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Nov 2006 17:23:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-bapi-recognize-negative-value-amount/m-p/1803756#M345026</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-30T17:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: how BAPI recognize negative value amount?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-bapi-recognize-negative-value-amount/m-p/1803757#M345027</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;It's easy you have to transfer you amount with sign, so if it's negative you have to transfer a negative number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The BAPI simply check if the amount is greater or less than 0 by an IF statament.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF amount is &amp;lt; 0, the Debit/credit indicator is H else S, so it can pick up from table T030B the correct posting key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway if you don't use a particolar transaction code the BAPI use only some posting key by default, you should consider:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Account type is K (Vendor):&lt;/P&gt;&lt;P&gt;  Debit/credit H (amount &amp;lt; 0) -&amp;gt; posting key 31&lt;/P&gt;&lt;P&gt;  Debit/credit S (amount &amp;gt; 0) -&amp;gt; posting key 21&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Account type is S (G/L):&lt;/P&gt;&lt;P&gt;  Debit/credit H (amount &amp;lt; 0) -&amp;gt; posting key 50&lt;/P&gt;&lt;P&gt;  Debit/credit S (amount &amp;gt; 0) -&amp;gt; posting key 40&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can check the sign of posting key in table TBSL&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, 30 Nov 2006 17:36:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-bapi-recognize-negative-value-amount/m-p/1803757#M345027</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-30T17:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: how BAPI recognize negative value amount?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-bapi-recognize-negative-value-amount/m-p/1803758#M345028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; I would like to make some correction on my question. Actually I have those values in excel file. And Posting Key &amp;lt;b&amp;gt;31&amp;lt;/b&amp;gt; indicates the negative value.&lt;/P&gt;&lt;P&gt;I could find any field to fill in the posting key in curr_amt that will be exported to FM BAPI_ACC_DOCUMENT_CHECK.&lt;/P&gt;&lt;P&gt;How can I tell the FM that those values with posting key '31' are a negative values?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the curr_amt table, I have 3 items with the amount:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
itemno_acc      currency       amount        "the posting key is
001              RMB            324.14       " 40
002              RMB           6000.00       " 40
003              RMB           6324.14       " 31   is negative value
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Dec 2006 01:38:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-bapi-recognize-negative-value-amount/m-p/1803758#M345028</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-01T01:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: how BAPI recognize negative value amount?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-bapi-recognize-negative-value-amount/m-p/1803759#M345029</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 problem is solved by multiply the currency with -1.&lt;/P&gt;&lt;P&gt;Thanks for those answer. It's valuable and appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    IF wa_xcel-posting_key EQ '31'.
      wa_curr_amt-amt_doccur = wa_xcel-amount * ( -1 ).
    ELSE.
      wa_curr_amt-amt_doccur = wa_xcel-amount.
    ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;ying ying&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Dec 2006 04:33:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-bapi-recognize-negative-value-amount/m-p/1803759#M345029</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-01T04:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: how BAPI recognize negative value amount?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-bapi-recognize-negative-value-amount/m-p/1803760#M345030</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;You can't do it, because you can indicate any posting key in the BAPI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The BAPI decides automatically the posting key to be used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your question should be how the BAPI get the posting key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just as I said before, if the type of account of item is vendor and the amount is negative the posting key'll be 31 by default, if the account type is G/L and the amount is positive the posting key will be 40 by dafault.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I.e. the system'll use these posting key if the business transaction is &amp;lt;b&amp;gt;RFBU&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you should fill the structure in this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- G/L Item 1:&lt;/P&gt;&lt;P&gt;BAPIACGL09-ITEMNO_ACC = '001'.&lt;/P&gt;&lt;P&gt;BAPIACGL09-ACCT_KEY     = 'RFBU'.&lt;/P&gt;&lt;P&gt;....................................................&lt;/P&gt;&lt;P&gt;APPEND BAPIACGL09 TO ACCOUNTGL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPIACCR09-ITEMNO_ACC = '001'.&lt;/P&gt;&lt;P&gt;BAPIACCR09-CURRENCY    = 'RMB'.&lt;/P&gt;&lt;P&gt;MOVE '324.14' TO BAPIACCR09-AMT_DOCCUR.&lt;/P&gt;&lt;P&gt;APPEND BAPIACCR09 TO CURRENCYAMOUNT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- G/L Item 2:&lt;/P&gt;&lt;P&gt;BAPIACGL09-ITEMNO_ACC = '002'.&lt;/P&gt;&lt;P&gt;BAPIACGL09-ACCT_KEY     = 'RFBU'.&lt;/P&gt;&lt;P&gt;....................................................&lt;/P&gt;&lt;P&gt;APPEND BAPIACGL09 TO ACCOUNTGL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPIACCR09-ITEMNO_ACC = '002'.&lt;/P&gt;&lt;P&gt;BAPIACCR09-CURRENCY    = 'RMB'.&lt;/P&gt;&lt;P&gt;MOVE '6000.00' TO BAPIACCR09-AMT_DOCCUR.&lt;/P&gt;&lt;P&gt;APPEND BAPIACCR09 TO CURRENCYAMOUNT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Vendore Item 3:&lt;/P&gt;&lt;P&gt;BAPIACAP09-ITEMNO_ACC = '003'.&lt;/P&gt;&lt;P&gt;BAPIACAP09-ACCT_KEY     = 'RFBU'.&lt;/P&gt;&lt;P&gt;....................................................&lt;/P&gt;&lt;P&gt;APPEND BAPIACAP09 TO ACCOUNTPAYABLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPIACCR09-ITEMNO_ACC = '003'.&lt;/P&gt;&lt;P&gt;BAPIACCR09-CURRENCY    = 'RMB'.&lt;/P&gt;&lt;P&gt;MOVE '6324.14-' TO BAPIACCR09-AMT_DOCCUR.&lt;/P&gt;&lt;P&gt;APPEND BAPIACCR09 TO CURRENCYAMOUNT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this way the system'll use those key, so the problem is if you need to use different posting key. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To indicate it needs to use different posting key it has to indicate a different &amp;lt;b&amp;gt;BUSINESS TRANSACTION&amp;lt;/b&amp;gt; (see the fm FI_GET_POSTING_KEY).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Dec 2006 09:04:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-bapi-recognize-negative-value-amount/m-p/1803760#M345030</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-01T09:04:03Z</dc:date>
    </item>
  </channel>
</rss>

