Skip to Content
0

Allocation PO date based on planning cycle in material master

Jun 13, 2017 at 12:33 PM

104

avatar image

Hi Experts,

I need your help to understand the logic behind planning cycle in article master MARC view.

I have a forecast delivery date e.g.: today 16/06/2017. this is my input start point.

I am using allocation strategy /rule(functionality) in ECC IS retail.

Now I need to calculate -->back track the allocation PO date,so that I can meet up the forecast delivery date (16/06/2017).

Now from date (16/06/2017) I subtract pl. deliv. time = 1 days

using FM -->BKK_ADD_WORKINGDAY --> which gives me 15/06/2017 ( Thursday)

now as per planning cycle = 209 --> it should be Tue and Fri.

So the allocation PO date(back track principle) should be set as 13/06/2017(Tuesday)

How do I calculate this Tuesday? ANY hint from any table ? or any FM in SAP can help the same?

Please provide your valuable input.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Avik Mazumder Jun 17, 2017 at 07:44 AM
0

Hi Fransisco,

First of all thanks to you for your kind answer to encourage me and my stupid question.

We all love the theory K.I.S.S, is n't it :)

Your factory calender tx SCAL prompted me to do some research further on this issue over weekend.

I derived a simple logic to achieve this solution with some pseudo logic below,will explain the ABAPer over next week.

If anybody has a better way of doing this,please do share your knowledge.

------------------Start------------------

from above example I already arrived on the date based on PDT time deduction -> which gives me 15/06/2017 ( Thursday),

Now ,for planning cycle I go to table T439J ,and give input as site =1392 and planning cycle= 209.

It returns me Two entry with WEEK DAY value ,i.e. 2(Tuesday) and 5(Friday) I store it into internal table A

now I use FM -> DATE_COMPUTE_DAY and input is my date already arrived , i.e.15/06/2017 ( Thursday),

and it gives me return WEEK DAY value ,i.e. 4.

Now I can loop into table A and read the value week day = 4, Pseudo logic as below

lv_weekday_new = 4.

Do 5 times.

read table A with key WEEK DAY = lv_weekday_new..

if sys-subrc = 0."found the value

* means the date arrived can be used as planning run for PO date.

EXIT. "exit from do loop.

else.

* try to find lower matching entry

lv_weekday_new = lv_weekday_new -1.

endif.

enddo.

After above operation ,,,Now my lv_weekday_new = 2.

so I need to deduct 4- 2 = 2 more days from the 1st arrived date i.e.15/06/2017 ( Thursday),

For this I can use same old FM -->BKK_ADD_WORKINGDAY.

Finally I arrive logically to the expected date 13/06/2017(Tuesday)

------------------End------------------

Regards,

Avik

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Avik Mazumder Jun 14, 2017 at 04:35 PM
0

Hello Experts,

can you please help with your valuable inputs on the above issue?

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jun 15, 2017 at 02:19 PM
0

Hello, Avik.

The Planning cycle is used to define the days on which a material can be provisioned (run replenishment). The delivery dates are defined in the lead time of the supplier (REG INFO, EINE-APLFZ) or the CD (MARC - PLIFZ) depends on supply sourse in this case you use "2" (the supplier is Distribution Center, lead time 1 day). Is import know you factory calendar (Tx SCAL) that defines the working days (If one day is not workable, the delivery date will be the following day) . If you use allocation table the days define you.

best regards, FMD

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Fransisco,

First of all thanks to you for your kind answer to encourage me and my stupid question.

We all love the theory K.I.S.S, is n't it :)

Your factory calender tx SCAL prompted me to do some research further on this issue over weekend.

I derived a simple logic to achieve this solution with some pseudo logic below,will explain the ABAPer over next week.

If anybody has a better way of doing this,please do share your knowledge.

------------------Start------------------

from above example I already arrived on the date based on PDT time deduction -> which gives me 15/06/2017 ( Thursday),

Now ,for planning cycle I go to table T439J ,and give input as site =1392 and planning cycle= 209.

It returns me Two entry with WEEK DAY value ,i.e. 2(Tuesday) and 5(Friday) I store it into internal table A

now I use FM -> DATE_COMPUTE_DAY and input is my date already arrived , i.e.15/06/2017 ( Thursday),

and it gives me return WEEK DAY value ,i.e. 4.

Now I can loop into table A and read the value week day = 4, Pseudo logic as below

lv_weekday_new = 4.

Do 5 times.

read table A with key WEEK DAY = lv_weekday_new..

if sys-subrc = 0."found the value

* means the date arrived can be used as planning run for PO date.

EXIT. "exit from do loop.

else.

* try to find lower matching entry

lv_weekday_new = lv_weekday_new -1.

endif.

enddo.

After above operation ,,,Now my lv_weekday_new = 2.

so I need to deduct 4- 2 = 2 more days from the 1st arrived date i.e.15/06/2017 ( Thursday),

For this I can use same old FM -->BKK_ADD_WORKINGDAY.

Finally I arrive logically to the expected date 13/06/2017(Tuesday)

------------------End------------------

Regards,

Avik

0