Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
48 lines
2.0 KiB
Markdown
48 lines
2.0 KiB
Markdown
# 1. Goal
|
|
Show the milk deliveries of each farm in an ALV list. The cooperative uses the
|
|
list to compare the farms of a region for a period.
|
|
|
|
# 2. Open questions
|
|
None.
|
|
|
|
# 3. Context
|
|
- Table {{P}}FARM exists in package $TMP. It contains data.
|
|
Fields: FARM_ID (CHAR 10, key), FARM_NAME (CHAR 40), REGION (CHAR 4).
|
|
- Table {{P}}MILK exists in package $TMP. It contains data.
|
|
Fields: DELIV_ID (INT4, key), FARM_ID (CHAR 10), DELIV_DATE (DATS),
|
|
LITRES (DEC 13,2).
|
|
|
|
# 4. Contract
|
|
- Create the executable program {{P}}MILK_SUM in package $TMP.
|
|
- Selection screen:
|
|
- Parameter P_FROM, type DATS, mandatory: the first delivery date to include.
|
|
- Parameter P_TO, type DATS, mandatory: the last delivery date to include.
|
|
- Select-option S_REG for the region.
|
|
- Show the result with CL_SALV_TABLE. The output table has these columns, with
|
|
these names: FARM_ID, FARM_NAME, REGION, LITRES, DELIVERIES.
|
|
|
|
# 5. Business rules
|
|
1. Include a delivery only if DELIV_DATE is on or after P_FROM and on or before
|
|
P_TO. Both limits are included.
|
|
2. Include a farm only if REGION is in S_REG. An empty S_REG includes every
|
|
region. A line with sign E in S_REG excludes its region.
|
|
3. Show one line for each included farm. A farm without an included delivery also
|
|
gets a line.
|
|
4. LITRES is the sum of the litres of the included deliveries of the farm. LITRES
|
|
is 0 if the farm has no included delivery.
|
|
5. DELIVERIES is the number of included deliveries of the farm. DELIVERIES is 0
|
|
if the farm has no included delivery.
|
|
6. Sort the lines by LITRES, the highest value first. If two lines have the same
|
|
LITRES, sort them by FARM_ID, the lowest value first.
|
|
7. FARM_NAME and REGION are the values of the farm.
|
|
|
|
# 6. Constraints
|
|
- Release target: 7.58.
|
|
- Coding standards: Clean ABAP. Read each table with one database access.
|
|
- Out of scope: do not change {{P}}FARM and {{P}}MILK.
|
|
|
|
# 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.
|