cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to handle different scope in script logic?

Former Member
0 Likes
207

Hi Experts!

I faced the following problem in script logic:

I have to multiplication two different dimension section ()

The example:

Factor1:

REPSCENTER: BAS(TOTAL)

MATERIAL: DUMMY_MATERIAL

PRODUCT: BAS(TOTAL)

Factor2:

REPSCENTER: DUMMY_REPSCENTER

MATERIAL: BAS(TOTAL)

PRODUCT: BAS(TOTAL)

Outcome:

REPSCENTER: BAS(TOTAL)

MATERIAL: BAS(TOTAL)

PRODUCT: BAS(TOTAL)

AMOUNT: Factor1*Factor2

I tried this script, but after 15 minutes I got ABAP program error (insufficient memory)

*SELECT(%RESPCENTER_MA%),”[ID]”,REPSCENTER,”[SECTOR]=’TA’”) //select the relevant 30 respcenter

*XDIM_MEMBERSET RESPCENTER = “DUMMY_RESPCENTER”

*XDIM_MEMBERSET MATERIAL = BAS(TOTAL)

*XDIM_MEMBERSET PRODUCT = BAS(TOTAL)

*FOR %LOOP_TA_RESPCENTER% = %RESPCENTER_MA%

*WHEN RESPCENTER

*IS *

*REC(EXPRESSION=%VALUE%*([RESPCENTER].[ %LOOP_TA_RESPCENTER%],RESPCENTER=%LOOP_TA_RESPCENTER%))

*ENDWHEN

*COMMIT

*NEXT

The modell contain about 3 000 materials and 1 200 products. Sorry about the short example and the missing log, I only curious about there is a better way to handle this calculation in script logic.

Any ideas are welcome.

Thanks

Norbert

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Likes

Hi Norbert,

Looking just at syntax of that script it seems like you can move FOR/NEXT loop inside *IS since *WHEN doesn't depend of FOR/NEXT variable. This should speed it up, but I doubt it will make result more meaningful.

Since you already restricted RESPCENTER to DUMMY_RESPCENTER in XDIM_MEMBERSET that *WHEN will use only that single RESPCENTER. It sounded like you needed only MATERUAL = DUMMY_MATERIAL in Factor1, but I don't see that restriction in your script.

So, before making this script running efficiently try making it running correctly on a smaller data set. Then we can try find efficient way of running it.

Regards,

Gersh

former_member186338
Active Contributor
0 Likes

Hi Norbert,

"I only curious about there is a better way to handle this calculation" - use *RUNALLOCATION!

Vadim

Former Member
0 Likes

Hi Norbert,

You need to scope better by specifying more dimensions using XDIM.

Andy