Hi
I believe you need to use userexits (see 1464839 - How to customize credit control in transaction OVA8 using checks USER 1, USER 2 and USER 3). Refer to subroutine open_item_check as a template (and add/modify the ABAP code according your requirements) and save your parameters in a customer table you can update with transaction SM30.
I hope this helps you
Regards
Eduardo