Files
2026-10-05 22:08:59 +02:00

49 lines
2.0 KiB
Markdown

# 1. Goal
A mobile knife sharpening service visits restaurants and sharpens their knives.
The office needs a summary of the sharpening fees of each customer for a period.
# 2. Open questions
None.
# 3. Context
- Table {{P}}SHARPEN is in package $TMP and contains data.
Fields: ITEM_ID (INT4, key), CUSTOMER (CHAR 10), KNIFE_TYPE (CHAR 5),
KNIFE_COUNT (INT4), SHARP_DATE (DATS).
One row is one item of a sharpening round.
- Table {{P}}KNTYPE is in package $TMP and contains the price list.
Fields: TYPE_ID (CHAR 5, key), PRICE (DEC 15,2).
PRICE is the fee for one knife of that type.
# 4. Contract
- Create the executable program {{P}}SHARP_SUM in package $TMP.
- Selection screen:
- Parameter P_FROM, type DATS, mandatory: the first sharpening date to include.
- Select-option S_CUST for the customer.
- Show the result with CL_SALV_TABLE. The output table has these columns, with
these names:
- CUSTOMER: the customer.
- KNIVES: the total number of knives.
- FEE: the total fee. FEE is an amount with two decimal places.
# 5. Business rules
1. Include an item only if SHARP_DATE is on or after P_FROM and CUSTOMER is in
S_CUST.
2. Include an item only if its KNIFE_TYPE has an entry in {{P}}KNTYPE.
3. The fee of an item is KNIFE_COUNT multiplied by the PRICE of its knife type.
4. Show one line for each customer that has at least one included item.
5. KNIVES is the sum of KNIFE_COUNT of the included items of the customer.
6. FEE is the sum of the fees of the included items of the customer.
7. Sort the lines by FEE, the highest fee first.
# 6. Constraints
- Release target: 7.58.
- Coding standards: Clean ABAP. Read the sharpening items and the prices with
one database access. Do not read the database inside a loop. Keep the methods
below 40 statements.
- Out of scope: do not change {{P}}SHARPEN and {{P}}KNTYPE.
# 7. Acceptance
- The program is active and has no syntax error.
- The hidden tests pass.
- Write ABAP Unit tests as local test classes in the program.