<?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 Tax posting using BAPI_ACC_DOCUMENT_POST in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/tax-posting-using-bapi-acc-document-post/m-p/1571962#M258233</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to known how to post document with tax items.&lt;/P&gt;&lt;P&gt;How to get values for tax structure if we only know tax code for account.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Oct 2006 07:16:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-10-12T07:16:54Z</dc:date>
    <item>
      <title>Tax posting using BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tax-posting-using-bapi-acc-document-post/m-p/1571962#M258233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to known how to post document with tax items.&lt;/P&gt;&lt;P&gt;How to get values for tax structure if we only know tax code for account.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Oct 2006 07:16:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tax-posting-using-bapi-acc-document-post/m-p/1571962#M258233</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-12T07:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: Tax posting using BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tax-posting-using-bapi-acc-document-post/m-p/1571963#M258234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take a look at the following code : &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

  DATA : w_compt(8) TYPE n. " This is the line N°
* You have to put the corresponding one in 
* accountpayable/accountgl


......
        w_compt = w_compt + 1.
        PERFORM fill_account_tax  USING w_compt
                               CHANGING w_tax_amount.

......


  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.

.....

*&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

&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;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Oct 2006 07:31:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tax-posting-using-bapi-acc-document-post/m-p/1571963#M258234</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-12T07:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: Tax posting using BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tax-posting-using-bapi-acc-document-post/m-p/1571964#M258235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amit!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You would need to &lt;/P&gt;&lt;P&gt;- read the tax percentages to the tax codes&lt;/P&gt;&lt;P&gt;- summarize the tax base amounts (net values of your doc) grouped by the different tax codes&lt;/P&gt;&lt;P&gt;- calculate the tax amounts for each tax code&lt;/P&gt;&lt;P&gt;- distribute the tax amount to the different positions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This can lead to two identical net values with different gross values because of this special rounding rule.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would never make such a calculation on my one - for this SAP documents and document pricing is for. &lt;/P&gt;&lt;P&gt;Maybe you create a dummy document to get the correct values and delete this afterwards - it's much saver in general, you would need a lot of coding to cover all exceptions otherwise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Oct 2006 07:47:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tax-posting-using-bapi-acc-document-post/m-p/1571964#M258235</guid>
      <dc:creator>christian_wohlfahrt</dc:creator>
      <dc:date>2006-10-12T07:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: Tax posting using BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tax-posting-using-bapi-acc-document-post/m-p/1571965#M258236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot ,Its workinging perfectly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Oct 2006 14:23:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tax-posting-using-bapi-acc-document-post/m-p/1571965#M258236</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-12T14:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: Tax posting using BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tax-posting-using-bapi-acc-document-post/m-p/1571966#M258237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Erwan, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need help because i can't see the tax line item in the document posted....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm doing exactly what you were posted, and it works fine....... but then, when the document were posted, I try to see it by FB03 and what happend ?  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the document sould be had 3 line items: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1- (01) ACCOUNTRECEIVABLE ITEM ---&amp;gt; 100 $&lt;/P&gt;&lt;P&gt;2- (50) GL ITEM                                 ---&amp;gt; 82.65 $ &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;3 -(50) TAX ITEM                               ---&amp;gt; 17.35 $&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if i see the document by fb03, i just see 2 lines:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1- (01) ACCOUNTRECEIVABLE ITEM ---&amp;gt; 100 $&lt;/P&gt;&lt;P&gt;2- (50) GL ITEM                                 ---&amp;gt; 100 $ &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and if I push the "tax" button, i see the tax item correctly (amount 17.35 $ and BASE = 82.65), Even in BSET the tax line item exists. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also if i post the document manually, i can see the three line items......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any Help ? &lt;/P&gt;&lt;P&gt;PD: My english is not the best, sorry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Nov 2006 13:34:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tax-posting-using-bapi-acc-document-post/m-p/1571966#M258237</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-14T13:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Tax posting using BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tax-posting-using-bapi-acc-document-post/m-p/1571967#M258238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I am using the same BAPI trying to post an AP invoice with tax with jurisdiction codes. Thanks for the tip re the function module to calcuate the tax. It seems when posting using jurisdiction codes, all levels need to be provided in the IDOC with the condition types etc rather than as per FB01 or FB60 where you just enter the jurisdiction code and SAP determines the rest?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Pritesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Nov 2006 15:35:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tax-posting-using-bapi-acc-document-post/m-p/1571967#M258238</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-28T15:35:45Z</dc:date>
    </item>
  </channel>
</rss>

