Advantages of Custom Formula used in SAP BW Transformations
1. Will be available in formulas list.
2. No need to write same logic again and again.
3. Faster developments.
4. No ABAP expertise required to use.
5. Can be enhanced centrally.
6. Risk of error will be minimized.
How to Build
Create an implementation using classic BADI with BADI name RSAR_CONNECTOR (SE19 T CODE)
Give your implementation name
An implementation class as ZCL_IN_<Implementaion_name> will be assigned by default. You check in Interface Tab.
Save it and edit the class in SE24 T Code and add your desired custom methods in Methods Tab. Method should be static and public
Select your method and click on Parameters button to define parameters of your method.(Methods can only have exporting, importing and returning parameters)
Changing parameters are not allowed. Only one exporting or returning parameter is allowed
Double click on the method name to write the logic
Use Parameter name exactly same as they are defined
Check your methods once defined
Go to T code SE19 and open your implementation in change mode, make it inactive to edit it
Open Get method in Interface Tab, this is the place where you can incorporate your custom methods as formula
Double click on the method name to write the code inside it
it has two parameters i_key and c_operands
Code section comprise of two parts
a)Create new category for custom formula
b) Assign custom formula’s to new categories
Activate your GET method
Now you can see new category of formula’s inside your transformation formula list and can use them during developments
in formula’s list