ERPClimb logoERPClimb
BAdI
ABAP Developmentintermediate 7 min read

BAdI Part 7: Using Filter-Dependent BAdIs

Preview · a free account unlocks the full lesson

Key takeaway

Implement filter-dependent BAdIs correctly: filter characteristics and values, comparison operators and value ranges in new BAdIs, FLT VAL in classic BAdIs, overlapping filters, one implementation for several org units vs one per unit, and testing filter behaviour.

In this lessonShow sections

Visual overview

BAdI Part 7: Using Filter-Dependent BAdIs — learning sheetFlow: SE18: find a filter-dependent BAdI in your area and read its filter definition → Create an implementation for two filter values in a sandbox → Debug GET BADI for a matching and a non-matching value. Key ideas: WHY FILTERS; NEW BADI FILTERS; CLASSIC BADI FILTERS; ONE OR MANY IMPLEMENTATIONS?. Watch out: Overlapping filter conditions in a single-use BAdI cause errors; in a multiple-use BAdI they cause both implementations to run.ERPClimb.com / ABAP / LESSON 7/10 / LEARNING SHEETBAdI Part 7: Using Filter-Dependent BAdIs1 · HOW IT FLOWS1SE18find a filter-dependent BAdI inyour area and read its filter…2Create an implementationfor two filter values ina sandbox3Debug GET BADI for amatching and anon-matching value2 · KEY IDEAS EXPLAINEDWhy FiltersDifferent countries, companies or document typesneed different logic. Filters keep the logicseparate without IF blocks, and each…New BAdI FiltersThe definition lists filter characteristics (name,type, allowed operators).In SE19, the BAdI implementation gets a filtercombination, e.g. BUKRS = '1000' OR BUKRS ='1100'.Classic BAdI FiltersOne filter type in the definition (e.g. LAND1).Implementation has a list of filter values.One Or Many Implementations?Same logic for several units → one implementationwith several filter values.Different logic → separate implementations perunit.3 · REMEMBER · WATCH OUTRememberA filter-dependent BAdI chooses implementations by a value such ascountry, company code or document type.New BAdIs: filter conditions are maintained per implementation in SE19(e.g. BUKRS = 1000, LAND1 CP 'D*').Classic BAdIs: filter values are assigned to the implementation, andthe caller passes FLT_VAL to each method.!Watch outOverlapping filter conditions in asingle-use BAdI cause errors; in amultiple-use BAdI they cause bothimplementations to run.4 · IN A REAL PROJECTA group added company code 3200 in India. Invoices for 3200 were posted without GSTIN validation because theIndian BAdI implementation had filter values 3000 and 3100 only, and 3200 fell to the fallback class. The teamadded 3200 to the filter combination and introduced a go-live checklist item for new org units: review…Original ERPClimb learning sheet • Verify against your SAP release and edition

Explanation

Part 3 walked through designing a filter for your own BAdI; this lesson covers implementing SAP's or a colleague's BAdIs that already come with filters built in. A filter-dependent BAdI chooses between implementations based on some value, such as country, company code, or document type.

For new-style BAdIs, filter conditions are maintained per implementation directly in SE19 — for example BUKRS = 1000, or LAND1 CP 'D*'. For classic BAdIs, filter values are assigned to the implementation itself, and the caller passes FLT_VAL into each method behind the scenes.

One real hazard: overlapping filter conditions in a single-use BAdI cause an activation error, while in a multiple-use BAdI, overlapping conditions simply mean both implementations run.

Filters exist because different countries, companies, or document types often need genuinely different logic, and filters let that logic stay separated without a tangle of IF blocks — with the added benefit that each implementation can be owned by a different team entirely.

For new BAdI filters, the BAdI's definition lists filter characteristics — their name, type, and which operators are allowed. In SE19, each implementation gets its own filter combination, for instance BUKRS = '1000' OR BUKRS = '1100'. At runtime, GET BADI ... FILTERS bukrs = lv_bukrs selects whichever implementations have a matching condition. Within one combination, several characteristics combine with AND; across combinations, it's OR.

Free account

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

Referenced SAP objects

Reviewed reference pages for the objects this page mentions.

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.