Majority of BPC projects pay big attention to performance issues. This is especially true when companies want to plan on detailed level. Some scripts in such cases can run for hours.
Parallel execution of the script with sub regions could be away to improve performance. There are multiple ways of making run scripts in parallel, but the most obvious way is to split the original data set into multiple data sets manually. This becomes very cumbersome when data sets change from one run to another.
Lets’ assume you have to run some script for multiple Entities and calculation on each Entity is done independently form all the other Entities. It would be natural to split the whole Data Set by Entities and execute that script for each Entity separately. This could bring not only benefits of concurrent execution, but of a smaller data set for each task as well.
We decided to automate that task by implementing a BADI that splits the data set and starts next run as soon as previous execution is finished. We found that this approach can speed up execution 10 to 20 times with just 4 parallel processes comparing to the original script.
Using that tool is very easy. You just have to call the BADI providing the script name and name of the dimension on which split is made. Sometimes you also have to adjust your original script if it has “hardcoded” members of the dimension that is used for split. If for example, the mentioned above script has a statement
*XDIM_MEMBERSET ENTITY = A1000, A1001, A1002, A1003
it should be replaced with
XDIM_MEMBERSET ENTITY = %ENTITY_SET%.
BADI RUNLOGIC is very similar to BPC MS script RUNLOGIC, but here we’ll discuss mostly differences between those two. The main difference is that MS version doesn’t have parallelization option.
If for instance, name of the original script is CALULATE_SALES.LGF than to run it in parallel for each Entity you have to create a script like:
LOGIC = CALCULATE_SALES.LGF
CHANGED = ENTITY
In the illustration above Entity Dimension was chosen just as an example. Data set split can be done on any Dimension. If you what splitting data set on Time dimension you can change that script to something like
LOGIC = CALCULATE_SALES.LGF
DIMENSION TIME = BAS(2010.TOTAL)
CHANGED = TIME
BADI will be attached to the How To … Guide as a transport. So, the only preparation one should make is to import that transport and set up number of parallel processes you want to run.
I’m finished next version of that BADI which will make it functionality closer to the original MS RUNLOGIC http://help.sap.com/saphelp_bpc75/helpdata/en/a0/2f338bbdec4ba6bf9bac0ec266373b/frameset.htm, i.e. it will inherit context from the calling script. This will require less parameters in the call. This is downward compatible.
Another version of RUNLOGIC is available now. It allows grouping by Dimension property and by Hierarchy node. This provides for much better flexibility of grouping data in slices of comparable sizes. If one doesn’t have a Dimension that provides equal splits of data one can create a Property (or a Hierarchy) and populate them to form equal splits.
This is especially useful when you have a Dimension that provides slices too small to be efficient because of the overhead. We tested it on this kind of data and by adding a Property we were able to achieve run time reduction of 3 times.
How To Guide is finally published!!!. You can find it at http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/b0ad38cf-9e0e-2e10-9d9a-fbf57e69cd40.