Files
abap-llm/tasks_gen/eval/G0155/spec.md

2.0 KiB

1. Goal

Show the daily temperature profile of each machine in a factory. A dashboard and an OData service read the profile, so the aggregation must run in the database, in a CDS view.

2. Open questions

None.

3. Context

  • Table {{P}}MACH in package $TMP holds the master data of the machines.
  • Table {{P}}SENSOR in package $TMP holds the raw sensor readings of the machines.
  • The two tables are seed objects. Their column names and their types are not part of this specification. Read the two table definitions in the system before you write the view.

4. Contract

  • Create the CDS view entity {{P}}I_MACHINE_DAY in package $TMP.
  • Elements, with these names: MACHINE_ID (key), READING_DATE (key), MACHINE_NAME, PLANT, READING_COUNT, AVG_VALUE, MAX_VALUE, ALERT_COUNT.
  • No authorization check (#NOT_REQUIRED).

5. Business rules

  1. Only readings of the temperature sensor count. In the raw table, the temperature sensor is identified by the value 'TEMP'. Ignore all readings of other sensors.
  2. Show one row for each machine and each day on which the machine has at least one temperature reading. Do not show a machine on a day without temperature readings.
  3. Show only machines that exist in the machine master table.
  4. READING_COUNT is the number of temperature readings of the machine on that day.
  5. AVG_VALUE is the average of the values of these readings, with 2 decimals.
  6. MAX_VALUE is the highest value of these readings.
  7. ALERT_COUNT is the number of these readings with a value greater than 80.00. A reading with the value 80.00 is not an alert.
  8. MACHINE_NAME is the name of the machine. PLANT is the plant of the machine. Both values come from the machine master table.

6. Constraints

  • Release target: ABAP Platform 2025 (SAP_BASIS 8.16).
  • Coding standards: Clean ABAP.
  • Out of scope: do not change the tables {{P}}MACH and {{P}}SENSOR.

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.