Problem with "Tax Code" and "Calculate tax automatically" fields

Hi again.
I have made a program which posts account documents through the BAPI_ACC_DOCUMENT_POST function module, and, since there were some fields which weren't available for me to fill having the FM by itslef, I have implemented the AC_DOCUMENT BAdI.
All document data is provided by means of an SAP XI interface, through a Z IDoc.
When I create the Account Receivable (and/or Payable) structure, I fill, through the BAdI, the BKPF-XMWST (Calculate tax automatically) and BSEG-MWSKZ (Tax code) fields. However, even the resulting posted document does have the Tax Information fields completed (the ones in the BSET table), the BAPI doesn't create the tax position automatically (just like the FB01 or FB60 transactions do). Note that the amounts are sent in their gross value by the interface (that's why the debit and credit sides remain consistent and the document is posted correctly).
How can I have that position created? Is there a function module which I can call or something?
Thanks a lot in advance.

Hi
I only use the fm CALCULATE_TAX_FROM_NET_AMOUNT or CALCULATE_TAX_FROM_GROSSAMOUNT in order to get all information I need to transfer to the BAPI. Both fms return the data by table parameter T_MWDAT.
U can read this table and get all information u need, these code is from my old program, I hope it can help you:
- Calculate tax data:
CALL FUNCTION 'CALCULATE_TAX_FROM_NET_AMOUNT'
        EXPORTING
          I_BUKRS           = BUK_TO
          I_MWSKZ           = T_BASE-MWSKZ_OUT
          I_WAERS           = _BKPF-WAERS
          I_WRBTR           = T_BASE-WRBTR
        TABLES
          T_MWDAT           = T_MWDAT
       EXCPTIONS.
      IF SY-SUBRC <> 0.
      ELSE.
* Load tax item
        LOOP AT T_MWDAT.
          CLEAR W_GL_ITEM.
          W_GL_ITEM-HKONT   = T_MWDAT-HKONT.
          W_GL_ITEM-MWSKZ   = T_BASE-MWSKZ_OUT.
          IF T_BASE-KBETR = T_MWDAT-KBETR.
            W_GL_ITEM-WRBTR   = T_BASE-FWSTE.
          ELSE.
            W_GL_ITEM-WRBTR   = T_MWDAT-WMWST.
          ENDIF.
          W_GL_ITEM-IVA   = 'X'.
          W_GL_ITEM-KTOSL = T_MWDAT-KTOSL.
          W_GL_ITEM-TXJCD = T_MWDAT-TXJCD.
          W_GL_ITEM-KSCHL = T_MWDAT-KSCHL.
          W_GL_ITEM-TXJCD_DEEP = T_MWDAT-TXJCD_DEEP.
          W_GL_ITEM-TXJLV = T_MWDAT-TXJLV.
          W_GL_ITEM-BASE  = T_BASE-WRBTR.
          COLLECT W_GL_ITEM INTO GL_ITEM.
- Append GL or Tax item for the BAPI
LOOP AT GL_ITEM INTO W_GL_ITEM .
    ITEMNO_ACC = ITEMNO_ACC + 1.
    IF W_GL_ITEM-IVA = SPACE.
* GL item
    ELSE.
* Tax item
      ACCOUNTTAX-ITEMNO_ACC = ITEMNO_ACC.
      ACCOUNTTAX-TAX_CODE   = W_GL_ITEM-MWSKZ.
      ACCOUNTTAX-ACCT_KEY   = W_GL_ITEM-KOSTL.
      ACCOUNTTAX-COND_KEY   = W_GL_ITEM-KSCHL.
      ACCOUNTTAX-TAXJURCODE = W_GL_ITEM-TXJCD.
      ACCOUNTTAX-TAXJURCODE_DEEP  = W_GL_ITEM-TXJCD_DEEP.
      ACCOUNTTAX-TAXJURCODE_LEVEL = W_GL_ITEM-TXJLV.
      APPEND ACCOUNTTAX.
      PERFORM FILL_AMOUNT USING W_GL_ITEM-WRBTR W_GL_ITEM-BASE.
    ENDIF.
  ENDLOOP.
