Programme SAP ROIJSSC - TSW: Safety / Target Stock Calculation

Description
Calculation of safety stock for a location/material combination.
The safety stock level is usually set somewhere near the lower end of atank's inventory, commonly between the minimum and re-order pointinventory levels.
The safety stock calculation basically runs along the following lines:
1) Determine the strategy (for example: routine)
2) Poll historical data
3) "Manipulate" historical data according to rules in the routine
4) Validate and publish the result
TEST-RUN check box
If this check box is set, it will display the calculated safety stockvalue, otherwise, it will update database table OIJLOCMAT with thenewly-calculated safety stock value.

Precondition
Function module used:
1) OIJP_DETERMINE_SFTSTK_ROUTINE
Determine used safety stock calc. routine based on SFTTYPE
2) Determined safety stock calc. routine from Step 1 is invoked tocalculate safety stock for the specified location-material.
Flow of logic:
FORM CALCULATE_SAFETY_STOCK.
1) Retrieve relevant data from table OIJLOCMAT.
2) If no relevant data exists, go to step 7.
3) Call OIJP_DETERMINE_SFTSTK_ROUTINE to determine the planning routineto be called based on SFTTYPE.
4) Call the relevant ROUTINE determined in Step 3 to calculate safetystock for the location/material.
5) If the safety stock is calculated successfully, then update the newsafety level in internal table G_SFTSTK_LOCMAT and display the NEWSAFETY STOCK value. Go to Step 1.
6) Otherwise, shows relevant error and go to step 1.
7) If the TEST_RUN flag is blank, then UPDATE the database tableOIJLOCMAT.

Output
Shows the calculated safety stock value for each LOCATION-MATERIALcombination. If the test run flag is initial then shows the updatestatus to the database table.