cancel
Showing results for 
Search instead for 
Did you mean: 

Macros

Former Member
0 Kudos

Hi Everybody,

Can someone direct to some good document on SNP standard macros- std planning books, std, ss, vmi,cap. I need the syntax and its excel translation for easy comprehension. More the examples merrier it is. I am not much bothered about the business context and config that influence the results of the macros but just to have a broad idea.

needless to say help.com has just nothing on macros- syntax, usage, library functions. In fact sometime back i discovered that days supply macro (COVER_CALC) is incorrectly explained in documentation.

Also if someone can explan the consumption logic syntax in total balance macro in standard planning book, would appreciate.

The requirement is to see reduced forecast fig (same key fig FA thats released from dp) and it shd be consumed by say 4-5 demand categories - sales orders, dependent demand, distr demand planned, confirmed, substitution demand, tlb confirmed and total demand should be = reduced fcst fa + sales orders + dependent demand, distr demand planned, confirmed, tlb confirmed, substitution demand.

How do i set this logic without the need for different key figure say " (un)consumed forecast. It would be a circular referencing else.

what does this syntax mean .DEMAND_CALC(ACT_PRODUCT, ACT_LOCATION, ACT_VERSION) .. this is a line from consumption step. where in help.com is this explained.

what does this mean

DET_LEVEL('9MATNR' ; 'X')=1

well i could write any condition and macro in excel easily but this syntax in sap is cryptic. its nothing more than basic arithmertic but still a lot confusing Let me know how to approach this quickly.

Regards,

Lok

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Loknath,

Not sure where in the documentation the COVER_CALC is explained wrong. Did you check the [SNP Functions|http://help.sap.com/saphelp_scm50/helpdata/en/77/9aa339a28e0554e10000000a114084/frameset.htm] in sap help?

it also has demand_calc below it.

"DEMAND_CALC( 'product' , ' location' , 'version' , 'period' , key figure for demand , forecast key figure ) returns the demand of a period taking the settings in the master record for the location product (requirements strategy, forecast horizon) into account.

The arguments for the key figures can be rows or areas."

By the way, COVER_CALC is used to calculate the day's supply.

"The requirement is to see reduced forecast fig (same key fig FA thats released from dp) and it shd be consumed by say 4-5 demand categories - sales orders, dependent demand, distr demand planned, confirmed, substitution demand, tlb confirmed and total demand should be = reduced fcst fa + sales orders + dependent demand, distr demand planned, confirmed, tlb confirmed, substitution demand."

Consumption in APo is standard is consumed from category FA. I am not sure how to change that...check this linkhttp://help.sap.com/saphelp_scm50/helpdata/en/e6/28dadc939241469dd64f0eb925f328/frameset.htm

(Not sure if it answers your question)

Looking at your question above, it seems you are not looking for consumption, may be you are looking for day's supply...

Former Member
0 Kudos

Hi Visu,

Could you endorse this basis what help.com says reg. cover_calc

The Days of Sale is NOT arrived at through u201CAveraging total demand over total work daysu201D in the entire range and then arriving at days of supply from stock on hand.

BUT OF

u201CCovering demand upto n buckets + fractional bucket from the Stock on handu201D as on current bucket

You should be able to make out the test formulas and results.

see an example below

SAP Cover_calc

Area demand 314,835

Area work days 247

calculated days of supply 37

My discovery

Days Supply = Corr. workdays upto (SUM(D10:K10)) + workdays(((C10-SUM(D10:K10)) x L24) ÷ L10)

=39 + (((47486 - 42172)) x 5) ÷ 5556)

= 39 + 4.78

= 44 (approx)

My actual question was where and how do i get a quick easy to follow literature on Macros in APO. Just want to have a broader view of the possibilities with SAP standard and advanced functions. There is no context help in Macro workbench too.

Regards,

Loknath

Former Member
0 Kudos

