cancel
Showing results for 
Search instead for 
Did you mean: 

SNP Heuristic: which keyfigure in the DataView is used ?

thomas_schulze2
Active Participant
0 Kudos

Hello,

trying to find a clear explanation for SNP Heuristics base calculation.

How does the system know which keyfigure represent "Total Demand" and which ist "Total Supply" in order to calcuate the Preqs per bucket. I was searching in a Planning Book i have in front of me which is running heuristics in background ... I see "DMDTO" as total demand and "RECTO" as total supply but both are temporary keyfigures in the SNP Planning book therefore I'm in doubt.

When you look into SNP Heur background job definition (program /SAPAPO/RSNPDRP1) it only has

  • Planning Book

  • Dataview

  • and a few other settings ... and nothing defines what Demand and what Supply is.

but ... how does APO know what keyfigures out of the PlangBook/DataView to use as "Total Demand" and "Total Supply" ??

I saw a few posts in this forum about "keyfigure function" in the Planning Area definition - I guess this is not the right direction - therefore posting this question here hoping somebody can help.

Tks for your help

Thomas

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

SNP Heuristics works on Planning Book and Data view defined in program /SAPAPO/RSNPDRP1. Key figure 'Total Demand' is nothing but the released Demand to SNP from Demand Planning. Settings related to key figure you can see in design view of Planning book, there you can also see which are the key figure assigned to that Data view of planning book. Total Supply = KF Stock on Hand (Storage Loc Stock, In Transit Stock and Commits/ PO and other supply elements if any)

You may also visit this link

http://help.sap.com/saphelp_scm40/helpdata/en/0d/429bcf38ee11d3982b0000e8a49608/frameset.htm

Regards,

Rajnish

thomas_schulze2
Active Participant
0 Kudos

Hi Rajnish,

tks for the reply. I'm searching for an explanation for how does SNP heuristics know where to take the numbers from. You can assume I know what a PLngBook/DataView ist and how macros work and how I can influence numbers shown on a keyfigure in a dataview. Same ist true for relase FCST from DP to SNP - this is well known.

My problem is that I would like to understand how SNP DRP1 knows which keyfigure to treat as Total Demand and which one is Total Supply (or which other keyfigure is finally carrying the delta which is what SNP proposes as additional supply in form of PReqs or whatever).

In a classic SNP PlangBook for Heuristics I can see macros calculating:

1. Total demand (KF = DMDTO) = FCST + DistrDemand (planned) + DistrDemand (confirmed) etc. etc.

2. Total Supply (KF = RECTO) = Stock + DistrReceipts (planned) + DistrReceipts(confirmed) etc. etc.

Lets assume Total Demand is 100 and Total Supply is 80 ... how the heck does the system know that 20 ist the delta where it has to create PReqs for since it is nowhere define that the system should calculate [DMDTO - RECTO]. Or is there another KF which is doing this ?

Regrds

Thomas

somnath_manna
Active Contributor
0 Kudos

From my understanding (trying to locate relevant SAP Note / help link) the Total Demand - Total Receipts - Stock on Hand results in net requirement which is populated in Supply Shortage keyfigure. All this calculation is done by macro in the SNP Planning Book. Only when there is Supply Shortage the SNP Heuristic uses it as net requirement and then looks up Location-Product master data for Lot Size, Procurement Type and apply them to determine / create the Receipt Elements (Purchase Reqs / Stock Transfer Reqs / SNP Planned Orders).

Hope this helps.

Somnath

thomas_schulze2
Active Participant
0 Kudos

Hi Somnath,

this is exactly what I'm looking for - how does SNP DRP1 know what the "NetRequirement" is ? I can't figure out the keyfigure(s) which have this Supply Shortage.

I see the macros calculating Total Demand (KF=DMDTO) and Total Supply (KF=RECTO). But then it comes to Projected Inventory (KF=STOCK) the equation = INITIAL_STOCK - DMDTO + RECTO is counting then "DistributionReceipts (planned)" in RECTO as Supply where I would have expected somewhere SNP DRP1 has to derive the NetRequirement first since DistrReceipts are being created whithin SNP run to cover the supply shortage. I see another keyfigure "NETDM" (NetDemand) but no macro using this keyfigure.

Maybe you/others can explain this or have source there is being clarified.

Thanks

Thomas

somnath_manna
Active Contributor
0 Kudos

The main program for SNP Heuristic is /SAPAPO/SAPLMSDP_SNPHEU

Looking at /SAPAPO/LMSDP_SNPHEUUXX you can get an idea of the programs / function modules called in sequence for the different Heuristic calculations.

Hope this helps.

Somnath

I did some more digging to see how the keyfigure data we see in Interactive Planning is used in the SNP Heuristic programs

for example include /sapapo/lmsdp_snpheuu01 or function module /SAPAPO/MSDP_SNPHEU_STOCK_CALC is used to compute the Stock.

In code a function module is called as below

call function '/SAPAPO/MSDP_SNPMAK_STO_CAL'

