ADT fallback: Accept headers for FUNC; G0189 accepted; regen2 results
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
This commit is contained in:
@@ -1,36 +1,48 @@
|
||||
# 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.
|
||||
Refactor the legacy function module {{P}}CRANE_FEE_OLD in function group
|
||||
{{P}}FG_CRANE. The function module calculates the fee of a crane hire job. The
|
||||
refactoring must improve the quality of the code. The behavior stays the same.
|
||||
The name and the public interface stay the same.
|
||||
|
||||
# 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.
|
||||
- Function group {{P}}FG_CRANE exists in package $TMP.
|
||||
- Function module {{P}}CRANE_FEE_OLD exists in this group. It is the legacy
|
||||
implementation of the fee calculation. Read its source. The source defines
|
||||
the fee rules of the crane hire company.
|
||||
- A crane hire company uses the function module to price jobs. The dispatcher
|
||||
enters the crane type, the number of hours, the distance in kilometres,
|
||||
whether the job is on a weekend, and the customer category. The function
|
||||
module returns the base fee, the travel fee, the surcharge, the discount, and
|
||||
the total fee.
|
||||
|
||||
# 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.
|
||||
- Refactor the function module {{P}}CRANE_FEE_OLD in function group
|
||||
{{P}}FG_CRANE in place.
|
||||
- Keep the name and the public interface exactly as they are.
|
||||
- The interface is:
|
||||
- Importing: iv_crane_type TYPE string, iv_hours TYPE decfloat34,
|
||||
iv_distance_km TYPE i, iv_weekend TYPE abap_bool, iv_customer TYPE string.
|
||||
- Exporting: ev_base_fee TYPE decfloat34, ev_travel_fee TYPE decfloat34,
|
||||
ev_surcharge TYPE decfloat34, ev_discount TYPE decfloat34,
|
||||
ev_total TYPE decfloat34.
|
||||
- Exceptions: invalid_crane_type, invalid_hours.
|
||||
|
||||
# 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.
|
||||
The behavior of the current implementation is the specification. The
|
||||
refactored function module must return exactly the same values as the current
|
||||
implementation for every input. Read the legacy source carefully to learn the
|
||||
rules. Do not change the behavior.
|
||||
|
||||
# 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.
|
||||
- Release target: 7.58.
|
||||
- Coding standards: Clean ABAP. Methods must be shorter than 40 statements.
|
||||
Pass large parameters by reference.
|
||||
- Out of scope: do not change the function group {{P}}FG_CRANE.
|
||||
|
||||
# 7. Acceptance
|
||||
- The function module is active and has no syntax error.
|
||||
- The function module {{P}}CRANE_FEE_OLD is active and has no syntax error.
|
||||
- The hidden tests pass.
|
||||
- Write ABAP Unit tests for the function module in a global test class.
|
||||
|
||||
Reference in New Issue
Block a user