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

Allocation needs run-time improvement

Former Member
0 Likes
357

Hi,

I am looking for help so I can run this logic in a reasonable time duration. Basically what it does is to allocate the promotion cost to base level of the Distributor and Product dimension by using a ratio account. The logic works if I only ran it for 1 distributor parent and for a month. I am planning to run it by month but at least I need to run it for all distributor parents. I tried running it that way, it gets hung up. Not all intersections will have data so I am wondering if there is a way to make this logic to do the calculation only for intersections that has Promotion Cost.

Any help is very much appreciated.

Thank you so much

Yani

*SELECT (%DISTRIB%, "[ID]", "DISTRIBUTOR", "[REVPLAN_PROMO_LVL]='Y' AND [INPUT_MEMBER]='N'")

*SELECT (%BP%, "[ID]", "PRODUCT", '[MC_LEVEL] = 'Brand Package' AND [INPUT_MEMBER]='N'")

*FOR %D%=%DISTRIB%

*FOR %P%=%BP%

*XDIM_MEMBERSET RPTCURRENCY = USD

*RUNALLOCATION

*FACTOR = USING

*DIM DISTRIBUTOR WHAT=%D%_I; WHERE=BAS(%D%); USING=<<<; TOTAL=<<<;

*DIM PRODUCT WHAT=%P%_I; WHERE=BAS(%P%); USING=<<<; TOTAL=<<<;

*DIM DATASRC WHAT=TEST+DATASRC1; WHERE=TEST_DATASRC2; UISNG=TEST_DATASRC1; TOTAL=<<<;

*DIM REVACCOUNT WHAT=PROMOTION_COST; WHERE=<<<; USING=STW_BASE_PCT; TOTAL=<<<;

*DIM UOM WHAT=DOLLARS; WHERE=<<<; USING=BARRELS; TOTAL=<<<;

*ENDALLOCATION

*NEXT

*NEXT

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member186338
Active Contributor
0 Likes

Hi Yani,

What will be the Number(%DISTRIB%)*Number(%BP%)?

FOR/NEXT is not a real loop - it's a text copy

Vadim

Former Member
0 Likes

Vadim

Thank you for the quick response. %DISTRIB% Is around 100 but the base members are thousands. %BP% is about the same thing. So the combination of these 2 create large volume.

Any help is very much appreciated.

Thank you

Yani

former_member186338
Active Contributor
0 Likes

Can you imaging a text file lgx with 10,000 RUNALLOCATION/.../ENDALLOCATION lines?

Write a custom logic badi to perform the job.

Vadim

Former Member
0 Likes

Vadim,

I can narrow it down the %DISTRIB% by adding this line on the top before *SELECT ,which will be a much smaller data.

*XDIM_MEMBERSET DISTRIBUTOR AS %DIST1% = ALL(REGION1)

then change the %DISTRIB% selection to:

*SELECT(%DISTRIB%, "DISTRIBUTOR", "[ID]=%DIST1% AND [REVPLAN_PROMO_LVL]  = "Y" AND [INPUT_MEMBER]='N' AND [LEVEL] = 'MU State'")

However, when I tried running it, it wasn't working.

Could you please point me what I missed?

Thanks a bunch

Yani

former_member186338
Active Contributor
0 Likes

What is the number of members in %DISTRIB%?

Please use UJKT to see the validation results!

Have to repeat: "FOR/NEXT is not a real loop - it's a text copy "

Vadim

Former Member
0 Likes

Vadim,

So what is a real loop please?

Thanks

Yani

former_member186338
Active Contributor
0 Likes

Script logic is not a programming language... it's some text manipulation In some cases you can create something not very slow, in some not! "Write a custom logic badi to perform the job."

Vadim

"So what is a real loop please?" - inside badi

Former Member
0 Likes

Hi Yani,

You can also try running a number of allocations in parallel using RUNLOGIC_PH based on http://scn.sap.com/docs/DOC-35152.

You can split data by DISTRIBUTOR or PRODUCT, but don't try running 10,000 parallel processes:).

This will bring the system down.

Regards,

Gersh