cancel
Showing results for 
Search instead for 
Did you mean: 

Merging Members in a script

sap_user62
Active Participant
0 Kudos
262

Hi Friends,

BPC standard 10.1

We have a script that calls a badi to perform some calculations. These calculations run every couple of hours throughout the close. The output is fed to the dashboard. The results are accurate but I am looking at ways to reduce the time taken for calculations. The Model has regular dimensions together with Material. Material dimension is huge with lot of granularity which increase the record count processed by the script/badi. The Dashboard does not use material dimension.

Is it possible to merge all the materials to one single element like - "total_materials" in the script and then pass it to badi to reduce the number of records processed.

We don't want to create duplicate data in the model, as it used for management/external reporting and copying over data every couple of hours, in another overhead.

*XDIM_MEMBERSET CATEGORY = ACTUAL 
*XDIM_MEMBERSET TIME = YYYY 
*XDIM_MEMBERSET CURRENCY = USD 
*XDIM_MEMBERSET ACCOUNT = BAS(XXXX)
*START_BADI ZCALC_VARIANCES 
QUERY = ON 
WRITE = ON
*END_BADI
View Entire Topic
former_member186338
Active Contributor
0 Kudos

To my mind your main issue is related to inefficient badi code! Please ask a good ABAP developer to check the code.

For sure it's possible to merge materials to the single member:

*XDIM_MEMBERSET MATERIAL = BAS(ROOT_MATERIAL_PARENT)
*WHEN MATERIAL
*IS *
*REC(EXPRESSION=%VALUE%, MATERIAL=total_materials)
*ENDWHEN

*XDIM_MEMBERSET MATERIAL = total_materials //scope only single member
*XDIM_MEMBERSET CATEGORY = ACTUAL 
*XDIM_MEMBERSET TIME = YYYY 
*XDIM_MEMBERSET CURRENCY = USD 
*XDIM_MEMBERSET ACCOUNT = BAS(XXXX)
*START_BADI ZCALC_VARIANCES 
QUERY = ON 
WRITE = ON
*END_BADI
sap_user62
Active Participant
0 Kudos

Thank you Vadim.

When I implemented the badi, it used to run in 12secs for a month. Over the course of time, with increasing data ( due to inclusion of revenue recognition module in ecc) and more granular master data for Materials, the process slowed down considerably.

Does the code duplicate the data. As point of reference, I might be looking at a million records to move to total_materials.

*XDIM_MEMBERSET MATERIAL = BAS(ROOT_MATERIAL_PARENT)
*WHEN MATERIAL
*IS *
*REC(EXPRESSION=%VALUE%, MATERIAL=total_materials)
*ENDWHEN
former_member186338
Active Contributor
0 Kudos
sap.user62

Sorry, but what do you mean by duplication?

total_materials member will be outside of material hierarchy

former_member186338
Active Contributor
0 Kudos

Or do you want to completely remove material info?

sap_user62
Active Participant
0 Kudos

total_materials member will be outside of material hierarchy - thank you.

Or do you want to completely remove material info - I am not sure if I can remove the material info, is it possible?. as the output should have some member associated with Material, as its a part of the model.

I will test out the rec logic, sometimes rec statement takes a lot of time, depending on the number of input records.

former_member186338
Active Contributor
0 Kudos

sap.user62

"I can remove the material info, is it possible?."

*XDIM_MEMBERSET MATERIAL = BAS(ROOT_MATERIAL_PARENT)
*WHEN MATERIAL
*IS *
*REC(EXPRESSION=%VALUE%, MATERIAL=total_materials)
*REC(EXPRESSION=0) //to remove particular material value!
*ENDWHEN

"I will test out the rec logic, sometimes rec statement takes a lot of time"

That's the reason why I told you to check and improve badi code...

sap_user62
Active Participant
0 Kudos

Thanks Vadim. I cannot make the material breakdown zero, as other users, use it for reporting.

looks like checking badi code is the only option. 😞

former_member186338
Active Contributor
0 Kudos

sap.user62

Then try to use my code without zeroing material!