Show TOC

 Registry PatternLocate this document in the navigation structure

This use case shows how you enhance objects that mirror database table lines, where the database table stands for business objects such as an order, a customer, or a material.

When you call the BAdI from inside the respective class, you get one BAdI instance for each object. In that way you can easily enhance your objects with new methods or attributes. You just have to make some additional provisions if you want to access private or protected attributes or methods of your object with the BAdI. In this case you have to pass the object reference to the BAdI and declare the friend relation to the BAdI interface.


There is a class for a database table. For each line of the respective database table there is an instance of the class cl_mat . cl_mat implements if_badi_context .

The respective BAdI is designed in such a way that it enhances the respective object. Methods of BAdIs enhance the functionality of the class cl_mat .

If you need access from the BAdI instance to the original object, you have to pass the reference of the original object to the BAdI instance.

If you need access to private or protected attributes or methods, declare the friend relation in the interface.


CALL BADI my_badi->meth

Each instance of the cl_mat gets an addition of its own, which enhances the class.