exporting

iv_abgang = <fs_dmdto>

iv_zugang = <fs_recto>

iv_bestand = lv_stock

importing

ev_bestand = lv_stock

The field symbols fs_dmdto, fs_recto, fs_stock are assigned to changing parameter CT_REIS which essentially links to strcuture /SAPAPO/MSNP_REIS Receipt / issue elements.

If you see this structure you will immediately realise its nothing but a mapping of each and every keyfigure in SNP Planning Book / Data View at a Product / location (MATID, LOCID) and Time Bucket (TSTFR, TSTTO) combination.

Edited by: Somnath Manna on Aug 25, 2009 6:09 PM

thomas_schulze2
Active Participant
0 Kudos

I assume the same looking at your explanation .. obviously SNP Heur is using

DMDTO ("total demand")

RECTO ("total supply")

STOCK ("projected stock")

in order to calculate the net requirements. That should answer my question.

My conclusion: in SNP PlngBooks you need to fill these 3 keyfigures correctly in order to achieve your planning result. I was wondering if it is sufficient to fill STOCK only ... but looks like SAP SNP Heuristic is reading the other 2 keyfigures too (dmdto, recto)

Tks a lot !

best Regards

Thomas

Former Member
0 Kudos

Hi

Well you are sort of correct in so much as the values in those key figures are the ones that will be used by the Heuristics, but not directly. Let me explain further, the macros calculate the values and present them in those KF's to give a display in the planning book, these values are made up of several other KF's in total. It is the individual KF's that are used in the Heuristic.

The Heuristic itself will use key figures that have a "Key Figure Function" assigned to them in the planning area. It is the Key Figure Function that tells the various planning functions which key figure represents what item of planning data they require. For example KFF 1001 represents Sales Orders, KFF 3003 represents Safety Stock and KFF 3004 represents Initial Stock.

You can calculate what you want in macros and put this value in a Key Figure, but the key figure has to have the correct KFF assigned for the Heuristics to use it correctly.

To make matters worse for us all, there is no officially released explaination of the exact function of each KFF, how it is calculated, which planning functions use it for what etc etc.

Hope that all makes sense

Regards

Ian

thomas_schulze2
Active Participant
0 Kudos

Hi Ian,

"You can calculate what you want in macros and put this value in a Key Figure, but the key figure has to have the correct KFF assigned for the Heuristics to use it correctly" ... thats sort of what I was running after.

Sounds like it's a mistake to believe if one calculates "Total Demand (DMDTO)" & "Total Supply (RECTO)" KF in an SNP planning book that this is what SNP Heur will use to calculate the PlndOrders/PReqs. Im was wondering already why the those 2 "Total" KFs are only temporary keyfigures (no permanent LC keyfigures).

A bit strange in my eyes that there is no official explanation how to get to the exact mechanism of the "simplest" planning approach in APO (SNP Heur) - at least this is what I thought up to now. That makes CTM favourable in terms of the fact that you can at least define which ATP category should be in or out as a demand/supply element for the final calculation where in SNP heuristics this is somewhat hidden in the APO coding.

Best Regards

Thomas

Former Member
0 Kudos

Hi Ian, Thomas,

I was actually under the impression that the heuristic was based on the KFF 3004 (projected stock).

My understanding was that the heuristic compares the projected stock with expected safety stock, and then decide to replan or not.

For sure the distribution receipt planned and production plan need to be known as well...

But the heuristic does not need to know the total demand and total receipt if it laready know the projected stock...

Unfortunately I do not have a system to test that know... Could you give it a go? For example try to exclude the TLB confirmed order from the receipt (this will change your projected stock) and see if the system plan differently (more)...

Thanks and Regards

Julien

thomas_schulze2
Active Participant
0 Kudos

Hi Julien,

you said you would assume SNP Heur is basically using only one KF with a specific KFF --> the "Projected stock" KF via KFF 3004.

Now the question is - Is it sufficient to calculate the "Projected stock" KF only - no matter if you use "Total Demand" and "total Supply" numberwise in a consistent fashion - in an artifical test I should be able to have in the planning book following situation:

Total Demand = 100 (my own macro)

Total Supply = 200 (my own macro)

Projected Stock = 30 (my own macro)

Target Stock level (derived from ReorderQty) = 70 (my own macro)

.. means SNP Heur would propose 40 units (70-30 = 40) to be produced/procured although supply is higher than demand ?

Guess, this is worth a test to see if SNP heuristics is truly working only based on what number is in "Projected Stock" KF - no matter what number you put on Total Dmd and/or Supply.

Best Regards

Thomas

Former Member
0 Kudos

Hi Thomas,

Please test and let us know.

One comment though: you need to ensure consistency: the order the heurstic is created need to be considered in the prohjected stock calculation (it needs to increase your projected stock to 70, else the system could potentially plan indefinitively!).

Hence I suggested to remove TLB only...

Again I can't test on my side, so let us know how it goes!

Thanks and Regards

Julien