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,44 +1,32 @@
|
||||
# 1. Goal
|
||||
The function module {{P}}CINE_FEE_OLD in function group {{P}}FG_CINE calculates
|
||||
the price of a cinema ticket order. The code is legacy code. Refactor the
|
||||
function module in place. The behavior stays the same. The name and the public
|
||||
interface stay the same.
|
||||
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_CINE exists in package $TMP.
|
||||
- The function module {{P}}CINE_FEE_OLD exists in this function group. It holds
|
||||
the legacy code.
|
||||
- A ticket desk program calls {{P}}CINE_FEE_OLD for each ticket order. This call
|
||||
must not change.
|
||||
- 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
|
||||
- Object: the function module {{P}}CINE_FEE_OLD in function group {{P}}FG_CINE.
|
||||
- Keep the name and the interface of the function module: the same parameter
|
||||
names, parameter kinds, parameter types and the same exception.
|
||||
- Importing parameters: iv_show_type TYPE string, iv_seats TYPE i,
|
||||
iv_show_time TYPE t, iv_cust_type TYPE string.
|
||||
- Exporting parameters: ev_total TYPE decfloat34, ev_discount TYPE decfloat34.
|
||||
- Exception: invalid_input.
|
||||
- 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 legacy source code of {{P}}CINE_FEE_OLD is the only source of the business
|
||||
rules. Read this source code. The one rule of this task: for every input the
|
||||
function module returns the same output values and the same exception as before
|
||||
the refactoring. Do not add, remove or change a rule.
|
||||
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: SAP_BASIS 816.
|
||||
- Coding standards: Clean ABAP. No ATC priority 1 or priority 2 finding. Keep
|
||||
every procedure and every method below 40 statements. Replace literal numbers
|
||||
with named constants. Use meaningful names.
|
||||
- Out of scope: do not change the interface. Do not change the function group
|
||||
{{P}}FG_CINE.
|
||||
- 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
|
||||
- {{P}}CINE_FEE_OLD is active and has no syntax error.
|
||||
- The behavior is unchanged.
|
||||
- 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.
|
||||
|
||||
Reference in New Issue
Block a user