Skip to Content
0

allocation question

Feb 09, 2017 at 11:38 AM

225

avatar image
Former Member

Hi experts ,

I'm facing a problem.

I Have 3 models

Calendar :DAY (Time dimension),Workcenter,Version

Production: TIME,Workcenter,Version,TV_Production, Production_order

Daily_production:DAY,Workcenter,Version,TV_Production, Production_order

what i want to do :

I have the calendar wich is inputed everday by workcenter, and I have a monthly quantity of production wich is by workcenter and production order .

I sent both value to the third model .

and I want to do a split to have a daily production quantity based on the calendar.

the Day dimention :

the Time dimension:

so for the calendar i'm sending values to daily production with prodction_order=NON_APPLICABLE

and for quantity i'm sending values to daily production to for example 2016.01.IMP so I can do an allocation .

my scripts:

copy of calendar to daily production


*DESTINATION_APP =

Daily_production

*ADD_DIM TV_PRODUCTION=CAL
*ADD_DIM ORDRE_FAB=NA
*WHEN DAY
*IS *
*REC(FACTOR=1 )
*ENDWHEN
*COMMIT

Copy of quantity to daily production

*XDIM_MEMBERSET TV_PROD =QUANTITY
*DESTINATION_APP = Daily_production
*RENAME_DIM TIME = DAY

*WHEN TV_PROD
*IS QUANTITY

*REC(FACTOR=1,TIME=TIME.IMPJ)
*ENDWHEN
*COMMIT

-the property IMPJ is where I MAPP months to my Imputation members of DAY dimension .

Example

ID =2016.01 IMPJ: 2016.01.IMP so values are sent to 2016.01.IMP in the DAY dimension.

the allocation I did is :

*SUB SPLITDAY("M")

*RUNALLOCATION
*FACTOR = USING/TOTAL
*DIM DAY WHAT="M".IMP; WHERE=BAS("M")) ; USING=BAS("M") ; TOTAL=<<<;
*DIM TV_PROD WHAT=QUANTITY ; WHERE=QUANTITY_D; USING=CAL;
*DIM PRODUCTION_ORDER WHAT=NA ; WHERE=[ALL]; USING=<<<;

*ENDALLOCATION
*COMMIT
*ENDSUB
SPLITDAY(2016.01)
SPLITDAY(2016.02)
SPLITDAY(2016.03)

but it's not woring because we have CAL values are in Production order =NON Applicable

and quantity is by other members .

do you have any idea how can we resolve that ?

regards and thanks in advance.

10 |10000 characters needed characters left characters exceeded

Please don't edit the original question, it's impossible to track changes...

Use comments to provide new info or corrections!

0
Former Member
Vadim Kalinin

I edited jut spelling errors =)

0

Nobody cares about typo's :)

0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Vadim Kalinin Feb 10, 2017 at 03:54 PM
0

Comparing the report and the script I can see that:

*DIM ORDRE_FAB WHAT=NA ; WHERE<>NA; USING=<<<; - Incorrect

Has to be like:

*DIM ORDRE_FAB WHAT<>NA ; WHERE<>NA; USING=NA; TOTAL<>NA

Your source value for allocation is located in <>NA

Show 6 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thank you so much Vadim for your kind help and your patience .

when I validate the script i'm getting this error

And when I execute it whithout the TOTA<> NA .

im having a dump( no memory to do this ) i 'll ask BC team to add more memory.

capture.png (12.7 kB)
0

Ups, ONLY one line for *DIM ORDRE_FAB has to be in the script and the correct one is:

*DIM ORDRE_FAB WHAT<>NA ; WHERE<>NA; USING=NA; TOTAL=NA

Just typo from my side!

1
Former Member
Vadim Kalinin

Sorry I know it's only one line just typos . thank you Vadim.

0
Former Member
Vadim Kalinin

Hi Vadim,

After executing this script , it's giving wrong results . it's like it aggregate all members of Ordre_FAB <>NA and then do the split .

here is the result what do you suggest ?

Quantity of different order for the same workcenter

Quantity splited for the 3rd member of production order.

normaly we shoud have for PROD1_J for 000002001161: 5000 in the total and not 20060 .

500/31=161,29 each day and not 20060/31=647,096

what do you suggest ?

regards

prod1.png (8.2 kB)
prod1-j.png (46.1 kB)
prod1-j-total.png (13.7 kB)
0

If you don't want to have aggregation use:

*DIM_NONAGGR ORDRE_FAB ...

instead of *DIM ORDRE_FAB...

1
Former Member
Vadim Kalinin

Thank you so much Vadim for your kind help =)

0
Vadim Kalinin Feb 09, 2017 at 11:44 AM
0

Sorry, but it's a bad idea to provide some code with SUB's etc...

Please provide clear test code and explanation of the logic!

P.S. Why you are still using useless COMMIT in your code????

Show 8 Share
10 |10000 characters needed characters left characters exceeded

P.P.S. And please show only the code with issue...

Values before allocation

Allocation code with log

Values after

...

0
Former Member
Vadim Kalinin


*RUNALLOCATION
*FACTOR = USING/TOTAL
*DIM DAY WHAT=2016.01.IMP; WHERE=BAS(2016.01); USING=BAS(2016.01) ; TOTAL=<<<;
*DIM TV_PROD WHAT=QUANTITY ; WHERE=QUANTITY_D; USING=CAL;
*DIM PRODUCTION_ORDER WHAT=NA ; WHERE=[ALL]; USING=<<<;
*ENDALLOCATION

