# 1. Goal Refactor the legacy function module {{P}}BOWL_FEE_OLD in place. The behavior must stay the same. Improve the code quality so that the module is easier to maintain. # 2. Open questions None. # 3. Context - Function group {{P}}FG_BOWL exists in package $TMP. - Function module {{P}}BOWL_FEE_OLD exists in this group. It is the legacy implementation of the bowling fee calculation. - The booking program calls this function module. The interface must not change. # 4. Contract - Refactor the function module {{P}}BOWL_FEE_OLD in function group {{P}}FG_BOWL. - Keep the exact interface: the same parameter names, types, and exceptions. - The function module name stays the same. # 5. Business rules The business rules are defined by the current behavior of the legacy code. Read the legacy source code in {{P}}BOWL_FEE_OLD. The refactored function module must produce exactly the same results as the legacy code for every input. Do not change any rule. # 6. Constraints - Release target: SAP_BASIS 816. - Coding standards: Clean ABAP. Use modern ABAP syntax. No obsolete statements (for example COMPUTE, MOVE, ADD ... TO ...). Methods below 40 statements. Pass large parameters by reference. No ATC priority 1 or 2 findings. - Out of scope: do not change the function group {{P}}FG_BOWL. Do not change the function module interface. # 7. Acceptance - The function module is active and has no syntax error. - The hidden tests pass. - Write ABAP Unit tests for the function module in a global test class.