Lecture on Classic BAdIs

Jul 16, 2024

Lecture on Classic BAdIs

Introduction

  • Topic: Classic BAdIs (Business Add-Ins)
  • Approach: Same as customer exits
    • Understand the requirement
    • Find the relevant BAdI
    • Implement the BAdI

Requirement Example

  • Transaction Code: MM01 (Create Material)
  • Scenario: Creating a material with unit of measurement (UoM) cannot be equal to KG
    • Steps:
      • Use MM01 to create a raw material
      • If UoM is KG and Save is clicked, system should present an error that KG is not allowed

Process Overview

  1. Check requirement feasibility
  2. Learn how to find a Classic BAdI
  3. Implement the Classic BAdI

Finding a Classic BAdI

  • Class Used: CL_EXIT_HANDLER
    • Method: GET_INSTANCE
    • Preferred by technical/ABAP developers
    • Allows for debugging

Steps to Find BAdI

  1. Use SC24 to access the class CL_EXIT_HANDLER
  2. Reach appropriate transaction level (MM01) before setting breakpoints
  3. Set a breakpoint in GET_INSTANCE method, specifically at SY-SUBRC division
  4. Upon clicking Save in MM01, observe breakpoints to find BAdI
  5. Check each BAdI for relevance
    • GTIN_VARIANT: Not useful
    • CUSTOMER_DEFINED_DEFAULT_DATA: Not useful
    • MATERIAL_CHECK: Useful (interface CHECK_DATA)

Alternative Methods to Find Classic BAdI

  1. By Package Name:
    • Use transaction SC18
    • Enter package related to MM01
    • Search for Classic BAdIs
  2. Using Transaction SC84:
    • Go to Enhancements > Business Add-Ins > Definitions
    • Enter package name

Summary

  • Requirement: UoM in MM01 should not be KG
  • Classic BAdI Finding Methods:
    • Debugging with CL_EXIT_HANDLER (Preferred)
    • Package name search (SC18)
    • Enhancement search (SC84)
  • Next steps will involve implementing the identified Classic BAdI

Conclusion

  • Series of methods to find BAdIs
  • Highlights the preferred method for technical accuracy
  • Next lecture: Implementation of Classic BAdI

Thank you.