Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
1.7 KiB
1.7 KiB
1. Goal
Refactor the legacy function module {{P}}SKI_RENTAL_OLD in function group {{P}}FG_SKI. The function module calculates the rental price and the deposit for ski equipment. Improve the readability, the maintainability, and the structure of the code. The behavior must stay the same. The public interface must not change.
2. Open questions
None.
3. Context
- Function group {{P}}FG_SKI exists in package $TMP.
- Function module {{P}}SKI_RENTAL_OLD exists in this group. It contains legacy code.
- A rental program calls the function module. The callers use the current interface.
4. Contract
- The function module {{P}}SKI_RENTAL_OLD keeps its name and its function group.
- The interface stays exactly the same:
- Importing: iv_equipment TYPE string, iv_days TYPE i, iv_customer TYPE string, iv_insurance TYPE abap_bool
- Exporting: ev_price TYPE decfloat34, ev_deposit TYPE decfloat34
- Exceptions: invalid_equipment, invalid_days, invalid_customer
5. Business rules
The business rules are defined by the current implementation of {{P}}SKI_RENTAL_OLD. The behavior must stay the same. Read the legacy code to understand the rules.
6. Constraints
- Release target: 8.16.
- The function module must be active and have no syntax error.
- Refactor the code in place. Do not change the public interface.
- Follow Clean ABAP: small methods, no duplication, meaningful names, constants for literals.
- Out of scope: do not change the function group {{P}}FG_SKI. Do not create new function modules.
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.