Files
abap-llm/tasks_gen/train/G1301/spec.md

8 lines
1.2 KiB
Markdown

Create class {{P}}HARVEST_EVALUATOR in package $TMP. Make the class public and final. Add a public constructor without parameters. Add one public method EVALUATE with this signature: IMPORTING it_report TYPE {{P}}IF_HARVEST=>TT_REPORT it_member TYPE {{P}}IF_HARVEST=>TT_MEMBER RETURNING VALUE(rt_result) TYPE {{P}}IF_HARVEST=>TT_RESULT. Do not add other public methods.
A harvest report is countable when the member_id of the report occurs in it_member and the quantity_kg of the report is greater than 0. The member_id occurs at most one time in it_member. Group the countable reports by variety. Create one result row for each variety that has at least one countable report. The total_kg of a result row is the sum of the quantity_kg of all countable reports of the variety. The member_count of a result row is the number of different member_id values in the countable reports of the variety. Sort the result rows by total_kg in descending order. When two rows have the same total_kg, sort these rows by variety in ascending order. When no report is countable, return an empty table.
The result table has columns variety, total_kg, and member_count.
Release target is 8.16. Do not change {{P}}IF_HARVEST. Write ABAP Unit tests for the class.