<?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: Tax calculation in BAPI_ACC_DOCUMENT_POST in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/tax-calculation-in-bapi-acc-document-post/m-p/1827438#M352898</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried populaitng accounttax sturcture also and passed tax code and tax jurisdiction in this instead of accountgl. but now it gives the error 'balance in transaction currency'. But when i dont populate the accounttax, document is created.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 31 Jan 2007 11:23:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-01-31T11:23:51Z</dc:date>
    <item>
      <title>Tax calculation in BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tax-calculation-in-bapi-acc-document-post/m-p/1827431#M352891</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;We have a program in which BDC (Call Transaction) is used to do postings to GL accounts with transaction FB01.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, the requirement is to use BAPI &amp;#145;BAPI_ACC_DOCUMENT_POST&amp;#146; to do the postings. I did with bapi but one problem is coming in this. The tax data is calculated and displayed in the document but posting is not made to the tax account when done with bapi. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have any pointers regarding this, please provide the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;Ridhima&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jan 2007 10:09:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tax-calculation-in-bapi-acc-document-post/m-p/1827431#M352891</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-31T10:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Tax calculation in BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tax-calculation-in-bapi-acc-document-post/m-p/1827432#M352892</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;Check the following code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  fill_account_tax
*&amp;amp;---------------------------------------------------------------------*
FORM fill_account_tax USING p_compt CHANGING p_tax_amount.
* ACCOUNTTAX
  PERFORM calculate_vat_amount USING t_notilus-comp_code
                                     t_notilus-vat_cod
                                     t_notilus-amt_doccur
                            CHANGING p_tax_amount
                                     accounttax-tax_code
                                     accounttax-tax_rate
                                     accounttax-acct_key
                                     accounttax-gl_account
                                     accounttax-cond_key.
  accounttax-tax_date   = sy-datum.
  accounttax-itemno_acc = p_compt.
  accounttax-itemno_tax = p_compt - 1.
  APPEND accounttax.

ENDFORM.                    " fill_account_tax
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  calculate_vat_amount
*&amp;amp;---------------------------------------------------------------------*
FORM calculate_vat_amount  USING    p_comp_code
                                    p_vat_cod
                                    p_amount
                           CHANGING tax_amount
                                    w_vat_cod
                                    w_msatz
                                    w_ktosl
                                    w_hkont
                                    w_kschl.

  DATA : BEGIN OF t_mwdat OCCURS 0.
          INCLUDE STRUCTURE rtax1u15.
  DATA : END OF t_mwdat.

  DATA : w_ttc LIKE bseg-wrbtr.
  w_ttc = p_amount.

  CALL FUNCTION 'CALCULATE_TAX_FROM_NET_AMOUNT'
    EXPORTING
      i_bukrs           = p_comp_code
      i_mwskz           = p_vat_cod
      i_waers           = 'EUR'
      i_wrbtr           = w_ttc
    TABLES
      t_mwdat           = t_mwdat
    EXCEPTIONS
      bukrs_not_found   = 1
      country_not_found = 2
      mwskz_not_defined = 3
      mwskz_not_valid   = 4
      ktosl_not_found   = 5
      kalsm_not_found   = 6
      parameter_error   = 7
      knumh_not_found   = 8
      kschl_not_found   = 9
      unknown_error     = 10
      account_not_found = 11
      txjcd_not_valid   = 12
      OTHERS            = 13.

  IF sy-subrc &amp;lt;&amp;gt; 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

  CLEAR t_mwdat.
  READ TABLE t_mwdat INDEX 1. "INTO s_mwdat
* w_tax_amount = t_mwdat-WMWST.
  w_tax_amount = t_notilus-vat_amount.
  w_ktosl      = t_mwdat-ktosl.
  w_hkont      = t_mwdat-hkont.
  w_kschl      = t_mwdat-kschl.
  w_msatz      = t_mwdat-msatz.
  w_vat_cod    = p_vat_cod.


ENDFORM.                    " calculate_vat_amount



(...)
* call BAPI-function in this system
  CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
    EXPORTING
      documentheader = documentheader
    IMPORTING
      obj_type       = l_type
      obj_key        = l_key
      obj_sys        = l_sys
    TABLES
      accountgl      = accountgl
      accountpayable = accountpayable
      currencyamount = currencyamount
      accounttax     = accounttax
      extension1     = extension1
      return         = return.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erwan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jan 2007 10:15:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tax-calculation-in-bapi-acc-document-post/m-p/1827432#M352892</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-31T10:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: Tax calculation in BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tax-calculation-in-bapi-acc-document-post/m-p/1827433#M352893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The thing is that we customization settings done to calculate tax. So we dont need to calculate tax. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am just passing tax code and tax jurisdiction in the accountgl structure of bapi.&lt;/P&gt;&lt;P&gt;Tax is calculated but posting is not done to the tax account.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jan 2007 10:18:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tax-calculation-in-bapi-acc-document-post/m-p/1827433#M352893</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-31T10:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: Tax calculation in BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tax-calculation-in-bapi-acc-document-post/m-p/1827434#M352894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can I know what you put in the following field :&lt;/P&gt;&lt;P&gt;documentheader-compo_acc ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suggest to keep it blank.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erwan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jan 2007 10:21:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tax-calculation-in-bapi-acc-document-post/m-p/1827434#M352894</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-31T10:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: Tax calculation in BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tax-calculation-in-bapi-acc-document-post/m-p/1827435#M352895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is blank. I am not entering anything in this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jan 2007 10:34:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tax-calculation-in-bapi-acc-document-post/m-p/1827435#M352895</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-31T10:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: Tax calculation in BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tax-calculation-in-bapi-acc-document-post/m-p/1827436#M352896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, I guess you did'nt use the accounttax structure ?&lt;/P&gt;&lt;P&gt;Perhaps, you should fill it...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jan 2007 10:40:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tax-calculation-in-bapi-acc-document-post/m-p/1827436#M352896</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-31T10:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: Tax calculation in BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tax-calculation-in-bapi-acc-document-post/m-p/1827437#M352897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Radhima,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thnk you need to use the same formula for calculating tax in program before posting the value &amp;amp; assing the calculated value to bapi &amp;amp; field &amp;amp; pass it. Because the BAPI post the values directly to tables based on functions without using screens.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ashvender&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jan 2007 10:42:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tax-calculation-in-bapi-acc-document-post/m-p/1827437#M352897</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-31T10:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: Tax calculation in BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tax-calculation-in-bapi-acc-document-post/m-p/1827438#M352898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried populaitng accounttax sturcture also and passed tax code and tax jurisdiction in this instead of accountgl. but now it gives the error 'balance in transaction currency'. But when i dont populate the accounttax, document is created.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jan 2007 11:23:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tax-calculation-in-bapi-acc-document-post/m-p/1827438#M352898</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-31T11:23:51Z</dc:date>
    </item>
  </channel>
</rss>