Max
Edited by: max bianchi on Nov 25, 2009 7:43 PM

Similar Messages

  • MM-SUS: SUS invoice creation without default tax code and no tax amount

    Hello All:
    When i create SUS invoice based on accepted GR(GR is transfered form MM per program RPODDELVRY and my system has implemented note#1351489) , the SUS invoice tax code in item is default from SUS customizing, but not from MM-PO item tax code.  On the other hand, the tax amount is always zero even if  i change the tax code and press "update price".
    So then i press "send" to transfer SUS invoice to MM, system jump following 2 error messages:
    Errors:Error in parameter transfer ( Item 1 )
    Errors:Active status of document SUS Invoice 5000000035 is Incomplete . No changes are possible.
    My SRM Server release 701, and business scenario is MM-SUS
    In MM: customizing OBCA/OBCD/OMRY  is completed
    In SUS:customziing SRM server -> cross application basic settings -> tax calculation is completed.
                1.determine system for tax calculation --> R/3 tax calculation occurs in backend
                2.enter tax code --> I1 = 17% default sales tax, I2 = 13% sales tax
                3.Assign enterprise buyer tax code to FI system -->  I1 = MM J1 , I2 = MM J2
    Please advise what's the sulotion, thanks.
    Regards
    Joseph Chen
    Edited by: chshix_1980 on Mar 30, 2010 5:56 AM
    Edited by: chshix_1980 on Mar 30, 2010 6:05 AM

    Hello ALL,
    I am also facing same problem, although on different version SRM 7.0 SAPKIBKV06
    We are having issues as stated below....
    1) Tax code in PO line item should be defaulted while processing SUS Invoice.
    As per the current behaviour SUS invoice tax code in item is defaulted from SUS customizing, but not from MM-PO item tax code.
    2) In SUS Invoice the tax value is not getting populated even though the setting in IMG is R/3 tax calculation occurs in backend and for this all relevanat attributes related to purchasing org. BUK and ACS are maintained under PPOMA.
    3) Finally when I try to post the invoice in SUS system get the below error message
    Errors: Error in parameter transfer ( Item 1 )
    Errors: Active status of document SUS Invoice 5000000XXX is Incomplete . No changes are possible.
    All the relevant config is maintained
    In MM: customizing OBCA/OBCD/OMRY  maintained
    In SUS:customziing SRM server -> cross application basic settings -> tax calculation maintained.
    Appreciate your quick reply,
    Thanks,
    YR

  • Withholding tax code and Withholding tax type relation

    Hi All,
    Here is my requirement:
    I need to get the WT code description for the tax codes I get in BSIS (BSIS-QSSKZ). The problem is when I try to get the same from T059ZT, I need to have the two key fields WITHT (Indicator for withholding tax type) & WT_WITHCD (Withholding tax code).
    But from BSIS I am having only the field QSSKZ (Withholding Tax Code)and not the WT type.
    I need to know, how can I get the WT type based on WT code? I tried WITH_ITEM but its of no use, as it has both these fields as key fields.
    Thanks in advcane.
    Anand

    Hi,
    Hi,
    I am working on an enhancement for withholding tax.
    The withholding tax base has to be calculated in the exit.
    I found that MRM_WT_SPLIT_UPDATE is the badi which can be implemented and can contain the logic for the calculation.
    The transaction MIRO calls this BADI.But I need to call the BADI even for FB60,FB65,F-43,F-41 and F10.Is this part of configuration.Please let me know how to enhance the withholding tax calculation.
    Thanks,
    guest

  • Problem with credit memo and withholding tax

    Please, I need your help:
    I have tried   pay some invoice,  each one does not exceed the minimum amount for Withholding Tax ,  but the adding of them exceed the Max Amounts for Withholding Tax Codes. For this I am using   u201CBase exempt amt check at pymt doc level u201C and It works, the problem is when I have a credit memo the system does not work well subtracting withholding tax

    Dear,
    please kindly open a message into Your market place for for such a problem. You need a fix.
    Thanks.
    Mauri

  • E52 - problem with lock code and bluetooth connect...

    I have an E52 as my work phone, and due to company security policy, a lock code and autolock (30 minutes max) is mandatory. This is giving me problems when using bluetooth headsets, regardless of the make (Plantronics, my Garmin GPS, and latest the built in Fiscon in my car). As long as the phone is not locked, everything works fine, I can make and receive calls. But, when the phone locks, I am no longer able to make calls. In the car (both on the GPS, and on the built in connection) I can still browse the phone book and select a number, but when I attempt to dial, nothing happens.
    If I enter my lock code, I can make calls without problems. However, it sort of defies the purpose of having a rather expensive hands free kit in my car, if I can only make calls the first 30 minutes of my ride.
    Is this a known problem, and is there a solution?

    This is not a problem as such, more of a design flaw.  It is not possible to make a call when the phone is locked, I guess the only way around the issue is just to press a button on the phone every now and then.  Say every 15 to 20 mins just push the menu button or any button randomly, that should reset the timer back to 30 minutes until it is locked next.
    Hope this helps.
    Everything should be made as simple as possible, but not simpler.
    Nokia E7-00
    Click the white star if you think I helped you please

  • A difficult problem with php code and sql code

    it's good place to visit(Paged Result Sets with PHP and Oracle)
    http://www.oracle.com/technology/pub/articles/oracle_php_cookbook/fuecks_paged.html
    maybe below part php code could not be used in above address's php code.
    if((isset($l_company) and $l_company != $rows['COMPANY']) or empty($stmt) and empty($total_pages) ) {
    echo "<tr bgcolor='#CCFFCC'>";
    echo "<td colspan= 3 align='center'>".$l_company."</td>";
    echo "<td >".$totalcomany." </td>";
    $totalcomany = 0;
    echo "<td > </td>";
    echo "</tr>";
    $l_company = $rows['COMPANY'];
    because the same company in one page could calculate sum while if
    the same company in two pages could not do that.
    and what do you think of ?
    thanks !

    Hi,
    this is because your sql-statement selects only the rows, you need to build this one page.
    Neither php nor the given result from your query knows about data wich will be part of the result of another page.
    Greetings from Hamburg
    Thorsten Körner

  • HT5213 update a book, problem with isbn code and paid

    if i update a paid book , the user can download free the new version as if  it were an app on the App Store ? for a minor update for bug fix i need a new isbn code or i need a new isbn code only for a major version ?

    Yes, customers can download the new version free of charge. However, there is no mechanism in the store to tell them that a new version is available.
    You don't need a new ISBN for minor (and even fairly major) fixes. Whether to issue a new ISBN for a book update (such as a 2nd editition) is up to you. It is common to have even major fixes to books (such as for a 2nd "printing") without issuing a new ISBN.
    Michi.

  • Tax amount and sales tax code fields not visible in tcode MIR4

    Hi,
    A workflow has been cretaed for cretaing the invoices. Here in SRM invoice, the tax code and Sales tax code fields are not visible in tcode MIR4 though data has been passed while creating it.
    When i am checking the "calculate tax" check box, am able to see these two fields on the MIR4 page.
    Am not able to find the reason for this behaviour. As its working fine for other invoices. This is the case with only SRM invoice.
    Kindly provide your inputs.
    Thanks!
    Regards,
    Razia Shaheen.

    Hello,
    What you are saying is that the Invoice coming from SRM (Via Idoc i supose) is not bringing the tax code? is that it?
    Cheers !

  • Create New Tax code and condition types

    hi experts,
    i want to create new tax code V10 and new condition types ZWKT and ZSTX under V10.
    i have a requirement that is create service general Purchase Order with following tax conditions
    1. Work Tax 4% on 70% of Bill Amount.
    2. Service Tax 12.36% on 33% of Bill Amount.
    while creating PO when user select ZWKT and ZSTX, system should calculate 4%( on 70%) and 12.36% (on 33%) and place the tax amount on relevant fields automatically.
    ( i tryed with tcode:FTXP and created tax code(country key: IN, procedure: TAXINN and taxtype: V input tax) but problem with assigning condition types and calculation procedure)
    please help me in this issue (step by step).
    Thanks.
    srinu.

    Hi,
    Here you have to create two dummy condition type for Base Value. One for Service Tax and other one for Work Tax.
    Then create two condition type for Work Tax & Service Tax.
    Ex : Work Order Base Value condition type is "A"
    Service Tax Base Value condition Type is "B"
    Work Order Tax condition Type is "C"
    Service Tax condition type is "D"
    In Pricing procedure just add all the above condition type as below
    Both Base Value condition type will be calculated from System Base Value  & in FV11 maintain the Base Value percentage against the Tax Code & Condition Type as per ur req (70% for Work Tax & 33% for Ser Tax)
    Work Order Tax & Ser Tax will be calculated from respective Base Value. In FV11 just maintain the tax %.
    Sangram

  • Bapi_Acc_Document_Post - E 018 : Invalid tax code and company code combination

    Hi All,
    I need the help of this forum once again.
    I am using bapi Bapi_Acc_Document_Post to create KR documents in SAP. The bapi works absolutely fine except for one scenario:
    For a particular type of invoice coded to Company "XXXX" with lines having tax code "I0", the bapi returns error message "E 018 : Invalid tax code and company code combination". The tax code "I0" and the company code "XXXX" has been mapped in SAP and if I try to create the invoice manually in SAP using the GUI, the invoice gets created without any issue.
    I have tried searching the forum but could not find any post on this topic.
    Therefore, requesting the masters to please help me out on this.
    Best Regards
    Sutirtha Roy

    Hi Gowthami,
    how have you solved your problem, because I am facing the similiar issue and trying desperately to post the following combination with BAPI_ACC_POST_DOCUMENT:
    001 40       490100     Aufw. aus Marge PP              R2                 15,92
    002 31       10000003   Kreditor                                R2                 15,92-
    003 50       175060     Abzugsverfahren USt            R2                  3,18-
    004 40       154060     Abzugsverfahren Vst             R2                  3,18
    THANX!
    Regards
    Marko

  • Tax Code and Tax Amount Fields are not appearing

    Hi to all,
    While making Downpayment Request (F-47) Tax Code and Tax Amount Fields are not appearing in the screen.
    for more clarity...
    suppose PO is 1150 include all taxes ( Amount 1000+ Tax Amount 150)
    as per agreement with vendor we need to raise DR for 1150 and based on DR we will make downpayment to vendor (F-48)
    But in F-47 screen Tax Code and Tax Amount fields are not appearing.
    Could any body help me on this??
    Thanks in Advance
    Regards,
    Schilukuri

    why you are looking for tax code field, pay gross amount as per PO, same amount will update in PO history as well as Vendor account.
    Even if you find the tax code field and check the tax code check box, system will not calculate tax  at the time of down payment or down payment request.
    Please remember that by default standard SAP provides the tax code field in f-47 or F-48.

  • Deafult tax code and tax jurisdiction per vendor

    Hi,
       We are using tax jurisdiction in Process,  now while creating Po every time according to vendor we have to enter the tax jjurisdiction and tax code ,  i s there any mwthod  with which we can set default tax code and tax juridiction code as per vendor  means we want to maitain as per vendor code, so that  for eah item i n that PO , tax code and jurisdiction code will come automatically.
    I have also check by making the tax jurisdiction code mandatory in Vendor master , in vendor master i have added tax jurisdiction for the vendor  but while creating PO, system is not selecting the tax jurisdiction automatically.
       regards,
        zafar
    Edited by: zafar_karnalkar on Jun 4, 2010 6:18 AM

    Hello,
    Tax Jurisdiction code will be determined from the plant. Please check your Plant/Site Master. SAP provided a BADI  ME_TAX_FROM_ADDRESS also to redetermine Tax Jurisdiction code based on custom logic.
    For Tax codes, you have to maintain condition records for condition type NAVS using MEK1. There are many standard access sequences available to maintain this. You may also build custom one if needed. 
    Thanks,
    Venu

  • Reg Tax Codes and Plants

    Hi Gurus,
    1) I am creating a PO. It doesnt have a Material as it is a text req converted to PO. I am having 10 plants which uses various Tax codes which will auto populate according to the plants. Now my requirement is i want to populate a tax code (XX) for 8 plants i am using and (YY) for 9th Plant and (ZZ) for 10th Plant.
    I dont have a material number. But i am having a Vendor Number, a Plant. We are not creating the PO's manually. This will be done by a Batchjob, so manually entering is also not possible.
    2) Also i want to overwrite the Tax code which is populating automatically with the Tax code from PIR. Please advice where we will be maintaining the Config for Tax Code and Plant/Company code.
    Please advice on this issue and how to proceed further.Thanks for your help in advance.
    Thanks,
    Sakkithyan

    Hi,
    If you want to default the tax code in the purchase order then create info record using transaction ME11..
    If you want to default tax code in MIRO then do it using transaction OMR2..
    Regards,
    Chintan Joshi

  • Tax Code and Description

    Hello All,
    We are making a customized report based on vendor invoices.
    1) Need to know tables or logic where we can find/pull out tax codes and its description.
    2) When invoice is posted value goes to GR IR account, from which table i can get the GR IR value.
    Regards
    Himanshu Nijhawan

    Hi Himanshu,
    1) Need to know tables or logic where we can find/pull out tax codes and its description.
    You can find the Tax code in RSEG Table for the Vendor Invoice. Specify the Document No & Year, you will get the tax code in the field RSEG - MWSKZ
    Tax code Description can be obtained in the Table T007S. Specify Tax Code and Language as well to get the description
    2) When invoice is posted value goes to GR IR account, from which table i can get the GR IR value.
    For this, first you should get the Account document corresponding to the Invoice. So, Query table BKPF with the following fields to get the accounting document
    Company Code
    Year
    Object Key (AWKEY) = Your Invoice No + Year (Concatenated Value for eg., 51000000002012
    you will get the Accounting Document No in the field BKPF-BELNR
    WIth the Accoutning Document & Year, query the table BSEG to get the GR/IR accounting posting. Generally the GR/IR is posted with Posting Key 86 (BSEG-BSCHL)
    Regards,
    Rama

  • Diff. between Tax Code and Condition Types

    Hi,
    What is the diff. between Tax Code and Condition Type???
    Why we maintain Tax Codes under Invoice Tab in PO, when Condition Types are available for Calculation Procedure...???
    Please guide..

    hi..
    Tax code : Tax code in some what more specific for calculating the tax...some material is having 2% tax..some having 3 % tax..etc..and these are input tax...so..these tax code will be of type input tax..
    now..based on the nature of tax type amount will be calculated....
    suppose tax code is calculation of 2 condtion type so ..we can do it in tax code conditon record fv11 also..
    so..tax code can be a combination of cond type...
    where as through cond type also we can also achieve this..by using one statistical cond type...
    Cond Type :  cond type is for the daily pricing configuration..how system will calculate the price for a centain material we can make define the rules here...
    Try this out..
    Thans

Maybe you are looking for

  • Process Context changes (.XSD) are not refreshed in the Task Mapping

    Hello, I'm adding new attributes to the .XSD but the changes are not refreshed in the mapping section of the tasks. How can I refreshed these changes? Best Regards SU

  • 40 GB large folder in User/Library/Mail

    Hi, my 2 accounts which has aproximately on gmail.com about 2,5 GBbytes has in my computer crazy 40 GBytes? Why the ****? I'm using IMAP, all folders are set properly, no folders which are not in gmail accounts are in my MAIL application!!! I hope, t

  • UCCX - abandoned calls marked as handled contactinactiveexception

    Hi I have a UCCX 8.5 script - at the start of the script it uses the IF contactinactiveexception exception occurs go to - which then goes to a label which clears the exception and then marks the call as handled What I have noticed is that this step i

  • Fact to Fact Relationship urgent!!!!!!!

    Let us suppose there are 2 dimensions and 2 facts and every dimension is joined with every fact and there is no relation between two facts while selecting columns from both the facts with any dimension column its involving only one fact, we found one

  • Ipad is geblokkeerd/blocked

    Nederlands onderstaand... After an update of ios and an application by the computer for cloud (he refused) had my father on his Ipad set a ww 4 characters ... He did and then shut the computer off The next day he wants to start, and the verb is not r