on 2016 Jan 29 11:27 AM
Hi all,
Per my last message (Thanks Vadim!)
http://scn.sap.com/message/16494561#16494561
Now I'm using RUNALLOCATION and it's just working fine (more or less )
I want to access Location DIM property "COMPANY CODE" to use it in my RUNALLOC script below to fill %CC% variable.
*XDIM_MEMBERSET TIME=%TIME_SET%
*XDIM_MEMBERSET LOCATION=%PLT%
*XDIM_MEMBERSET KIT=BAS(ALL_KITS)
*XDIM_MEMBERSET COMPONENT=BAS(ALL_COMPONENT)
*XDIM_MEMBERSET KEYFIGURE=YTD_IVOL,YTD_CVOL
*XDIM_MEMBERSET VERSION=A100
*XDIM_MEMBERSET MATG4=NO_MATG4
*XDIM_MEMBERSET CURRENCY=LC
*XDIM_MEMBERSET DATASRC=INPUT
*FOR %PLANT%=%PLT%
/// Access %PLANT%.[COMPANY_CODE] and store it in %CC%
*FOR %KF%=REVAL_BS,REVAL_PL,YU_PL
*RUNALLOCATION
*FACTOR = USING/TOTAL
*DIM KEYFIGURE WHAT=%KF%; WHERE=%KF%; USING=YTD_IVOL; TOTAL=YTD_IVOL
*DIM KIT WHAT=NO_KITS; WHERE=BAS(ALL_KITS); USING=<<<; TOTAL=<<<
*DIM COMPONENT WHAT=NO_COMPONENT; WHERE=BAS(ALL_COMPONENT); USING=<<<; TOTAL=<<<
*DIM BRAND WHAT=NO_BRAND; WHERE=BAS(ALL_BRAND); USING=<<<; TOTAL=<<<
*DIM COUNTRY WHAT=NO_COUNTRY; WHERE=BAS(ALL_COUNTRIES); USING=<<<; TOTAL=<<<
*DIM DATASRC WHAT=INPUT; WHERE=CALC; USING=INPUT; TOTAL=INPUT
// Use %CC% to read values at CC level
*DIM LOCATION WHAT=%CC%; WHERE=%PLANT%; USING=<<<; TOTAL=%PLANT%
*ENDALLOCATION
*NEXT
*NEXT
Do you know if this is feasible? Any workaround?
Thanks a lot
/Laura
Request clarification before answering.
*SELECT(%CCS%,[COMPANY_CODE],LOCATION,[ID]=%PLT%) //%CCS% - list of codes
*FOR %PLANT%=%PLT% AND %CC%=%CCS%
...
For each PLANT and corresponding CC!
Vadim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
By the way - for RUNALLOCATION you do not need to scope dimensions (using XDIM_MEMBERSET) specified inside RUNALLOCATION/ENDALLOCATION!
Put other XDIM_MEMBERSET statements inside inner FOR/NEXT loop:
*FOR %KF%=REVAL_BS,REVAL_PL,YU_PL
*XDIM_MEMBERSET TIME=%TIME_SET%
*XDIM_MEMBERSET VERSION=A100
*XDIM_MEMBERSET MATG4=NO_MATG4
*XDIM_MEMBERSET CURRENCY=LC
...
Reason - ENDALLOCATION resets scope!
Never use COMMIT
Vadim,
As per my code above, we have the following relation in our Location MD
1:N Company Code to Plants
The issue is that when we process several CCs at a time through that code, all the plants come into the same runallocation (result of %PLT%) and we only want to process only relevant plants for each CC at a time.
I've tried to use *FOR but I'm unable to set , dynamically this relation and in the end all Plants go through the RUNALLOCATION at the same time resulting in a wrong allocation (it takes the total volume of all plants, instead of relevant)
This line of code:
*DIM LOCATION WHAT=%CC%; WHERE=%ALL PLANTS relevant to CC%; USING=<<<; TOTAL=%ALL PLANT revelant to CC%
*ENDALLOCATION
Thanks!
| User | Count |
|---|---|
| 30 | |
| 6 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.