Friday 4 September 2015

Creation of BADI

Yes, you heard it right..It's about creation of BADI not the implementation of an existing ones. :)

So why do we even need to create a BADI? Well, SAP comes as a product to us SAP folks. Product means we are not allowed to touch the SAP standard code. When required we can only enhance the standard code. This enhancement works alongside the standard code. BADI is one of the few enhancement techniques SAP gives to us.

So, what if we create say some tool in SAP and we have few customers also who use that tool. Sounds cooool :). So to customers, this tool is a product. They must not be able to touch the standard/basic code of the tool. Now if user wants to do some sort of enhancement in the tool (of course they would be, they have paid for it), we have to provide the BADIs to accomplish this. So that's oen of the few cases where we would be creating BADIs.

Enhancement spot: Enhancement spot works as a container for BADI definition. Single enhancement spot may have multiple BADI definition.

BADI definition: BADI definition is the place which contains the interface. That interface will have methods in it. When we say we are implementing that BADI, we actually create a class, use that interface in it and implement the methods. These implementation of the methods are the place where user would be writing the custom code.

To start with, we would be creating an enhancement spot. Go in appropriate package, right click on it and follow the below path.



Now create BADI definition.




 You can check or uncheck the Multiple Use option, depending upon your requirement. If you want to do more than one implementation of the BADI, leave it as checked.

Create interface for BADI definition and activate everything.






What????? We are done with the BADI creation. Happy Learning :)

No comments:

Post a Comment