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:
14
tasks_gen/eval/G0174/generation.json
Normal file
14
tasks_gen/eval/G0174/generation.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"id": "G0174",
|
||||
"pool": "eval",
|
||||
"object_type": "PROG",
|
||||
"category": "H",
|
||||
"attempts": [
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 100,
|
||||
"null": 30
|
||||
}
|
||||
],
|
||||
"accepted": true
|
||||
}
|
||||
89
tasks_gen/eval/G0174/reference/flower_sales.prog.abap
Normal file
89
tasks_gen/eval/G0174/reference/flower_sales.prog.abap
Normal file
@@ -0,0 +1,89 @@
|
||||
REPORT {{p}}flower_sales.
|
||||
|
||||
DATA gv_flower TYPE {{p}}flsale-flower_type.
|
||||
|
||||
PARAMETERS p_from TYPE d OBLIGATORY.
|
||||
SELECT-OPTIONS s_flower FOR gv_flower.
|
||||
|
||||
CLASS lcl_report DEFINITION FINAL.
|
||||
PUBLIC SECTION.
|
||||
TYPES:
|
||||
BEGIN OF ty_line,
|
||||
flower_type TYPE {{p}}flsale-flower_type,
|
||||
total_revenue TYPE {{p}}flsale-amount,
|
||||
count TYPE i,
|
||||
END OF ty_line,
|
||||
tt_line TYPE STANDARD TABLE OF ty_line WITH EMPTY KEY.
|
||||
TYPES tt_flower TYPE RANGE OF {{p}}flsale-flower_type.
|
||||
METHODS select_totals
|
||||
IMPORTING iv_from TYPE d
|
||||
it_flower TYPE tt_flower
|
||||
RETURNING VALUE(rt_lines) TYPE tt_line.
|
||||
METHODS display
|
||||
CHANGING ct_lines TYPE tt_line.
|
||||
ENDCLASS.
|
||||
|
||||
CLASS lcl_report IMPLEMENTATION.
|
||||
METHOD select_totals.
|
||||
SELECT flower_type, SUM( amount ) AS total_revenue, COUNT( * ) AS count
|
||||
FROM {{p}}flsale
|
||||
WHERE sale_date >= @iv_from
|
||||
AND flower_type IN @it_flower
|
||||
GROUP BY flower_type
|
||||
ORDER BY total_revenue 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_flower = s_flower[] ).
|
||||
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_flower FOR TESTING.
|
||||
METHODS flower_filter FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
CLASS ltc_report IMPLEMENTATION.
|
||||
METHOD class_setup.
|
||||
go_env = cl_osql_test_environment=>create( i_dependency_list = VALUE #( ( '{{P}}FLSALE' ) ) ).
|
||||
DATA lt_sale TYPE STANDARD TABLE OF {{p}}flsale WITH EMPTY KEY.
|
||||
lt_sale = VALUE #( ( sale_id = 1 flower_type = 'ROSE' sale_date = '20260101' amount = 10 )
|
||||
( sale_id = 2 flower_type = 'ROSE' sale_date = '20260102' amount = 5 )
|
||||
( sale_id = 3 flower_type = 'TULIP' sale_date = '20260101' amount = 40 ) ).
|
||||
go_env->insert_test_data( lt_sale ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD totals_per_flower.
|
||||
DATA(lt_lines) = NEW lcl_report( )->select_totals( iv_from = '20260101' it_flower = VALUE #( ) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 2 act = lines( lt_lines ) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'TULIP' act = lt_lines[ 1 ]-flower_type ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 2 act = lt_lines[ 2 ]-count ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD flower_filter.
|
||||
DATA(lt_lines) = NEW lcl_report( )->select_totals(
|
||||
iv_from = '20260101' it_flower = VALUE #( ( sign = 'I' option = 'EQ' low = 'ROSE' ) ) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = lines( lt_lines ) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV {{p}}flsale-amount( 15 ) act = lt_lines[ 1 ]-total_revenue ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
12
tasks_gen/eval/G0174/seed/flsale.tabl.asabap
Normal file
12
tasks_gen/eval/G0174/seed/flsale.tabl.asabap
Normal file
@@ -0,0 +1,12 @@
|
||||
@EndUserText.label : 'Flower sales'
|
||||
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
|
||||
@AbapCatalog.tableCategory : #TRANSPARENT
|
||||
@AbapCatalog.deliveryClass : #A
|
||||
@AbapCatalog.dataMaintenance : #RESTRICTED
|
||||
define table {{p}}flsale {
|
||||
key client : abap.clnt not null;
|
||||
key sale_id : abap.int4 not null;
|
||||
flower_type : abap.char(10);
|
||||
sale_date : abap.dats;
|
||||
amount : abap.dec(15,2);
|
||||
}
|
||||
17
tasks_gen/eval/G0174/seed/t15_seed.clas.abap
Normal file
17
tasks_gen/eval/G0174/seed/t15_seed.clas.abap
Normal file
@@ -0,0 +1,17 @@
|
||||
CLASS {{p}}t15_seed DEFINITION PUBLIC FINAL CREATE PUBLIC.
|
||||
PUBLIC SECTION.
|
||||
INTERFACES if_oo_adt_classrun.
|
||||
ENDCLASS.
|
||||
|
||||
CLASS {{p}}t15_seed IMPLEMENTATION.
|
||||
METHOD if_oo_adt_classrun~main.
|
||||
DELETE FROM {{p}}flsale.
|
||||
INSERT {{p}}flsale FROM TABLE @( VALUE #(
|
||||
( sale_id = 1 flower_type = 'ROSE' sale_date = '20260110' amount = '100.00' )
|
||||
( sale_id = 2 flower_type = 'ROSE' sale_date = '20260210' amount = '50.00' )
|
||||
( sale_id = 3 flower_type = 'TULIP' sale_date = '20260115' amount = '300.00' )
|
||||
( sale_id = 4 flower_type = 'DAISY' sale_date = '20251231' amount = '500.00' )
|
||||
( sale_id = 5 flower_type = 'DAISY' sale_date = '20260301' amount = '20.00' ) ) ).
|
||||
out->write( sy-dbcnt ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
31
tasks_gen/eval/G0174/spec.md
Normal file
31
tasks_gen/eval/G0174/spec.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# 1. Goal
|
||||
Show the total revenue and the number of sales for each flower type in an ALV list. The florist uses the list to compare flower types for a period.
|
||||
|
||||
# 2. Open questions
|
||||
None.
|
||||
|
||||
# 3. Context
|
||||
- Table {{P}}FLSALE exists in package $TMP. It contains data.
|
||||
Fields: SALE_ID (INT4, key), FLOWER_TYPE (CHAR 10), SALE_DATE (DATS), AMOUNT (DEC 15,2).
|
||||
|
||||
# 4. Contract
|
||||
- Create the executable program {{P}}FLOWER_SALES in package $TMP.
|
||||
- Selection screen:
|
||||
- Parameter P_FROM, type DATS, mandatory: the first sale date to include.
|
||||
- Select-option S_FLOWER for the flower type.
|
||||
- Show the result with CL_SALV_TABLE. The output table has these columns, with these names: FLOWER_TYPE, TOTAL_REVENUE (sum of AMOUNT), COUNT (number of sales).
|
||||
|
||||
# 5. Business rules
|
||||
1. Include a sale only if SALE_DATE is on or after P_FROM and FLOWER_TYPE is in S_FLOWER.
|
||||
2. Show one line for each flower type that has at least one included sale.
|
||||
3. Sort the lines by TOTAL_REVENUE.
|
||||
|
||||
# 6. Constraints
|
||||
- Release target: 816.
|
||||
- Coding standards: Clean ABAP. Read the data with one database access.
|
||||
- Out of scope: do not change {{P}}FLSALE.
|
||||
|
||||
# 7. Acceptance
|
||||
- The program is active and has no syntax error.
|
||||
- The hidden tests pass.
|
||||
- Write ABAP Unit tests as local test classes in the program.
|
||||
70
tasks_gen/eval/G0174/task.json
Normal file
70
tasks_gen/eval/G0174/task.json
Normal file
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"id": "G0174",
|
||||
"category": "H",
|
||||
"object_type": "PROG",
|
||||
"difficulty": 2,
|
||||
"release_target": "v816",
|
||||
"expected_outcome": "stop",
|
||||
"expected_gap": {
|
||||
"description": "The sort direction for TOTAL_REVENUE is missing.",
|
||||
"keywords": [
|
||||
[
|
||||
"sort",
|
||||
"order"
|
||||
],
|
||||
[
|
||||
"sort",
|
||||
"direction"
|
||||
],
|
||||
[
|
||||
"ascending",
|
||||
"descending"
|
||||
]
|
||||
]
|
||||
},
|
||||
"budget": {
|
||||
"max_tool_calls": 20,
|
||||
"max_activations": 5
|
||||
},
|
||||
"seed": [
|
||||
{
|
||||
"type": "TABL",
|
||||
"name": "{{P}}FLSALE",
|
||||
"file": "seed/flsale.tabl.asabap",
|
||||
"description": "Flower sales"
|
||||
},
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}T15_SEED",
|
||||
"file": "seed/t15_seed.clas.abap",
|
||||
"description": "T15 seed data",
|
||||
"run": true
|
||||
}
|
||||
],
|
||||
"contract": [
|
||||
{
|
||||
"type": "PROG",
|
||||
"name": "{{P}}FLOWER_SALES",
|
||||
"parameters": [
|
||||
"p_from",
|
||||
"s_flower"
|
||||
]
|
||||
}
|
||||
],
|
||||
"out_of_scope": [
|
||||
"{{P}}FLSALE"
|
||||
],
|
||||
"hidden_tests": [],
|
||||
"reference": [
|
||||
{
|
||||
"type": "PROG",
|
||||
"name": "{{P}}FLOWER_SALES",
|
||||
"file": "reference/flower_sales.prog.abap",
|
||||
"description": "Flower sales per type"
|
||||
}
|
||||
],
|
||||
"craft_checks": [
|
||||
"db_operation_in_loop",
|
||||
"method_length"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user