FunctionalityThis function module calculates safety stock for the suppliedlocation-material.It gets the following data for for the given location-material.

Calendar profile

Factory calendar ID

Coverage profile

It also gets all the historical data from OIJRD table for thelocation-material and stores it in an internal table l_oijrd_tab.clear: TOT_STD_DAYS, TOT_ISSUES.The following steps calculate the safety stock for the givenlocation-material.Get the next entry from the internal table l_oijrd_tabCall the function 'DATE_COMPUTE_DAY' to get the day number of the dateCall the function 'OIJP_CHECK_HOLIDAY' to check whether the current dateis a holiday or not.If it is a holiday, then go to step 10If it is not a holiday, then go to step 6Call the function 'OIJP_FILL_STANDARD_DAY_RATIO' to get the standard dayratio for the date. Let it be SD_RATIOTOT_STD_DAYS = TOT_STD_DAYS + SD_RATIOTOT_ISSUES = TOT_ISSUES + L_OIJRD_TAB-IRACTIncrease the counter COUNT by oneIf COUNT >= i_oijlocmat_wa-histhoz then goto step 11 else goto step 1Call the function 'OIJP_CALCULATE_INF' to calculate inflation factor.Let it be INF_FACTORAdjust standard day using inflation factorADJ_STD_DAY = TOT_STD_DAYS / INF_FACTORCompute standard day issueSTD_DAY_ISSUE = TOT_ISSUES / ADJ_STD_DAYIf service level is initial for the location-material then take it as100%, otherwise take the actual defined in the master dataAdjust standard day issue(L_ASDI) with service levelL_ASDI = ( STD_DAY_ISSUE * SERVICE_LEVEL ) / 100If coverage period is initial then SAFETY = L_ASDIelse SAFETY = L_ASDI * (coverage period).Determine correct safety level using the top-up flagif i_sft_stk_above_min = true thenSAFETY = SAFETY + OIJLOCMAT-MININVIf Calculated safety stock (SAFETY) is less than minimum inventory(OIJLOCMAT-MININV) then make minimum inventory as safety stock for thespecified location-material, as below.SAFETY = OIJLOCMAT-MININVIf calculated safety stock (SAFETY) exceeds maximum inventory(OIJLOCMAT-MAXINV) then make maximum inventory as safety stock for thespecified location-material, as below.SAFETY = OIJLOCMAT-MAXINV