Using Start, End, and Expert Routines for Custom Transformation Logic (Part 3)
Preview · a free account unlocks the full lesson
Learn how to implement ABAP-based start routines, end routines, and expert routines in BW transformations to handle logic that field-level rules cannot express, including package-level filtering, lookups, and record consolidation.
In this lessonShow sectionsHide sections
Visual overview
Explanation
Standard field-level rule types in a BW transformation (direct assignment, constant, formula, read master data) cover most mapping needs, but many real transformations require logic that spans multiple records in the transfer package, needs external lookups against master data or other DataStore objects, or must aggregate/split records conditionally. This is where routines come in.
A start routine executes once per data package before field-level rules run; it receives an internal table of source records (SOURCE_PACKAGE) that you can modify, delete rows from, or use to build lookup tables for later field routines. An end routine executes once per package after field-level mapping, operating on the result package (RESULT_PACKAGE) structured like the target; this is the natural place to consolidate duplicate keys, apply final business rules, or delete records that fail late-stage validation.
An expert routine replaces the entire transformation for a rule group, giving full control over both source and result packages, but it forfeits the maintainability of individual field rules, so it is reserved for genuinely complex, non-decomposable logic.
Design discipline matters here. Start routines are the right place to do package-wide operations once, such as selecting master data texts or exchange rates for the whole package into an internal table, rather than issuing a database read for every single record in a field routine (which is a classic performance anti-pattern).
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
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.