Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
42 lines
1.6 KiB
Markdown
42 lines
1.6 KiB
Markdown
# 1. Goal
|
|
Show the daily food cost of each enclosure in the zoo in an ALV list. The zoo
|
|
keeper uses the list to plan the daily food order.
|
|
|
|
# 2. Open questions
|
|
None.
|
|
|
|
# 3. Context
|
|
- The table {{P}}ANIMAL exists in package $TMP and contains data.
|
|
Fields: ANIMAL_ID (INT4, key), ENCLOSURE (CHAR 10), SPECIES (CHAR 20),
|
|
WEIGHT_KG (DEC 5,1), FOOD_COST (DEC 9,2).
|
|
- FOOD_COST is the daily food cost of one animal in euro.
|
|
|
|
# 4. Contract
|
|
- Create the executable program {{P}}ZOO_FEED in package $TMP.
|
|
- Selection screen:
|
|
- Parameter P_MINWG, type {{P}}ANIMAL-WEIGHT_KG, mandatory: the smallest
|
|
weight of an animal to include.
|
|
- Select-option S_ENCL for the enclosure.
|
|
- Show the result with CL_SALV_TABLE. The output table has these columns with
|
|
these names: ENCLOSURE, ANIMALS, COST.
|
|
|
|
# 5. Business rules
|
|
1. Include an animal only if WEIGHT_KG is greater than or equal to P_MINWG and
|
|
ENCLOSURE is in S_ENCL.
|
|
2. Show one line for each enclosure that has at least one included animal.
|
|
3. ANIMALS is the number of included animals of the enclosure.
|
|
4. COST is the sum of FOOD_COST of the included animals of the enclosure.
|
|
5. Sort the lines by COST, the highest cost first.
|
|
6. If two lines have the same COST, sort them by ENCLOSURE in ascending order.
|
|
|
|
# 6. Constraints
|
|
- Release target: 7.40 SP05. Use only ABAP syntax that is available in this
|
|
release. Do not use syntax of a newer release.
|
|
- Coding standards: Clean ABAP. Read the data with one database access.
|
|
- Out of scope: do not change {{P}}ANIMAL.
|
|
|
|
# 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.
|