hey Loknath, let me explain the Cover_Calc example from he help.sap

here is what given

Time span w11 w12 w13 m04 m05

Total demand: 0 20.0 0 25.0 27.5

Stock level 68,7 48,7 48,7 23,7 0

Daysu2019 supply 70 63 57 26 0

Workdays 7 7 7 30 31

to calculate the Days' supply here is the formula: [Stocklevel)/(total demand from next period to end)]*workdays

if we consider for W12: Stock on hand is 48.7

Total demand from next period to end: (02527.5)=52.5

workdays: (73031) = 68

now days supply = (48.7/52.5)*68 = 63..this is the logic

I suppose for most of the macros functions you can get from Example macros that SAP has provided in the macro workbench

Former Member
0 Kudos

Hi Sai,

Thanks for efforts. Nice of you to detail this out. I wanted to tell that the actual results populated in Days supply key figure is not as per the stated explantion of cover_calc macro. Check this out in your planning books and see if it is exactly so.

I was only trying to reconcile the saps version of days supply definition with the actual result in std planning book and then working my formula out from the same. They are distinct in logic. It is not the entire are demand that the macro considers.

It is just the sum of corresponding workdays of # corr. demand buckets sum just equal to present stock on hand. so the difference is in the treatment of the "range" (area demand) that cover_calc macro says is what is the logic but actual result does not confirm so.

Let me know if i was clear.

PS: there's nothing that we changed in key fig/extra macros.

Regards,

Loknath

Former Member
0 Kudos

Hi Sai,

I could trace some old mail i composed on this. The actual steps of cover_calc.

Row 1: sum a series of values (demand/forecast) from period n UPTO period n + m till the sum is JUST less than or equal to step 2

Row 2: a value in period n-1 (stock on hand)

Row 3: some series of values from period n onwards at least u2265 n + m + 1 (work days)

Row 4: sum of values in row 3 incl. fractional values (work days)

Fractional value logic: proportional value of row 3 (to row 1 of n m1th period)

According to the definition of cover_calc in help.com, the row1 and row 3 - is till end of dataview, but actual calculation if the way i explained.

Regards,

Loknath

Former Member
0 Kudos

hey Loknath..I checked our macro and the PB values, they are as expected.I would like you to check the macro syntax and also the end period that it is considering for the total demand

Former Member
0 Kudos

Hi Sai,

The argument area for total demand and work days in the days supply standard SAP deleivered macro is from begining of data view till end of data view (with a column relative check in the from column).

however cover_calc logic can be deemed correct IFF the demand exists in all the buckets so we have the correct way of saying the current stock will last of n days. What if there is demand (total demand) only in the first 15 buckets and not in next 10 buckets ?. The days supply by cover_calc logic would cease to have any meaning.

copy your data view to excel.now

Insert a row next to total demand = Cumulative demand

Insert a row next to work days = Cumulative work days.

Now see the stock on 1st bucket.

Next see the close enough (use unitary) figure in the cumumative demand row.

Now see the corresponding work days in the cumulative work days row.

Now see the days supply in 1st bucket. This is the value that SAP calculates and not me

Now try reconciling and let me know if i am still wrong.

COMPONENT LEVEL12/8/2008 12/15/2008 12/22/2008 12/29/2008 1/5/2009

Total Demand 6182 6156 5041 4943 6750

Cu.total demand 6182 12338 17379 22322 29072

Stock on Hand 21650 15494 10453 5510 17075

Days´ Supply 16 11 8 4 13

Workdays 5 5 3 4 5

Cu.Work days 5 10 13 17 22

Its the macro syntax thats misleading and the explanation in help thats even more misleading. The way it appears would lead one to believe at fist sight that days supply = current stock on hand /( total demand / total work days) and that IS not and SHOULD not be true, as this is TOO MUCH OF AVERAGING TOO FAR.

Regards,

Loknath

Answers (1)

Answers (1)

Former Member
0 Kudos