41 lines
1.6 KiB
Markdown
41 lines
1.6 KiB
Markdown
# 1. Goal
|
|
Show the milk that each farm delivered. The cooperative wants only the farms
|
|
that delivered more than 500 litres in total. A report and an OData service
|
|
will read the result, so the calculation must be in the database, in a CDS view.
|
|
|
|
# 2. Open questions
|
|
None.
|
|
|
|
# 3. Context
|
|
- Table {{P}}FARM (farm master), package $TMP. Key: FARM_ID (CHAR 10).
|
|
Fields: FARMER (CHAR 20), REGION (CHAR 10).
|
|
- Table {{P}}MILK (milk delivery), package $TMP. Key: FARM_ID (CHAR 10),
|
|
DELIV_DATE (DATS). Fields: LITRES (DEC 10,1).
|
|
|
|
# 4. Contract
|
|
- Create the CDS view entity {{P}}I_MILK_TOTAL in package $TMP.
|
|
- Elements, with these names: FARM_ID (key), FARMER, TOTAL_LITRES,
|
|
DELIVERY_COUNT.
|
|
- No authorization check (#NOT_REQUIRED).
|
|
|
|
# 5. Business rules
|
|
1. Show one row for each farm whose total litres are more than 500. A farm
|
|
with a total of 500 litres or less must not be shown. A farm without a
|
|
delivery must not be shown. A delivery whose farm is not in the farm
|
|
master must not be shown.
|
|
2. TOTAL_LITRES is the sum of LITRES of all deliveries of the farm, with one
|
|
decimal.
|
|
3. DELIVERY_COUNT is the number of deliveries of the farm.
|
|
4. FARMER is the farmer of the farm.
|
|
5. The rows are grouped by farm. There is exactly one row for each farm.
|
|
|
|
# 6. Constraints
|
|
- Release target: 8.16 (SAP_BASIS 816).
|
|
- Coding standards: Clean ABAP. No ATC priority 1 or 2 findings.
|
|
- Out of scope: do not change {{P}}FARM and {{P}}MILK.
|
|
|
|
# 7. Acceptance
|
|
- The view is active and has no syntax error.
|
|
- The hidden tests pass.
|
|
- Write ABAP Unit tests with CL_CDS_TEST_ENVIRONMENT in a global test class.
|