here is an example of my values before allocation

quantity:first cloumn production order , Day, workcenter

quantity.png

Calendar: order day workcenter calendrier.png

for the acclocation log , i'm working in frensh so I tried to translate my diemsnsions and Members so you can understand the logic of it.

Production_ORDER is FAB_ORDRE

Quantity is PROD1 , Quantity_D is PROD1_J and CAL is PROD2_J

the result of the exectution of my allocation.

LGX:

*RUNALLOCATION
*FACTOR = USING/TOTAL
*DIM JOUR WHAT=2016.01.IMP; WHERE=BAS(2016.01); USING=BAS(2016.01) ; TOTAL=<<<;
*DIM TV_PROD_J WHAT=PROD1 ; WHERE=PROD1_J; USING=PROD2_J;
*DIM ORDRE_FAB WHAT=NA ; WHERE<>NA; USING=<<<;
*ENDALLOCATION

-------------------------------------------------------------------------------------------------------------------------------------
LOG:

LOG BEGIN TIME:2017-02-09 12:44:47
FILE:\ROOT\WEBFOLDERS\PLANNING_SHELL1 \ADMINAPP\previsionnel_prod_j\TEST.LGF
USER:FELAMRANI
APPSET:PLANNING_SHELL1
APPLICATION:previsionnel_prod_j
FACTOR:USING/TOTAL
ALLOCATION DATA REGION:
JOUR:WHAT:2016.01.IMP,WHERE:01.01.2016,02.01.2016,03.01.2016,04.01.2016,05.01.2016,06.01.2016,07.01.2016,08.01.2016,09.01.2016,10.01.2016,11.01.2016,12.01.2016,13.01.2016,14.01.2016,15.01.2016,16.01.2016,17.01.2016,18.01.2016,19.01.2016,20.01.2016,21.01.2016,22.01.2016,23.01.2016,24.01.2016,25.01.2016,26.01.2016,27.01.2016,28.01.2016,29.01.2016,30.01.2016,31.01.2016,USING:01.01.2016,02.01.2016,03.01.2016,04.01.2016,05.01.2016,06.01.2016,07.01.2016,08.01.2016,09.01.2016,10.01.2016,11.01.2016,12.01.2016,13.01.2016,14.01.2016,15.01.2016,16.01.2016,17.01.2016,18.01.2016,19.01.2016,20.01.2016,21.01.2016,22.01.2016,23.01.2016,24.01.2016,25.01.2016,26.01.2016,27.01.2016,28.01.2016,29.01.2016,30.01.2016,31.01.2016,TOTAL:<<<
TV_PROD_J:WHAT:PROD1,WHERE:PROD1_J,USING:PROD2_J,TOTAL:
ORDRE_FAB:WHAT:NA,WHERE:<>NA,USING:<<<,TOTAL:
-----------------------------------------
--Read WHAT region
[JOUR] =2016.01.IMP
[TV_PROD_J] =PROD1
[ORDRE_FAB] =NA
--Time to load WHAT :1.007571 second(s).
WHAT data:0 records.
-----------------------------------------
--Read USING region
[JOUR] =01.01.2016,02.01.2016,03.01.2016,04.01.2016,05.01.2016,06.01.2016,07.01.2016,08.01.2016,09.01.2016,10.01.2016
--Time to load USING :0.785201 second(s).
USING data:0 records.
-----------------------------------------
--Merge WHAT and USING
--Time to merge WHAT and USING :0.00001 second(s).
Data after merging WHAT and USING :0 records.
-----------------------------------------
--Apply factor
[JOUR] =01.01.2016,02.01.2016,03.01.2016,04.01.2016,05.01.2016,06.01.2016,07.01.2016,08.01.2016,09.01.2016,10.01.2016
TOTAL data:0 records.
WHERE=WHAT *USING/TOTAL
--Time to apply factor :0.624738 second(s).
-----------------------------------------
--Read destination and calculate difference
[JOUR] =01.01.2016,02.01.2016,03.01.2016,04.01.2016,05.01.2016,06.01.2016,07.01.2016,08.01.2016,09.01.2016,10.01.2016
--Time to read destination and calculate difference :0.531749 second(s).
-----------------------------------------
--Records succeeded to write back :0
-----------------------------------------
--Time to run Allocation :2.955385 second(s).

SCRIPT RUNNING TIME IN TOTAL:4.00 s.
LOG END TIME:2017-02-09 12:44:47

quantity.png (18.1 kB)
calendrier.png (28.7 kB)
0

Please read again: https://blogs.sap.com/2014/01/31/how-to-ask-questions-about-script-logic-issues/

Point number 9!

Also please use "Insert Image" button to insert images inline, not links!

You have to show report with data sample before allocation!

From the log it's absolutely clear that you have no data:

WHAT data:0 records

...

0
Former Member
Vadim Kalinin

I'll show report before allocation .

Normal to have 0 in what it's because values of calendar for Prodcution order =NA

and values of quantity are for other members of Prodction order.

regards.

0

"Normal to have 0 in what" ?????

If you have no records in what then you will have no records in where!

WHERE=WHAT *USING/TOTAL

0
Former Member
Vadim Kalinin

Here is my report

I don't know if it explain my need normaly Quantity shoud be splited using CAL Of NA member (member of Fabrication order) is it possible ?

report.png (30.0 kB)
0
Show more comments