21 lines
1.1 KiB
Markdown
21 lines
1.1 KiB
Markdown
Create the CDS view entity {{P}}I_MILK_TOTAL in package $TMP. Use source tables {{P}}FARM and {{P}}MILK. The report and OData service read this view. The calculation must run in the database.
|
|
|
|
Use these element names exactly: FARM_ID (key), FARMER, TOTAL_LITRES, DELIVERY_COUNT. Set the authorization check to #NOT_REQUIRED.
|
|
|
|
Business rules:
|
|
1. Show one row for each farm with total litres greater than 500. Do not show a farm with 500 litres or less. Do not show a farm without a delivery. Do not show a delivery whose farm is not in the farm master.
|
|
2. TOTAL_LITRES is the sum of LITRES for all deliveries of the farm. Use one decimal.
|
|
3. DELIVERY_COUNT is the number of deliveries of the farm.
|
|
4. FARMER is the farmer of the farm.
|
|
5. Group rows by farm. There is exactly one row for each farm.
|
|
|
|
Constraints:
|
|
- Release target: 8.16 (SAP_BASIS 816).
|
|
- Use Clean ABAP. No ATC priority 1 or 2 findings.
|
|
- Do not change {{P}}FARM and {{P}}MILK.
|
|
|
|
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.
|