BADIs & Enhancement
BADIs and Enhancements in ABAP are ways to extend the program without modifying the core of the code. It is like calling a method or a function in some point of the program execution.
createOrder(){
//
let order = {
//..many fields
price:100,
}
if(!user_defined_method()){
// We add a custom condition to the creation of the order
// if it doesn't pass, then we dont create the order
return false;
}
}
user_defined_method(order){
if(order.price < 100){
return false;
}
return true;
}
Here our program can accept a method by the user to accept the order.
BADIs and Enhancements are similar to that concept, where we can "insert" logic in a predefined places defined by SAP. Within these places we can take defined objects and methods made available for us by SAP to customize our logic, Similar to the passing of order object. Each BADI will have different parameters/methods that it exposes.
View/Create BADIs and Enhancements
There are two important transactions that you can view and edit BADIs from.
SE19 to edit or create BADI Enhancement.
SE18 to view the details of a BADI (where you can extend the code).