<?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: Problem with TAX-Line using BAPI_ACC_DOCUMENT_POST in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-tax-line-using-bapi-acc-document-post/m-p/7090296#M1507115</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ok I could solve the balance-problem myself !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the invoice is now posted correctly and I'm happy and done with this project &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thx again carlos!!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Jul 2010 14:26:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-07-06T14:26:30Z</dc:date>
    <item>
      <title>Problem with TAX-Line using BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-tax-line-using-bapi-acc-document-post/m-p/7090292#M1507111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm stuck for days now and hope you can help me!&lt;/P&gt;&lt;P&gt;I want to automate Invoice posting via BAPI_ACC_DOCUMENT_POST which our company is posting manualy through FB01 right now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a sample Invoice posted through FB01 that I want to post with the BAPI:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1     218.76 u20AC     (=Vendor Line INCLUDING TAX) --&amp;gt; 183.83u20AC without TAX&lt;/P&gt;&lt;P&gt;2     93.46 u20AC       (= first customer position in invoice, NO TAX)&lt;/P&gt;&lt;P&gt;3     31.90u20AC        (= second customer position in invoice, NO TAX)&lt;/P&gt;&lt;P&gt;4     58.47          (= third customer position in invoice. NO TAX)&lt;/P&gt;&lt;P&gt;5     34.93          (= TAX) --&amp;gt; 34.93u20AC + 183.83u20AC = 218.76u20AC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use BAPI_ACC_DOCUMENT_POST to generate exactly the same invoice as posted above with FB01.&lt;/P&gt;&lt;P&gt;The Problem is, my Invoice don't has the TAX-Line and I don't know why...I read hundreds of threads here on how to populate accounttax-table but no success!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Right now I can only post a Invoice with BAPI_ACC_DOCUMENT_POST without TAX; thats why I use the amount of 183.93u20AC for the first position (=vendor); otherwise I would get the error that the invoice is not balanced and the SUM is no&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I check the Table BSET there is even a entry for my invoice but the tax is set to zero allthough I set &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;currencyamount-AMT_BASE = '34.93'&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*       KOPFDATEN
*----------------------------------------------------------------------*
        documentheader-BUS_ACT = 'RFBU'.
        documentheader-USERNAME = sy-uname.
        documentheader-HEADER_TXT = 'some text'.
        documentheader-COMP_CODE = '0025'.
        documentheader-DOC_DATE = sy-datum - 10.
        documentheader-PSTNG_DATE = sy-datum.
        documentheader-DOC_TYPE = 'KR'.
        documentheader-REF_DOC_NO = 'some ref doc no'.

*&amp;amp;---------------------------------------------------------------------*
*       First Line in Invoice (Vendor)
*----------------------------------------------------------------------*
        accountpayable-ITEMNO_ACC = 1.                                         
        accountpayable-VENDOR_NO = '0000017770'.                             
        accountpayable-BUS_AREA = '0005'.                                     
        accountpayable-PMNTTRMS = 'ZB30'.                                      
        accountpayable-ALLOC_NMBR = 'some text'.                               
        accountpayable-ITEM_TEXT = 'some text'.                                
        accountpayable-TAX_CODE = 'K1'.                                        
        accountpayable-PARTNER_BK = '2'.                                      
        APPEND accountpayable.

        currencyamount-ITEMNO_ACC = 1.
        currencyamount-curr_type = '00'.
        currencyamount-CURRENCY = 'EUR'.
        currencyamount-AMT_DOCCUR = ( 218.76 - 34.93 ) * -1.    "= 183.83u20AC which is the SUM without TAX
*        currencyamount-AMT_DOCCUR = ( 218.76 ) * -1.    "the actual amount for position 1 that I need to use INCLUDING TAX
        APPEND currencyamount.

