Skip to Content
0
Former Member
May 17, 2016 at 07:02 AM

Script Logic: summation based on Masterdata.

19 Views

Hallo Everyone,

I was given a 6000 Line Script that I am supposed to shrink down.

It's basically the same 20 Lines of code over and over again with other paramters:

*XDIM_MEMBERSET [...]

*RUNALLOCATION

*FACTOR=1 or -1

*DIM ABC WHAT=BAS(ABC_ALL);WHERE=NA

*DIM DEF WHAT=BAS(DEF_ALL);WHERE=NA

*DIM GHI WHAT=BAS(GHI_ALL);WHERE=NA

*DIM XYZ WHAT=UE (or BAS(UE));WHERE=O_UE

*ENDALLOCATION

*COMMIT

So this grabs a whole lot of accounts and stuff and writes the sum of that lot into some new keyfigure (dimension xyz)

Well my Idea was to put the parameters for the dimensions sources and targets into the Dimension XYZ, as it's the driving dimension in this, an then use that masterdata as a parameter in this script.

But keep failing here. I am not a big script logic guru and probably would prefer an ABAP solution, however the business wants to keep that script, as they can do changes in it.

I gave the XYZ Dimension quite a few properties, one source and one target propertiey for every possible parameter (dimension), and one property for the factor.

My script looks like something like this:

*WHEN XYZ.XYZ_T

*IS ""

*ELSE

*REC(EXPRESSION=(

[XYZ].XYZ_S,

ABC=[XYZ].ABC_S,

DEF=[XYZ].DEF_S,

GHI=[XYZ].GHI_S)

*

([XYZ].FACTOR_T,

[XYZ].XYZ_T,

ABC=[XYZ].ABC_T,

DEF=[XYZ].DEF_T,

GHI=[XYZ].GHI_T)

*ENDWHEN

*COMMIT

I tried quite a few versions of this, and I am not sure if it's even possible to get the masterdata using this right now, the Scriptlogic tester gives not that much feedback, just tells me invalid diemnsion name right at the when statment, however dimension XYZ does have the attribut XYZ_T.

I am completly lost here and would really appriciate some pointers.

Best Regards

Hendrik