FUNCTION EXIT MAINTENANCE PLAN
You can use this customer exit to define, according to your own rules, which maintenance packages that depend on the last counter reading entered are next due for strategy plans. Example in the Standard System
Packages are processed one after another in the Standard System. A
performance-based strategy with two packages (P1 and P2) should serve as an example:
- Cycle P1 = 1.000 km, package hierarchy 1
- Cycle P2 = 5.000 km, package hierarchy 2
In this strategy, package 1 is due four times, while package 2 is due when package 1 has been completed,
independently of the counter reading entered. Example with Functions of the Enhancement
This enhancement enables you to influence the sequence of the packages due in the following way:
- You start a performance-based strategy plan (counter reading: 0 km),
and obtain package P1 as the package due after 1,000 km.
- You create a measurement document with a performance of 1,000 km and obtain package P1 as the package due after 2,000 km.
- You then enter a performance of, for example, 4,500 in a measurement
document. In the standard system however, package P1 is called first after 3,000 km, and again after 4,000 km, while package P2 is first called after 5,000.
- Using the function module EXIT_SAPLIPM5_010, this enhancement, and based on the last counter reading entered, you can now use your own
logic to determine which package is due next (after 5,000 km). With reference to the above example, the P1 packages can be skipped after 3,000 and 4,000 kilometers, and the maintenance tasks for package P2 executed (after 5,000 km).
The current counter reading is transferred to the function module using the parameter SAP_OFFZE_IMP.
You want to influence parameter SAP_OFFZE_EXP of the function module EXIT_SAPLIPM5_010. This parameter decides which packages are due next. If (with reference to the above example) the system returns a value of 4.500 km, package P2 is the next package due after 5,000 km.
A start in the cycle is executed in the system. The offset, which you must set explicitly for this operation, is set by the parameter SAP_OFFZE_EXP. Seen on a timescale, the packages to the right of the returned value (SAP_OFFZE_EXP) are then always the next due.
Delete or Skip Waiting Calls
Since Release 4.6B, you can either delete or skip waiting calls (if they exist) after a normal start in the cycle using IP10. You can use the parameter SAP_CALLS_ON_HOLD to decide whether waiting calls should be
- Deleted (the return value for SAP_CALLS_ON_HOLD is '1'), or
The return value for SAP_CALLS_ON_HOLD is '1'
- Skipped (the return value for SAP_CALLS_ON_HOLD is '2')
The return value for SAP_CALLS_ON_HOLD is '2'
Moreover, you must set an 'X' in the parameter SAP_UPDATE after changing the offset in the function module.
In the program logic of the function module EXIT_SAPLIPM5_010, you must exclude the possibility that the system executes a start in the cycle
several times for a determined offset, as the system will otherwise execute a start in the cycle for every update (->IP30). Example
With reference to the above example, the system determines a return value of 4,500 km (SAP_OFFZE_EXP). This value should be the current
kilometer reading. The system executes a start in the cycle and the next packages due at 5,000 km. Should the system update this maintenance plan again and the resulting kilometer reading be smaller than 5,000 km, the same start in the cycle with the packages due is
executed at 5,000 km. This means that you must program a confirmation prompt that also only executes a start in the cycle if 'certain' prerequisites are met. For example, you should check that no scheduling record exists as a start in the cycle (field TERMA = 'Z') with an offset (field OFFZE) greater than the newly calculated value for
SAP_OFFZE_EXP in the internal table AMHIS (transferred as AMHIS_EXP). Procedure
- Create an enhancement project using transaction CMOD.
- Assign the enhancement IPRM0005 to this project.
- Process the enhancement component in the transaction CMOD:
- EXIT_SAPLIWP3_010: Determine Due Packages for Performance-Based Strategy Plans