I need help with customizing the MIRO transaction. When processing invoices for suppliers, the system shows all withholding tax codes that are configured for that vendor. However, my company wants to limit these tax codes based on the purchase order category.
For instance, when a vendor has withholding tax types 02, 05, 08, and 09 configured, but the PO category should only show types 02 and 05 in the withholding tax section.
I attempted to use enhancement spots MRM_TAX_CALCULATION and MRM_VALIDATION_EXIT but they don’t seem to work for this requirement.
The goal is to hide certain withholding tax lines and display only the relevant ones for the specific purchase order category.
We are running on S/4HANA system. Has anyone implemented similar functionality? Any guidance would be appreciated.
have u looked into the badi MRM_WITHHOLDING_TAX? it gives more control over tax codes. u might need some custom logic to filter them by PO category. we tried this approach for a similar issue, but be ready for some debugging to make it work.
I had the same issue last year. Ended up using a user exit plus some config changes to solve it. The trick was tweaking the field selection in tax determination through the customization tables. Check out transaction FTXP for withholding tax setup - you can create category-specific rules there. Also grab enhancement MM06E005 which lets you access PO data during invoice processing. We built a custom table that maps PO categories to valid tax codes, then called it from the enhancement. The tricky bit was making sure the filtered codes still validate correctly when posting. Test the hell out of it in dev before pushing to prod - tax calc stuff can be finicky.
You’ll want to use MRM_INVOICE_ITEM_BADI with some custom config. We had a similar issue when setting up category-based tax filtering for our German subsidiary. The trick is catching the tax determination process before it fills the screen fields. Here’s what worked for us: built a custom function module that pulls the PO category from EKPO and cross-checks it against a config table we created to store allowed tax codes per category. Called this from the BADI to modify tax code selection on the fly. The tricky bit was making sure the filtered codes still passed validation during document posting. I’d also check if your withholding tax setup in OBCL already supports category-based restrictions before going custom. Test it hard with different PO types and vendor combos.
Check the enhancement point MRM_INVOICE_VALIDATION instead of those spots. We did something similar by modifying the tax code dropdown on the fly. Just create a Z-table that links PO categories to allowed tax codes, then filter the internal table before it hits the screen. Worked fine on our S/4 1909 system, though you’ll need some tweaks for newer versions.