cancel
Showing results for 
Search instead for 
Did you mean: 

Forecast from APO-DP to APO-SNP

Former Member
0 Kudos

Hi,

I am new to APO and i have the following requirement.

'The APO-DP time bucket profile(zprofile) does not include weeks so it is not possible to transfer the forecast in weekly buckets using the standard logic. The standard logic allows for a daily or monthly transfer only'.

I have got the following solutions,

1)There is a SAP enhancement APODM017 that can be used to change the standard forecast transfer buckets.

2)Also the SAP help for Badi "/SAPAPO/SDP_RELDATA" says:

"You can use the CHANGE_RELDATA method to process the demands released from DP to SNP (quantities or dates). You can also change DP-specific data here, such as periodicity"

I am not sure about how to get the monthly data using which i can code a logic to split it into weekly data.

Any suggestion on this would be very helpful.

thank you,

Priya.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Shanmuga,

I think this is possible using BADI /SAPAPO/SDP_RELDATA. You will have to modify the internal tables CT_COLS and CT_TAB that is passed to the class method. I think you will need to create new internal tables inside (e.g. new_ct_cols which is like CT_COLS and new_ct_tab which is like CT_TAB) where you can store the split and the copy the new internal tables to the method output parameters at the end of the routine (so that the new data is saved).

If you would split the month data into weeks, then i think you can do the following:

For each row CT_COLS (that is, for each month), you can create new entries in table NEW_CT_COLS for each week of the month. Then you can store the data that has been split into a new row in new_ct_tab.


w_i = 0.
For each row in CT_COLS
   Get weeks for the current month
   For each week of the current month 
      w_i = w_i + 1
      Create entry in NEW_CT_COLS
      Value of column field of new NEW_CT_COLS entry = w_i
      Save start and from data of curent week to NEW_CT_COL fields
    
      For each row in CT_TAB with Z = CT_COLS-Z
    
         Create entry in NEW_CT_TAB
         
         Value of V field of NEW_CT_TAB entry 
              = value of V field current CT_TAB entry *  
                 weekly_split_percentage.

         Value of Z field of NEW_CT_TAB entry = w_i

ct_tab[] = new_ct_tab[].
ct_cols[] = new_ct_cols[].

Hope this gives you an idea.

Message was edited by: Emmanuel Nepomuceno

Former Member
0 Kudos

Hi Emmanuel,

Thanks a lot for the reply.

I have a doubt regarding the part of the logic below 'Create entry in NEW_CT_TAB'.I am not sure about

1)how the weelky_split_percentage could be calculated.

2)the values of other fields(except v & z)of NEW_CT_TAB would be filled.

thank you,

Priya.

Former Member
0 Kudos

Hi Priya,

The value of "weelky_split_percentage" depends on what business rule you have for splitting month data to weeks. If your month for example has 4 weeks, you may want to assign 0.25 to the "weelky_split_percentage". You will need to implement additional coding to fill-in the "weelky_split_percentage" value. If you can describe the intended busines rule/logic here, then maybe i can help you with the pseudo code or ABAP coding that is needed.

The values of the V and Z can be filled in the same was as you fill up the other fields. You may need to split them also using the "weelky_split_percentage" factor.

Please post again if things are not clear. If you describe exactly how you want to split months into weeks then i can help you with the coding.

Former Member
0 Kudos

Hi Emmanuel,

The Forecast data in APO-DP is kept in monthly buckets. The logic to split monthly buckets into weekly buckets is given as follows:

The first day of the week is Monday.

1)For each monthly forecast, determine the number of days in the month

2)For each monthly forecast calculate the daily quantity by dividing the monthly quantity by the number of days in that month.

3)If a weekly buckets starts and finishes within the same month then the quantity for that weekly bucket is 7 times the daily quantity for the month

4)If a weekly bucket starts within one month and finishes within the next month and there are n days in the first month and 7 – n days in the next month then the quantity for that weekly buckets is n times the daily quantity of the first month + (7 – n) times the daily quantity of the next month.

5)In the case of item d) and there is no next month (at the end of the horizon) the weekly bucket quantity equals n times the daily quantity of the previous month.

6)The weekly forecast quantity will be put on the first day of the week (Monday).

thank you,

Priya.

Answers (0)