How to filter withholding tax types in MIRO based on purchase order category?

Hey everyone, I need some help with a SAP requirement. We’re working on customizing the MIRO transaction and running into an issue with tax filtering.

The Problem:
When processing invoices through MIRO, the system shows all withholding taxes configured for a supplier. However, our business wants to limit which taxes appear based on the purchase order category being used.

Current Situation:
For instance, when we process a vendor invoice, we see EH tax codes like 02, 05, 08, and 09 appearing in the withholding tax section. But depending on the PO category, we only want specific ones to show up - maybe just 02 and 05 for certain order types.

What I’ve Tried:
I attempted using enhancement points MRM_WT_SPLIT_UPDATE and MRM_HEADER_CHECK but couldn’t get them to work as expected. The filtering isn’t happening.

Environment:
We’re running on S/4HANA system.

Has anyone dealt with similar requirements? Any suggestions on the right approach or different BAdIs that might work better for this scenario?

Thanks for any guidance!

try usin BADI MRM_WITHHOLDING_TAX, it worked better for us than those enhance points. also, check ur PO category config in SPRO for withholding tax - there might be a standard way to filter without messin with custom code.