Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
45 lines
1.8 KiB
Markdown
45 lines
1.8 KiB
Markdown
# 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.
|
|
|
|
# 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.
|
|
|
|
# 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.
|
|
|
|
# 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.
|
|
|
|
# 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.
|
|
|
|
# 7. Acceptance
|
|
- {{P}}CINE_FEE_OLD is active and has no syntax error.
|
|
- The behavior is unchanged.
|
|
- The hidden tests pass.
|
|
- Write ABAP Unit tests for the function module in a global test class.
|