Copy Control
SD / O2Cintermediate

Copy Requirements and Data Transfer Routines (VOFM) in Copy Control

Understand how VOFM copy requirement routines and data transfer routines at header and item level enforce business rules and control field mapping during document copying.

Explanation

Copy control tables define which source document types can create which target document types, but the actual business logic that decides whether copying is allowed, and exactly how fields are transferred, lives in VOFM routines. There are two distinct routine categories relevant here: copy requirements (also called requirement routines) and data transfer routines. Copy requirements are boolean checks executed before the copy happens. At header level, a requirement routine can block copying entirely, for example preventing a quotation from being copied into an order if the quotation has expired, or preventing a credit memo request from referencing a billing document that belongs to a different sales organization. At item level, requirement routines can exclude individual items from being copied, which is common when certain item categories or rejected items should not flow forward. Standard SAP delivers a range of numbered requirement routines, and configuration assigns a specific routine number to each source-target combination in the copy control item detail screen. If no delivered routine fits, an ABAP developer creates a custom routine in the VOFM routine maintenance environment, following the standard form interface so it can be selected from the same dropdown used for standard routines. Data transfer routines execute after the requirement check passes and control the actual field-by-field copy behavior. At header level, a data transfer routine typically populates header fields such as payment terms, incoterms, or sold-to references, and decides whether to redetermine them or retain the source values. At item level, the data transfer routine is where quantity handling, pricing type, and copied versus redetermined fields are controlled. A key parameter in the item-level configuration is the pricing type, which is a separate but closely related setting: it tells the system whether to copy pricing conditions unchanged, redetermine all conditions from scratch, or copy conditions but redetermine taxes and freight. The pricing type interacts with the data transfer routine because the routine may explicitly force a pricing type override for specific scenarios such as returns processing, where original pricing must be preserved for reference even though a fresh sales order pricing run would normally occur. Schedule line level also has its own copy control settings, primarily controlling how requested delivery quantities and dates transfer from order to delivery, and whether the schedule line category itself is redetermined by the target document's own determination logic rather than copied verbatim. Because these routines are cross-client, shared ABAP objects maintained through VOFM, any change is a technical development activity that requires transport management, unit testing across all copy control combinations that reference the routine, and careful regression testing because a single custom routine can be referenced by dozens of source-target pairs. Consultants configuring copy control must always check which routine number is assigned before assuming standard behavior, since the visible copy control table only shows a number, not the logic itself; reading or requesting the routine's source is often necessary to explain unexpected field behavior to the business.

Code example

ABAP Code
* Example: Simplified VOFM header data transfer routine* Routine copies payment terms from source order to target billing* only if the target document category is billing (category M) FORM DATEN_KOPF_901.  "Copy header currency and payment terms unless billing doc  IF LIKP-VBTYP EQ 'M'.    "Standard fields already copied by framework, retain values    VBRK-ZTERM = VBAK-ZTERM.  ELSE.    "Redetermine payment terms for other target types    PERFORM CONDITION_PAYMENT_TERMS.  ENDIF.ENDFORM. * Note: This is illustrative pseudocode showing routine structure,* not a delivered SAP routine. Actual routines follow the exact* FORM interface expected by the VOFM copy control framework.

Real project scenario

A consulting team on a beverage distributor implementation found that credit memo requests created from billing documents were showing zero value for a specific customer group, even though the original invoice had non-zero pricing conditions. Investigation traced the issue to the item-level pricing type assigned in copy control between the billing document and the credit memo request, which was set to fully redetermine pricing (type B) instead of copying pricing unchanged (type D). Because the customer's condition records had since expired, redetermination produced no conditions. The fix involved changing the pricing type for that specific document flow combination in copy control, not touching pricing configuration itself, since the original invoice conditions needed to be preserved for audit and customer dispute purposes.

Common mistakes

โ€ข Assuming copy control determines field values directly, when the actual logic lives in referenced VOFM routines that must be separately inspected โ€ข Changing a shared data transfer routine to fix one document flow without checking all other copy control entries that reference the same routine number โ€ข Confusing pricing type settings with data transfer routine logic, leading to fixes applied in the wrong configuration object โ€ข Not testing schedule line level copy control changes separately from item level, since delivery quantity issues often originate at schedule line configuration โ€ข Deploying custom VOFM routines without transport documentation, making later troubleshooting difficult because the routine's business purpose is undocumented

Best practices

โ€ข Always identify the assigned routine number in copy control before assuming standard behavior applies โ€ข Document custom VOFM routines with clear business purpose comments and maintain a routine usage matrix showing all copy control entries referencing each custom routine โ€ข Choose pricing type deliberately based on whether financial traceability to the source document is required โ€ข Test copy control changes across the full range of item categories and document types that share a routine before moving to production โ€ข Involve both SD functional and ABAP technical resources when custom routines are needed, since business logic changes require developer review

Interview angle

Interviewers assess whether a candidate understands that copy control configuration and VOFM routine logic are separate but linked layers, and whether the candidate can explain how pricing type settings affect financial data integrity during document copying, which is a frequent real-world defect source.