*&amp;amp;---------------------------------------------------------------------*
*       Lines 2...n-1 = Customers
*----------------------------------------------------------------------*
        LOOP AT lt_cvs_pos.
          accountgl-ITEMNO_ACC = sy-tabix + 1.
          accountgl-GL_ACCOUNT = '0000447400'.
          accountgl-ITEM_TEXT = 'some text'.
          accountgl-BUS_AREA = '0005'.
          accountgl-ALLOC_NMBR = 'some text'.
          accountgl-TAX_CODE = 'K1'.
          accountgl-COSTCENTER = '108'.                      
          APPEND accountgl.

          currencyamount-ITEMNO_ACC = sy-tabix + 1.
          currencyamount-curr_type = '00'.
          currencyamount-CURRENCY = 'EUR'.
          currencyamount-AMT_DOCCUR = &amp;lt;the three invoice amounts: 93.46u20AC, 31.90u20AC and 58.47u20AC all with NO TAX included&amp;gt;.
          APPEND currencyamount.
          n = sy-tabix + 1.
        ENDLOOP.

*&amp;amp;---------------------------------------------------------------------*
*       POSITIONSDATEN n befüllen = Umsatzsteuer
*----------------------------------------------------------------------*
        accounttax-ITEMNO_ACC = n.                             "n=5 in this case
*        accounttax-gl_account = '0000152100'.
        accounttax-cond_key = 'MWVS'.                                          
        accounttax-acct_key = 'VST'.
        accounttax-tax_code = 'K1'.
*        accounttax-tax_rate = '19'.
*        accounttax-tax_date = sy-datum.
*        accounttax-itemno_tax = 1.

        currencyamount-ITEMNO_ACC = n.
        currencyamount-curr_type = '00'.                                      
        currencyamount-CURRENCY = 'EUR'.
        currencyamount-AMT_DOCCUR = '218.76'.
        currencyamount-AMT_BASE = '34.93'. 
        APPEND currencyamount.

*&amp;amp;---------------------------------------------------------------------*
*       Daten verbuchen
*----------------------------------------------------------------------*
        CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
          EXPORTING
            documentheader = documentheader
          TABLES
            accountgl = accountgl
            accountpayable = accountpayable
            accounttax = accounttax
            currencyamount = currencyamount
            return = return.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't understand what I'm doing wrong as everything looks fine to me but as I said no TAX-Line is posted allthough specified here.&lt;/P&gt;&lt;P&gt;When I check Table BSET for the created invoice there is also a entry there but the tax-amount = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any help please?!!!?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jul 2010 10:59:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-tax-line-using-bapi-acc-document-post/m-p/7090292#M1507111</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-06T10:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with TAX-Line using BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-tax-line-using-bapi-acc-document-post/m-p/7090293#M1507112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;test&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; test &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jul 2010 11:23:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-tax-line-using-bapi-acc-document-post/m-p/7090293#M1507112</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-06T11:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with TAX-Line using BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-tax-line-using-bapi-acc-document-post/m-p/7090294#M1507113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi jazy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   I can not see the Append to the internal table ACCOUNTTAX.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  You can also try:&lt;/P&gt;&lt;P&gt;  accounttax-itemno_acc = n + 1.&lt;/P&gt;&lt;P&gt;  accounttax-itemno_tax = n.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Carlos.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jul 2010 12:16:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-tax-line-using-bapi-acc-document-post/m-p/7090294#M1507113</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-06T12:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with TAX-Line using BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-tax-line-using-bapi-acc-document-post/m-p/7090295#M1507114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Carlos,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OMG sometimes the solutions are too simple for one to see &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;THAT WAS THE PROBLEM...I had forgotten the APPEND&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have one last question/problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I Think everything will work fine now - the only thing is, I get the error message when calling the BAPI that the balance of the invoice is not zero.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to debug and see what amounts the BAPI would save to the TABLES so I can exactly see on what Invocie position I have to adjust the amount so the balance is equal because right now I just see the problem, but I don't now if the TAX-calculation is wrong or the customer-line-amounts...I hope you understand what I mean&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;jazy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jul 2010 13:21:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-tax-line-using-bapi-acc-document-post/m-p/7090295#M1507114</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-06T13:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with TAX-Line using BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-tax-line-using-bapi-acc-document-post/m-p/7090296#M1507115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ok I could solve the balance-problem myself !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the invoice is now posted correctly and I'm happy and done with this project &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thx again carlos!!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jul 2010 14:26:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-tax-line-using-bapi-acc-document-post/m-p/7090296#M1507115</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-06T14:26:30Z</dc:date>
    </item>
  </channel>
</rss>

