How to filter withholding tax types in MIRO based on Purchase Order category?

I need help with customizing withholding tax display during invoice verification. When processing invoices through MIRO transaction, our system shows all withholding tax codes configured for a supplier. However, business users want to see only specific tax codes that match the Purchase Order category being processed.

* Current behavior: All supplier tax codes appear
* Desired: Filter by document type
DATA: lv_po_category TYPE char4,
      lt_tax_codes TYPE TABLE OF mwskz.

SELECT SINGLE bsart INTO lv_po_category
  FROM ekko WHERE ebeln = gv_purchase_order.

IF lv_po_category = 'ZSER'.
  " Show only service-related taxes
  APPEND 'T1' TO lt_tax_codes.
  APPEND 'T5' TO lt_tax_codes.
ENDIF.

For instance, when a supplier has tax types T1, T5, T8, T9 configured, but the PO category should only allow T1 and T5 to appear in the withholding tax tab.

I attempted using enhancement points MRM_WT_CALCULATION and MRM_DOCUMENT_CHECK but couldn’t achieve the filtering.

Any suggestions on the correct approach? We’re running on S/4HANA system.

I had the same issue last year. Those standard enhancement spots won’t give you proper timing for this filtering. What actually worked was using the MRM_WITHHOLDING_TAX BADI - it has much better access to document context during invoice processing. Use the FILTER_WT_TYPES method where you can grab both PO data and the supplier’s withholding tax types. Then just build your filtering logic based on PO category like your code shows. Make sure you return the filtered tax codes properly so MIRO only shows relevant options. Watch out though - this BADI gets called multiple times during processing, so keep your logic efficient. And definitely test with different PO categories to make sure filtering works consistently across all your document types.

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.