BAdI
ABAP Developmentintermediate

Finding and Implementing a New BAdI

SE18/SE19, filters and the GET BADI / CALL BADI syntax.

Explanation

Use SE18 to explore the BAdI definition (interface, filter attributes, multi-use flag). Implement in SE19 or the Eclipse ADT wizard, providing filter values. Standard code calls GET BADI + CALL BADI, executing every active implementation whose filter matches.

Code example

ABAP Code
GET BADI lo_badi FILTERS bukrs = 'US01'.CALL BADI lo_badi->on_save  EXPORTING is_header = ls_header.

Real project scenario

Different company codes needed different tax-code validations. A single filter-dependent BAdI cleanly isolated each variant.

Common mistakes

Copying implementations between filters; expecting SY-SUBRC after CALL BADI; implementing without checking multi-use flag.

Best practices

Keep implementations short; delegate to service classes; unit test the service, not the BAdI shell.

Interview angle

Difference between fallback class and normal implementation.