Creating a Business Rule for SAP VIM Solutions Beyond Invoice (+ free Template)

This article is intended for informational purposes only and does not supersede or replace the official documentation provided by OpenText. It serves as supplementary guidance to assist with common challenges that may arise during installation and upgrades. For authoritative instructions and compliance requirements, refer to OpenText’s official documentation.

Please note that this article is not about the VIM Invoice process but VIM Solutions Beyond Invoice which is, for example, used to process sales orders, quotations, remittance advices, order confirmations or fully custom document processes (including capture & recognition using OpenText Intelligent Capture for SAP Solutions [IC4S]).

VIM Solutions Beyond Invoice is formerly known as Business Center and sometimes referred to as VIM Beyond.

Similar to the invoice process, the document process in SAP VIM Solutions Beyond Invoice is made up of data enrichments, roles, business rules and actions. In today’s article, I will show you how to quickly and easily create and configure an individual business rule. I also provide my template which allows an easy start for your new business rule.

Creating a Business Rule class

Create a new class using superclass /OTX/PF04_CL_MODULE. You can use for example SE24 or SE80 to achieve this.

/OTX/PF04_CL_MODULE

To implement a business rule you must redefine method /OTX/PF04_IF_MODULE~MODULE_EXEC_CHECK.

/OTX/PF04_IF_MODULE~MODULE_EXEC_CHEC

In earlier versions, data was changed with the help of business rules. This is becoming obsolete today and should therefore be avoided. Business rules check data, data enrichments change data. It is easy to convert old business rules into data enrichments.

As a starting point you can use my business rule template:

ABAP
   METHOD /otx/pf04_if_module~module_exec_check.

    DATA: ls_plh   TYPE z01ca_otx_bc_plh, " header table
          lt_pli   TYPE TABLE OF z01ca_otx_bc_pli, " line item table
          lv_pos   TYPE c LENGTH 10, " line item position for messages
          ls_msg   TYPE SYMSG. " message

    FIELD-SYMBOLS: <fs_pli> TYPE z01ca_otx_bc_pli. " line item table

    ls_plh = pis_plh.
    lt_pli = pit_pli.

    pe_mod_run_status = /otx/pf04_if_category=>mc_run_stat_success. " set rule to successful initially

    LOOP AT lt_pli ASSIGNING <fs_pli>.

      CLEAR: lv_pos, ls_msg.
      
      "[...] logic
      
      " pe_mod_run_status = /otx/pf04_if_category=>mc_run_stat_failed. " set rule to failed 

      ls_msg-msgty = 'E'.
      ls_msg-msgid = 'Z...'.
      ls_msg-msgno = 123.  
      ls_msg-msgv1 = 'This rule always fails..'.
      "[...]

      APPEND ls_msg TO pet_mod_msg.
    ENDLOOP.

  ENDMETHOD.

Customizing for a SAP VIM Solutions Beyond Invoice Business Rule

Now we have created the class for our business rule and have to create the corresponding customising, which can be done very quickly in the transaction /otx/pf00_img.

/otx/pf00_img

Navigate to Process Configuration > Profiles:

Select your Profile Configuration and navigate to the corresponding Version > Characteristic Configuration and select Process Steps. Select the process step where you want to add the business rule, then navigate to Rules.

When creating the rule, it is important that the rule type here is CHK. Change (CHG) rules are obsolete and have been replaced by data enrichments. Your business rule should not change any data.

Don’t forget to activate the active checkbox on the right-hand side of the screen, as this can easily be overlooked depending on the screen resolution.

Basically, the rule is now active and can be tested. In Customizing, however, you still have to decide which role can skip which rules in which step. Depending on the number of steps and roles, this can be quite extensive:

In general, the simulation of each step should be allowed in all steps and the skipping of rules should also be permitted.

Final Thoughts: Less Is More

When crafting business rules for non-invoice scenarios in SAP VIM, it’s tempting to add a high number of rules to check every possible scenario. But complexity can lead to confusion of the end users and slow performance.

Focus on the minimal rules that truly matter—clearly defined conditions, straightforward actions, and well-documented workflows. It can also make sense to group multiple checks into one business rule to declutter the workspace. For example the rule missing material number and invalid material number can be combined into one rule.

By keeping it simple, you’ll speed up maintenance, reduce errors, and allows you to adapt more quickly when requirements change.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *