cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Withholding Tax in NFe Sytem inbound

jaqmeireles
Explorer
0 Likes
622

Guys,

we have vendors which provide service and goods,as in the master data there are withholding tax information, when the nota fiscal is posted through NFE system, the accounting document is generated with withholding tax.

Is there any way to avoid this?

Accepted Solutions (0)

Answers (2)

Answers (2)

leandropia
Contributor

Jaqueline,

Dê uma olhadinha na OSS Note 2531820 - Vendor used for services and material WHT on both scenarios pois ela contém a solução encontrada pela SAP para tratar exatamente do assunto que você está procurando ajuda. Não é a melhor solução do mundo mas "é o que tem pra hoje", caso você não queira considerar um desenvolvimento.

Leandro da Pia Nascimento

soned_soned
Participant
0 Likes

Hello,

There is a BADI in function FI_WT_INITIALIZATION (change_wt_badi->CHANGE_WTAX_CODE). You can control the behavior of withholding taxes.

I'll paste some code that i used. You might adapt it for your needs.

Regards.

DATA callstack TYPE sys_callst.


DATA vl_j_1bindust TYPE ekpo-j_1bindust.


DATA: it_ekpo    TYPE STANDARD TABLE OF ekpo,
      it_invoice TYPE STANDARD TABLE OF j_1bnfe_invoice.


FIELD-SYMBOLS: <xmlpo>    TYPE STANDARD TABLE,
               <wa_xmlpo> TYPE j_1bnfe_invoice,
               <with_tax> TYPE WITH_ITEMX.


CALL FUNCTION 'SYSTEM_CALLSTACK'
  IMPORTING
    et_callstack = callstack.


READ TABLE callstack WITH KEY progname = 'SAPLJ_1B_NFE_IN' TRANSPORTING NO FIELDS.


IF ( sy-subrc = 0 ) AND ( is_with_item[] IS NOT INITIAL ).
  ASSIGN ('(SAPLJ_1B_NFE_IN)GT_XMLPO[]') TO <xmlpo>.


  IF sy-subrc = 0.
    LOOP AT <xmlpo> ASSIGNING <wa_xmlpo> CASTING.
      APPEND <wa_xmlpo> TO it_invoice.


    ENDLOOP.


    SELECT *
      FROM ekpo
      INTO TABLE it_ekpo
      FOR ALL ENTRIES IN it_invoice
      WHERE ebeln = it_invoice-ebeln AND
            ebelp = it_invoice-ebelp.


    IF sy-subrc = 0.
      LOOP AT it_ekpo TRANSPORTING NO FIELDS WHERE j_1bindust <> '04'.
        LOOP AT is_with_item ASSIGNING <with_tax>.
          CLEAR <with_tax>-wt_withcd.


        ENDLOOP.
*        REFRESH is_with_item[].
        EXIT.


      ENDLOOP.


    ENDIF.


  ENDIF.


ENDIF.