cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_INCOMINGINVOICE_CREATE withholding tax code

former_member538160
Participant
0 Kudos

Hi all,

we developed one z program to do the miro using bapi_incominginvoice_create,

But here my problem is i need to populate the withholding tax, for this thing i used the below code.

if withtaxdata[] is initial.

withtaxdata-SPLIT_KEY = '1'.

withtaxdata-WI_TAX_CODE = 'G9'.

withtaxdata-WI_TAX_TYPE = 'G9'.

withtaxdata-WI_TAX_BASE = amount."p_base.

append withtaxdata.

endif.

CALL FUNCTION 'BAPI_INCOMINGINVOICE_CREATE'

EXPORTING

headerdata = headerdata

IMPORTING

invoicedocnumber = invoicedocnumber

fiscalyear = fiscalyear

TABLES

itemdata = itemdata[]

  • taxdata = taxdata[]

WITHTAXDATA = withtaxdata[]

vendoritemsplitdata = vendoritemsplitdata[]

return = return2[].

with this code iam able to create the invoice. but if go and see the invoice, withholding tax value is zero but iam able to see the

tax type and code there, so why its not picking the base value which i passed from bapi.

Please guys do reply me, <removed by moderator>

Edited by: Thomas Zloch on Nov 23, 2010 4:22 PM - priority normalised

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member

Hi,

I have same the problem and solution was below:

Fill HEADERDATA-DIFF_INV with same ITEMDATA-FREIGHT_VEN(Vendor).

WITHTAXDATA-SPLIT_KEY = '000001'

WITHTAXDATA-WI_TAX_TYPE = 'R1'

WITHTAXDATA-WI_TAX_CODE = '03'

WITHTAXDATA-WI_TAX_BASE = '200.000'

Tax type and Tax Code get in table LFBW in level Vendor and Company Code.

TimMuchena
Participant
0 Kudos

hi

How did you get the base amount?

Kind regards

0 Kudos

Based on the code snippet you provided, it seems that you are populating the withholding tax data correctly and passing it to the BAPI function 'BAPI_INCOMINGINVOICE_CREATE'. However, you mentioned that the withholding tax value is showing as zero in the created invoice.

One possibility for this behavior is that the base value you passed for the withholding tax calculation is not correct or is not being recognized by the system. You may want to verify that the value you are passing as 'p_base' is valid and appropriate for the tax code you are using.

Another possibility is that there may be some custom settings or configurations in your system that are affecting the calculation of withholding tax for incoming invoices created through BAPI. You may want to consult with your system administrator or SAP consultant to check if there are any such configurations that need to be adjusted or customized for your scenario.

Finally, I would like to remind you that it is not recommended to share sensitive or confidential information, such as system details or program codes, in public forums like this. Please be mindful of security and privacy concerns while seeking help online.

tiago_encarnacao
Explorer
0 Kudos

Olá,

Você precisa enviar todos os impostos referentes ao fornecedor na tabela WITHTAXDATA.

Busque os impostos na tabela LFBW com LIFNR e BUKRS, crie as linhas da tabela WITHTAXDATA com SPLIT_KEY, WI_TAX_TYPE e WI_TAX_CODE, mesmo que deixe os campos de valor vazios.

Você pode consultar o imposto retido na fonte na tabela RBWS.

*SPLIT_KEY, WI_TAX_TYPE são campos chave e não devem se repetir.

      LOOP AT lt_lfbw INTO DATA(ls_lfbw) WHERE lifnr EQ lv_lifnr AND bukrs EQ lv_bukrs.
APPEND INITIAL LINE TO lt_withtax ASSIGNING FIELD-SYMBOL(<fs_taxdata>).
<fs_taxdata>-split_key = 1.
<fs_taxdata>-wi_tax_type = ls_lfbw-witht.
<fs_taxdata>-wi_tax_code = ls_lfbw-wt_withcd.
IF ls_lfbw-wt_withcd EQ '03'.
<fs_taxdata>-wi_tax_base = '200'.
ENDIF.
ENDLOOP.
Former Member
0 Kudos

Hi

The system should calculate the withholding tax as soon as the invoice is payed, so it can be right you can't see its value after posting the document

Max

former_member538160
Participant
0 Kudos

Hi max,

After posting the invoice, if i go and see in mir4 t-code iam not able to see the with holding tax value, but if i manualy go and do the same thing using miro t-code, after posting doc, iam able to see the with holding tax value there in that invoice.

And another thing is now system is picking the with holding tax code from vendor master.

Former Member
0 Kudos

And another thing is now system is picking the withholding tax code from vendor master.

This is the normal behavior

G9/G9 is withholding tax code of vendor?

Max

former_member538160
Participant
0 Kudos

HI MAX,

Yes G9/G9 is the with holding tax code for vendor.

see when u normally post a invoice from f-43 for a vendor, system automatically picks tax code from vendor master and calculate the tax right.

now in my case iam posting invoice from bapi_incominginvoice_create.here iam able to post the invoice but iam not able to populate invoice with withholding tax value .