VOFM Routines - aidamate13/AMS-Knowledge-Base GitHub Wiki

VOFM routines in SAP are custom ABAP routines used primarily in the Sales and Distribution (SD) module to modify or extend standard SAP functionality. The purpose of these routines is to allow for custom logic in key processes such as pricing, output determination, and copying controls, making them highly useful for tailoring SAP to meet specific business needs.

Key Purposes of VOFM Routines

1. Custom Pricing Logic:

  • VOFM routines are often used to create custom pricing logic in the pricing procedures of SAP SD.
  • You can define specific conditions or calculations that affect how prices are determined for sales documents (e.g., sales orders, invoices). For example, you might create a routine to apply a discount only if certain conditions are met, or to calculate a surcharge based on custom criteria.

2. Output Determination:

  • VOFM routines can control when and how output (e.g., printouts, emails, EDI messages) is generated in sales processes.
  • You can define custom logic for output determination, ensuring that outputs are triggered based on specific conditions or rules.

3. Copying Control:

  • These routines are used in copying controls, which manage how data is copied from one document to another (e.g., from a sales order to a delivery document).
  • Custom routines can be written to modify how fields are copied, to add additional validation, or to apply custom logic during the copying process.

4. Requirements in Pricing:

  • VOFM allows the creation of "requirement routines" that control whether a particular condition type should be considered during pricing.
  • For instance, you can write a requirement routine that checks specific criteria, and if those criteria are not met, the condition type will be ignored in pricing calculations.

5. Alternative Calculation Types:

  • These routines enable the creation of alternative formula routines for conditions in pricing procedures.
  • This is useful when the standard calculation logic provided by SAP does not meet specific business requirements.

6. Alternative Condition Base Value:

  • Allows customization of the base value used for condition calculations in pricing.
  • A VOFM routine can be written to modify the base value according to specific rules, which will then be used in subsequent pricing calculations.

Routine Activation

Understanding what actually happens when VOFM routines are activated or deactivated is useful knowledge, especially when problems occur and debugging is required. In the following screen shots, routine 900 will be deactivated to demonstrate the process.

image image

Transport issues with VOFM routines are so common, that SAP has provided utility programs to aid in the repair process. Program RV80HGEN can be used to re-generate all VOFM routines. Whenever VOFM routines are transported, this program should be executed in all target systems. It is possible to include an automatic execution of the program in the transport request by applying OSS note 598475.

image

image

Complete guide can be found --> http://saptechsolutions.com/pdf/InsideVOFM.pdf