cancel
Showing results for 
Search instead for 
Did you mean: 

Period Lot size calculation in SNP heuristic

Former Member
0 Kudos

Hi APO gurus,

We send the truck from Point A to B to replenish stock every 8 days.

So we want the heuristic to builit lot size of 8 days of demand.

The demand only exist on weekdays.

Let say, demand is 10 EA on every workday.

So when I run heuristic on on Monday, I expect a lot size of 80.

But I get only 60., because heuristic does not consider planning workday calendar, but only regular calendar which includes weekend with no demand.

Any suggestion as to how to make heuristic take only workday demand into consideration while calculating lot size in period lot size strategy in SNP heuristic?

Thanks very much,

Ashok

Accepted Solutions (1)

Accepted Solutions (1)

rajkj
Active Contributor
0 Kudos

Hi Ashok,

SNP heuristics uses planning calendar if you use period factor. In location product master settings - lot size tab - Quantity and Date determination tab, check "Use Period Factor" check box and set an appropriate value for period factor (e.g. 0.5).

Thanks,
Rajesh

Former Member
0 Kudos

Are you able to use PP/DS heuristics? Everytime I need something with a Daily logic/constraint I tend to shift to PP.

Former Member
0 Kudos

Hi RAjesh,

Thanks for taking time to answer this issue.

I tried, as you suggested to use period factor in the product master data.

We plan on daily basis using daily buckets.

So after checking the "Use Period factor" box,  we put in the value of 0.500 as "Period Factor".

But the Heuristic planning run still used regular calendar instead of calendar associated with the location (which has non working weekends which has no demand).

So using period factor is not trigerring the inclusion of the location calendar to calcualte the priod lot size. It is still using the regular calendar where weekend has no demand.

Maybe I am missing something else here.

Please let me know.

Thanks,

Ashok

Former Member
0 Kudos

Hi Rafael,

Thanks for taking time to answer this issue.

I am not aware that PP/DS heuristic could be used for SNP planning.

What transaction should I be using for that?

Thanks,

Ashok

rajkj
Active Contributor
0 Kudos

Hi Ashok,

To support periodic lot size procedure with planning calendar, SNP heuristics needs implementation of BAdI /SAPAPO/SNP_PERIO_LS.

The settings mentioned in earliest posts are being supported only with the factory calendar associated with SCM server and planning calendar (period type K) is supported only by PP/DS.

Thanks,

Rajesh

former_member182449
Participant
0 Kudos

Hi Ashok ,

Period Lot Size

Specifies that a period lot-sizing procedure is used in Supply Network Planning (SNP) and Production Planning and Detailed Scheduling (PP/DS).

Use

Use in SNP

This indicator is only used in heuristic-based planning (and not in optimization-based planning). If you set this indicator, the system groups the demand quantities of several consecutive periods together and creates orders to fulfill the quantity of this combined demand.

The period type and number of periods can be entered in the accompanying fields Period Type and No. of Periods. You can set the start time for the grouping in the Lot Size Grp. Start field.

The settings you make in the Lot Size Strategy field govern the period in which the combined demand is placed and the demand fulfillment order is created.

When calculating lot sizes and creating orders, the system considers all the other lot size settings from the location product master, such as minimum and maximum lot size, rounding value, and rounding profile.

former_member182449
Participant
0 Kudos

Dears,

I have also one concern with working with weekly period lot size , system show overload with the demand in weekly lot.

How I can solv this issue ??

BR,

Rami

Former Member
0 Kudos

Hi Rajesh,

We tried extensively to use BAdI /SAPAPO/SNP_PERIO_LS, but there is no way it allows insertion of Planning clendar to calculate the Period lot size.

Our developers tried for 2 weeks and they could not find a way to use this BAdi for SNP heuristic run to consider planning calendar.

Have you been successful to use this BAdi to insert Planning Calendar in calculation of Period Lot Size?

Any help will be appreciated.

Thanks,

Ashok

rajkj
Active Contributor
0 Kudos

Hi Ashok,

Your ABAP experts can take a look at the function group /SAPAPO/SAPLMSDP_SNPHEU - navigate to INCLUDE /SAPAPO/LMSDP_SNPHEUFF1 to access routine "Perform calc_period_lotsize" that calls the BAdI.

You will also find here that the end period is being calculated by the FM '/SAPAPO/PERIOD_DATE_GET_FROMTO' without sending FV value. You may call this FM in your BAdI  exporting period type, number of periods, FV, etc., 

Pl check the code modifications attached to the following SAP notes for an idea.
https://service.sap.com/sap/support/notes/1385472

https://service.sap.com/sap/support/notes/1589896

Thanks,
Rajesh

    

Former Member
0 Kudos

Hi Rajesh,

Absolutely on the Mark.

We were able to use the Badi to make heuristic take take planning calendare into consideration to calculate lot sizes.

We also had some helpful hints from SAP which I am noting it below for future benefits:

Part 1--

BAdi /SAPAPO/SNP_PERIO_LS method: CALC_PERIOD_LOTSIZE1 for your own

logic or method CALC_PERIOD_LOTSIZE2 to adjust the result of the

standard. Here you could read out any calendar, e.g. from the

location, check if parameter IV_TSTTO falls into a working day, do

this x times (x = number of periods) by adding one day to IV_TSTTO, so you can determine the number of non-working days, determine

the total demands from ct_repl for these extra days and manipulate

on CS_REPL_AKT.

Part 2--

BAdi: /SAPAPO/SNP_PERIO_LS

method: CALC_PERIOD_LOTSIZE2 to manipulate on the result of the periodiclot size standard

1. get the e.g. production calendar of the location via parameter

IS_LOCMAT-LOCID from table /SAPAPO/LOC

2. in parameter IV_REPLQ_AKT you see what the system has proposed as

lotsize

3. determine the start and end date of the actual bucket via parameter

IV_PERIOD from ct_repl

4. do IS_LOCMAT-per_Amount times, for each day, use function

/SAPAPO/MSDP_TSTR_CALC_DURAT to see if the bucket is a working day.

You pass start and end of the bucket + calendar and if get a

duration, then this is a working day.

5. take the next bucket, basically for our example you would check the

next 10 buckets and will find out that e.g. 4 are non-working days

6. You apply the above logic also to this 4 days as they could be non

working days as well

7. now you look in table CT_REPL, if you find total demands for the

additional periods and deduct the total receipt. In our case you will see an additional demand of 40cs.

8. you change CS_REPL_AKT and include the 40cs + IV_REPLQ_AKT

9. you change CS_REPL_AKT, increase the REPLQ for the actual period

Answers (0)