Skip to Content
0
Former Member
Jan 24, 2011 at 07:27 PM

Allocation Script Logic - performance of coding

25 Views

Hello,

I have an allocation script logic and I would like to know whether there is room for performance improvement or not. I have two questions concerning this.

1)

Depending on prompt variables, the user should select the period for which the allocation rule shall be executed. As written below $ALLOCTIME$ variable leads to an error in *FOR/NEXT loop while validating the script. Do I have other alternatives to use prompt variables within script logic? What is the difference between using PROMPT(SELECTINPUT,,,...) and the prompt used below? May I use PROMPT(SELECTINPUT,,,) to pass variables for the dimension VERSION from prompt to script logic?

2)

Is there room for improving this allocation logic? E.g. It takes 70sec to calculate and write back 7000 data records (1 period calculated in FOR/NEXT loop) or about 5min to calculate and write back 25000 data records (4 periods calculated in FOR/NEXT loop). Are there any experiences concerning high data volume?

Any answers appreciated.

Thank you very much in advance

Stefan

///// DATA MANAGER PROMPT /////

PROMPT(TEXT,%ALLOCVERS%,"Please select relevant version",)

PROMPT(TEXT,%ALLOCTIME%,"Please select time/period to execute allocation",)

INFO(%EQU%,=)

INFO(%TAB%,;)

TASK(ZPC_PROMPT_RUN_LOGIC,TAB,%TAB%)

TASK(ZPC_PROMPT_RUN_LOGIC,EQU,%EQU%)

TASK(ZPC_PROMPT_RUN_LOGIC,SUSER,%USER%)

TASK(ZPC_PROMPT_RUN_LOGIC,SAPPSET,%APPSET%)

TASK(ZPC_PROMPT_RUN_LOGIC,SAPP,%APP%)

TASK(ZPC_PROMPT_RUN_LOGIC,SELECTION,)

TASK(ZPC_PROMPT_RUN_LOGIC,LOGICFILENAME,LOGIC01_ALLOCFIX.LGF)

TASK(ZPC_PROMPT_RUN_LOGIC,REPLACEPARAM,ALLOCVERS%EQU%%ALLOCVERS%%TAB%ALLOCTIME%EQU%%ALLOCTIME%)

///// LOGIC01_ALLOCFIX.LGF //////

*SELECT(%CESET%,"[ID]",COSTELEMENT,"[ALLOCATION]='Y")

*XDIM_MEMBERSET COSTELEMENT=%CESET%

*XDIM_MEMBERSET VERSION=$ALLOCVERS$

*XDIM_MEMBERSET TIME=$ALLOCTIME$

*XDIM_MEMBERSET ITEM=IM_NONE

*XDIM_MEMBERSET COSTUNIT=CU_NONE

*XDIM_MEMBERSET ACTTYPE=AT_NONE

*XDIM_MEMBERSET DATASRC=ENTRY

*XDIM_MEMBERSET CALCTYPE=CA_FIX

*XDIM_MEMBERSET CRITERIA=CR_COST_FIX

*XDIM_MEMBERSET QUANTU=QU_NONE

*XDIM_MEMBERSET PCENTER=CP_NONE

*WHEN CALCTYPE

*IS "CA_FIX"

// Prompt variable $ALLOCTIME$ within *FOR/NEXT loop leads to an error while validating script. Nevertheless the allocation logic is executed correctly and leads to correct results.

*FOR %TIME% = $ALLOCTIME$

*FOR %COSTELEMENT% = %CESET%

*RUNALLOCATION

*FACTOR=USING/TOTAL

*DIM DATASRC WHAT=ENTRY; WHERE=ADJUSTM; USING=INPUT

*DIM ITEM WHAT=IM_NONE; WHERE=BAS(IM_RESULT); USING=<<<

*DIM TIME WHAT=%TIME%; WHERE=<<<; USING=<<<

*DIM COSTELEMENT WHAT=%COSTELEMENT%; WHERE=<<<; USING=<<<

*DIM PCENTER WHAT=PC_NONE; WHERE=BAS(PC_ALL); USING=<<<

*DIM COSTUNIT WHAT=CU_NONE; WHERE=BAS(CU_ALL); USING=<<<

*DIM ACTTYPE WHAT=AT_NONE; WHERE=BAS(AT_ALL); USING=<<<

*DIM QUANTU WHAT=QU_NONE; WHERE=BAS(QU_ALL); USING=<<<

*ENDALLOCATION

*NEXT

*NEXT

*ENDWHEN

*WHEN DATASRC

*IS "ENTRY"

*REC(EXPRESSION=0)

*ENDWHEN

*COMMIT