0
Mar 12, 2010 at 06:22 AM

# Script Logic for Cost Calc

16 Views

Hi All,

I am trying to calculate cost of production through my script logic. The following is my script logic contents. I have maintained the raw materials of my products as 'properties' of each product. Now when I execute the following logic the results are erratic.

```*XDIM_MEMBERSET TIME = 2011.TOTAL
*XDIM_MEMBERSET P_ACCT= 1000000
*XDIM_MEMBERSET CATEGORY= BUDGET
*XDIM_MEMBERSET MEASURES= PERIODIC

*LOOKUP Norms

*DIM AAA:PRODUCT="MR1"
*DIM BBB:PRODUCT="MR2"
*DIM CCC:PRODUCT="MR3"
*DIM TIME="2011.APR"
*DIM P_ACCT="2000000"
*DIM CHANNEL="40"
*DIM RPTCURRENCY="INR"
*DIM CATEGORY="ACTUAL"
*DIM MEASURES="PERIODIC"
*ENDLOOKUP

*WHEN PRODUCT.RAW_MAT1
*IS "MR1"
*REC(EXPRESSION=[P_ACCT].[1000000]*LOOKUP(AAA), P_ACCT="4000000")
*ENDWHEN
*COMMIT
*WHEN PRODUCT.RAW_MAT2
*IS "MR2"
*REC(EXPRESSION=[P_ACCT].[1000000]*LOOKUP(BBB), P_ACCT="4000000")
*ENDWHEN
*COMMIT
*WHEN PRODUCT.RAW_MAT3
*IS "MR3"
*REC(EXPRESSION=[P_ACCT].[1000000]*LOOKUP(CCC), P_ACCT="4000000")
*ENDWHEN
*COMMIT```

Upon analysing further, the above script logic is doing cost calculation even if a product property is blank i.e. taking the production quantity of the product and multiplying with raw material cost in my norms calculation even if the property is blank for one of the raw materials. For example, in my product master data if I have a product A which as only RAW_MAT2 and RAWMAT3 populated, the logic is assuming RAWMAT1 is also populated.

Looking forward for your help as in my extended business case, I would have a total of 10 different raw materials for all my products.

Thanks,

Santosh