SAP BW Customer Enhancement (CMOD)

When I started to 'play' around with SAP Business Warehouse (BW aka BI), I thought that I would forever leave the role as a "programmer" behind. I thought, finally, I can concentrate more on "configuration" and "designing".

Well today proves that inevitably, it all boils down to good ol' hacks. You see, I want to create this report which includes a Quarter-to-date (QTD) columns. But, instead of creating a variable where the user enters which quarter the month resides in, I want to be able to use the existing 0FISCPER variable already created previously. So, what I need to do is create a customer Exit variable which will take the value of 0FISCPER variable, and find the appropriate QTD range.

Unfortunately, this customer Exit, can only be created using ABAP codes, and not just a simple Formula thingy. So here's what I did:


  • Went into SAP enhancement screen (T-code: CMOD) and create a new project.
  • Add the following enhancement assignment: RSR00001 (Enhancements for global variables in reporting)
  • Adopt the existing include sample functions and start changing the include file 'ZXRSRU01'.

Here's some descriptive info on what you need to do in the function:

I_VNAM: The variable name.
i_t_var_range: contains all the information about the other query variables available in BW.
l_s_range_low: Is the low limit value of the variable. For non-interval variable, this is the value.
l_s_range_high: Is the high limit value of the variable. Make sense only for interval type variables.
l_s_range-sign: denotes whether it's 'I' inclusive, or 'E' exclusive. Again, make sense for interval type only.
l_s_range-opt: what type of variable, either 'EQ' equal-type, or 'BT' between-type (interval).

Another lesson that I learn in ABAP is that:

some_variable = A + B

not equal to:

concatenate A B into some_variable

In other words, string not the same as add operation. I assumed it's like Java fixed string, which is not.

All in all, it's a good experience :)

0 comments: