Modify Payment Hold Status through SAP Programming Methods in MIRO Transaction

I need help with updating payment hold settings programmatically

I’m working on a project where I need to modify the payment hold status for invoices in SAP. Currently I can see this field in the MIRO transaction screen, but I want to automate this process instead of doing it manually every time.

Is there a way to update this payment hold indicator using programming methods? I’ve been looking into different approaches like:

  • Using standard BAPIs
  • Calling function modules directly
  • Writing custom ABAP code
  • Batch input methods

Has anyone successfully implemented something similar? What would be the best approach to change this field value automatically through code? I’m open to any suggestions or examples of how to accomplish this task.

Any guidance would be really helpful since I’m stuck on this requirement and need to deliver a solution soon.

Had the same issue last year. BAPI_INCOMINGINVOICE_CHANGE worked best for me. Just populate the PAYMENTDATA structure and set PMNTBLOCK to whatever payment block you need. Don’t forget to handle the return messages and call BAPI_TRANSACTION_COMMIT when it works. Here’s a gotcha - some invoice statuses won’t let you modify them. Check the document status first with BAPI_INCOMINGINVOICE_GETDETAIL. I tried BDC as backup when the BAPI hit limits, but it’s a pain to maintain since screen changes break your code. Stick with BAPI - better error handling and way more stable across different SAP versions.

you could try using change documents through FM CHANGE_DOCUMENT_READ, then update BSIK/BSAK tables directly. it’s risky since you skip validations, but i’ve seen it work when standard methods fail due to custom workflows. just make sure you update both document and index tables - otherwise your data won’t match up. test it thoroughly in sandbox first!

Function module INVOICE_PAYMENT_BLOCK_CHANGE is another solid option. I used this about 6 months ago when BAPIs weren’t handling our specific business logic right. The module gives you better control over the payment block field and handles validation internally. You pass the invoice document number and company code, then set your target payment block value. It’s better than MIRO batch input because it follows all standard SAP validations without screen dependency problems. Performance was decent for bulk updates in background jobs. Just make sure your authorization object F_BKPF_BUK is set up correctly or you’ll hit authorization errors. Test it thoroughly in dev first since payment blocks directly affect vendor payments.