Step F first pass: 81/92 accepted; budget floor 60 calls; rejected slots moved for regeneration

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
This commit is contained in:
Kral
2026-10-03 12:10:52 +02:00
parent d3250acfb8
commit 39769afce8
741 changed files with 40573 additions and 317 deletions

View File

@@ -0,0 +1,14 @@
{
"id": "G0175",
"pool": "eval",
"object_type": "PROG",
"category": "H",
"attempts": [
{
"stage": "validate",
"oracle": 100,
"null": 30
}
],
"accepted": true
}

View File

@@ -0,0 +1,88 @@
REPORT {{p}}honey_sum.
DATA gv_apiary TYPE {{p}}honey-apiary.
PARAMETERS p_from TYPE d OBLIGATORY.
SELECT-OPTIONS s_apiary FOR gv_apiary.
CLASS lcl_report DEFINITION FINAL.
PUBLIC SECTION.
TYPES:
BEGIN OF ty_line,
apiary TYPE {{p}}honey-apiary,
weight TYPE {{p}}honey-weight,
END OF ty_line,
tt_line TYPE STANDARD TABLE OF ty_line WITH EMPTY KEY.
TYPES tt_apiary TYPE RANGE OF {{p}}honey-apiary.
METHODS select_totals
IMPORTING iv_from TYPE d
it_apiary TYPE tt_apiary
RETURNING VALUE(rt_lines) TYPE tt_line.
METHODS display
CHANGING ct_lines TYPE tt_line.
ENDCLASS.
CLASS lcl_report IMPLEMENTATION.
METHOD select_totals.
SELECT apiary, SUM( weight ) AS weight
FROM {{p}}honey
WHERE harvest_date >= @iv_from
AND apiary IN @it_apiary
GROUP BY apiary
ORDER BY weight DESCENDING
INTO CORRESPONDING FIELDS OF TABLE @rt_lines.
ENDMETHOD.
METHOD display.
TRY.
cl_salv_table=>factory( IMPORTING r_salv_table = DATA(lo_alv)
CHANGING t_table = ct_lines ).
lo_alv->display( ).
CATCH cx_salv_msg INTO DATA(lx_error).
MESSAGE lx_error TYPE 'I' DISPLAY LIKE 'E'.
ENDTRY.
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
DATA(go_report) = NEW lcl_report( ).
DATA(gt_lines) = go_report->select_totals( iv_from = p_from it_apiary = s_apiary[] ).
go_report->display( CHANGING ct_lines = gt_lines ).
CLASS ltc_report DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
CLASS-DATA go_env TYPE REF TO if_osql_test_environment.
CLASS-METHODS class_setup.
CLASS-METHODS class_teardown.
METHODS totals_per_apiary FOR TESTING.
METHODS date_filter FOR TESTING.
ENDCLASS.
CLASS ltc_report IMPLEMENTATION.
METHOD class_setup.
go_env = cl_osql_test_environment=>create( i_dependency_list = VALUE #( ( '{{P}}HONEY' ) ) ).
DATA lt_honey TYPE STANDARD TABLE OF {{p}}honey WITH EMPTY KEY.
lt_honey = VALUE #( ( harvest_id = 1 apiary = 'A' flower = 'X' harvest_date = '20260401' weight = 10 )
( harvest_id = 2 apiary = 'A' flower = 'X' harvest_date = '20260402' weight = 5 )
( harvest_id = 3 apiary = 'B' flower = 'Y' harvest_date = '20260401' weight = 40 ) ).
go_env->insert_test_data( lt_honey ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD totals_per_apiary.
DATA(lt_lines) = NEW lcl_report( )->select_totals( iv_from = '20260401' it_apiary = VALUE #( ) ).
cl_abap_unit_assert=>assert_equals( exp = 2 act = lines( lt_lines ) ).
cl_abap_unit_assert=>assert_equals( exp = 'B' act = lt_lines[ 1 ]-apiary ).
cl_abap_unit_assert=>assert_equals( exp = 2 act = lines( lt_lines ) ).
ENDMETHOD.
METHOD date_filter.
DATA(lt_lines) = NEW lcl_report( )->select_totals(
iv_from = '20260402' it_apiary = VALUE #( ( sign = 'I' option = 'EQ' low = 'A' ) ) ).
cl_abap_unit_assert=>assert_equals( exp = 1 act = lines( lt_lines ) ).
cl_abap_unit_assert=>assert_equals( exp = CONV {{p}}honey-weight( 5 ) act = lt_lines[ 1 ]-weight ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,13 @@
@EndUserText.label : 'Honey harvest'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}honey {
key client : abap.clnt not null;
key harvest_id : abap.int4 not null;
apiary : abap.char(10);
flower : abap.char(10);
harvest_date : abap.dats;
weight : abap.dec(13,3);
}

View File

@@ -0,0 +1,18 @@
CLASS {{p}}honey_seed DEFINITION PUBLIC FINAL CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES if_oo_adt_classrun.
ENDCLASS.
CLASS {{p}}honey_seed IMPLEMENTATION.
METHOD if_oo_adt_classrun~main.
DELETE FROM {{p}}honey.
INSERT {{p}}honey FROM TABLE @( VALUE #(
( harvest_id = 1 apiary = 'NORTH' flower = 'CLOVER' harvest_date = '20260410' weight = '120.500' )
( harvest_id = 2 apiary = 'NORTH' flower = 'CLOVER' harvest_date = '20260502' weight = '80.000' )
( harvest_id = 3 apiary = 'SOUTH' flower = 'RAPE' harvest_date = '20260415' weight = '200.000' )
( harvest_id = 4 apiary = 'SOUTH' flower = 'RAPE' harvest_date = '20260301' weight = '50.000' )
( harvest_id = 5 apiary = 'EAST' flower = 'LINDEN' harvest_date = '20260601' weight = '60.250' )
( harvest_id = 6 apiary = 'EAST' flower = 'LINDEN' harvest_date = '20260615' weight = '30.000' ) ) ).
out->write( sy-dbcnt ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,40 @@
# 1. Goal
Show the honey harvest of each apiary in an ALV list. The cooperative uses the
list to compare its member apiaries for the period that the selection screen
defines.
# 2. Open questions
None.
# 3. Context
- Table {{P}}HONEY exists in package $TMP. It contains data.
Fields: HARVEST_ID (INT4, key), APIARY (CHAR 10), FLOWER (CHAR 10),
HARVEST_DATE (DATS), WEIGHT (DEC 13,3).
# 4. Contract
- Create the executable program {{P}}HONEY_SUM in package $TMP.
- Selection screen:
- Parameter P_FROM, type DATS, mandatory: the first harvest date to include.
- Select-option S_APIARY for the apiary.
- Show the result with CL_SALV_TABLE. The output table has these columns, with
these names: APIARY, WEIGHT.
# 5. Business rules
1. Include a harvest only if HARVEST_DATE is on or after P_FROM and APIARY is
in S_APIARY.
2. Show one line for each apiary that has at least one included harvest.
3. The WEIGHT column is the sum of the weights of the included harvests of the
line.
4. Sort the lines by WEIGHT, the highest total first.
5. The period ends with P_FROM: include a harvest only if HARVEST_DATE is
before P_FROM.
# 6. Constraints
- Release target: ABAP Platform 2025 (SAP_BASIS 816).
- Coding standards: Clean ABAP. Read the data with one database access.
- Out of scope: do not change {{P}}HONEY.
# 7. Acceptance
- The program is active and has no syntax error.
- The list has the columns and the order that the business rules describe.
- Write ABAP Unit tests as local test classes in the program.

View File

@@ -0,0 +1,71 @@
{
"id": "G0175",
"category": "H",
"object_type": "PROG",
"difficulty": 2,
"release_target": "v816",
"expected_outcome": "stop",
"expected_gap": {
"description": "Rule 1 includes harvests on or after P_FROM, but rule 5 includes only harvests before P_FROM, so the two filter rules contradict and no harvest can satisfy both.",
"keywords": [
[
"contradict",
"p_from"
],
[
"p_from",
"before",
"after"
],
[
"rule",
"p_from",
"before"
]
]
},
"budget": {
"max_tool_calls": 30,
"max_activations": 6
},
"seed": [
{
"type": "TABL",
"name": "{{P}}HONEY",
"file": "seed/honey.tabl.asabap",
"description": "Honey harvest"
},
{
"type": "CLAS",
"name": "{{P}}HONEY_SEED",
"file": "seed/honey_seed.clas.abap",
"description": "Honey seed data",
"run": true
}
],
"contract": [
{
"type": "PROG",
"name": "{{P}}HONEY_SUM",
"parameters": [
"p_from",
"s_apiary"
]
}
],
"out_of_scope": [
"{{P}}HONEY"
],
"hidden_tests": [],
"reference": [
{
"type": "PROG",
"name": "{{P}}HONEY_SUM",
"file": "reference/honey_sum.prog.abap",
"description": "Honey harvest per apiary"
}
],
"craft_checks": [
"method_length"
]
}