SD Copy Control Part 3: Copy Requirements and Data Transfer Routines (VOFM)
Preview · a free account unlocks the full lesson
How copying requirements and data transfer routines work: standard routines (001, 301, 004, 051, 151…), creating custom routines (900+) in VOFM, activation and transport, typical use cases, and the rules for writing safe routines that run for every document.
In this lessonShow sectionsHide sections
Visual overview
Explanation
Part 2 covered the copy control fields themselves; this part looks at the ABAP routines that sit behind two of those fields.
A copying requirement is an ABAP routine that decides whether copying from one document to another is allowed at all — it sets sy-subrc or bp_subrc to a non-zero value, together with a message, to stop the copy when its condition isn't met.
A data transfer routine, by contrast, is an ABAP routine that actually moves fields from the source document's structures into the target's — for example, transferring VBAK fields from a quotation into the new order — and is used to set or clear specific fields in the target, such as keeping the customer PO number or clearing a delivery block.
Standard copying requirements include header-level routines like 001 (checking things such as the same sold-to party and sales area) and 002 (checking the document isn't blocked), and item-level routines like 301 (checking the item isn't rejected, based on status) and 303 (always relevant). Billing copy control uses its own set, such as 004 for delivery-related items and 002 for order-related headers. Data transfer routines follow a similar numbering pattern — header VBAK routine 051, business data VBKD routines 001 and 002, and item VBAP routines 151 and 102, among others.
Create a free account to keep reading
You have read the opening of this lesson. A free ERPClimb account unlocks the rest of it, every other lesson and topic, and your learning history, so you can pick up exactly where you stopped. No card needed.
- Full explanation
- Code example
- Real project scenario
- Common mistakes
- Best practices
- Interview angle
One tap with Google works too. Every topic keeps its first lesson open to everyone.
Keep exploring
Interview questions on this topic
Related SAP topics
Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.