Generator: pilot analysis and fixes; G0002-G0021 tasks; handover notes merged

- Static bundle checks (name length, seed type, reserved words, contract test classes,
  testclasses_file), local abaplint parser check before SAP, max_tokens, robust JSON parse
- Runner: G2 for CDS views with parameters, contract_check detail in report
- G0020 and G0013 fixed by review and revalidated (oracle 100, null 0)
- Pilot results in docs/faz1-tasarim.md 11e; handover notes merged into CLAUDE.md and docs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kral
2026-10-03 05:04:23 +02:00
parent 15eb9f1bb2
commit 5de5e2851c
162 changed files with 9943 additions and 23 deletions

View File

@@ -0,0 +1,29 @@
{
"id": "G0011",
"pool": "eval",
"object_type": "FUNC",
"category": "A",
"attempts": [
{
"stage": "validate",
"oracle": 0,
"null": 0
},
{
"stage": "validate",
"oracle": 92.5,
"null": 0
},
{
"stage": "validate",
"oracle": 0,
"null": 0
},
{
"stage": "validate",
"oracle": 92.5,
"null": 0
}
],
"accepted": false
}

View File

@@ -0,0 +1,117 @@
CLASS {{p}}t14_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
METHODS call
IMPORTING
iv_stock TYPE decfloat34
iv_reorder_point TYPE decfloat34
iv_target_stock TYPE decfloat34
iv_pack_size TYPE decfloat34
iv_min_qty TYPE decfloat34 DEFAULT 0
EXPORTING
ev_qty TYPE decfloat34
ev_subrc TYPE sysubrc.
METHODS no_replenishment_when_stock_ok FOR TESTING.
METHODS replenish_to_target FOR TESTING.
METHODS pack_rounding_up FOR TESTING.
METHODS exact_multiple_not_rounded FOR TESTING.
METHODS minimum_quantity_applied FOR TESTING.
METHODS minimum_quantity_rounded_up FOR TESTING.
METHODS negative_minimum_is_zero FOR TESTING.
METHODS target_below_stock_is_zero FOR TESTING.
METHODS invalid_pack_size FOR TESTING.
METHODS class_calculates_directly FOR TESTING.
ENDCLASS.
CLASS {{p}}t14_hidden IMPLEMENTATION.
METHOD call.
ev_qty = 0.
CALL FUNCTION '{{P}}REPL_CALC'
EXPORTING
iv_stock = iv_stock
iv_reorder_point = iv_reorder_point
iv_target_stock = iv_target_stock
iv_pack_size = iv_pack_size
iv_min_qty = iv_min_qty
IMPORTING
ev_qty = ev_qty
EXCEPTIONS
invalid_pack_size = 1
OTHERS = 2.
ev_subrc = sy-subrc.
ENDMETHOD.
METHOD no_replenishment_when_stock_ok.
DATA lv_qty TYPE decfloat34.
call( EXPORTING iv_stock = 50 iv_reorder_point = 20 iv_target_stock = 100 iv_pack_size = 10
IMPORTING ev_qty = lv_qty ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 0 ) act = lv_qty ).
ENDMETHOD.
METHOD replenish_to_target.
DATA lv_qty TYPE decfloat34.
call( EXPORTING iv_stock = 10 iv_reorder_point = 20 iv_target_stock = 50 iv_pack_size = 12
IMPORTING ev_qty = lv_qty ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 48 ) act = lv_qty ).
ENDMETHOD.
METHOD pack_rounding_up.
DATA lv_qty TYPE decfloat34.
call( EXPORTING iv_stock = 0 iv_reorder_point = 10 iv_target_stock = 25 iv_pack_size = 6
IMPORTING ev_qty = lv_qty ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 30 ) act = lv_qty ).
ENDMETHOD.
METHOD exact_multiple_not_rounded.
DATA lv_qty TYPE decfloat34.
call( EXPORTING iv_stock = 0 iv_reorder_point = 10 iv_target_stock = 24 iv_pack_size = 12
IMPORTING ev_qty = lv_qty ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 24 ) act = lv_qty ).
ENDMETHOD.
METHOD minimum_quantity_applied.
DATA lv_qty TYPE decfloat34.
call( EXPORTING iv_stock = 10 iv_reorder_point = 20 iv_target_stock = 12 iv_pack_size = 1 iv_min_qty = 7
IMPORTING ev_qty = lv_qty ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 7 ) act = lv_qty ).
ENDMETHOD.
METHOD minimum_quantity_rounded_up.
DATA lv_qty TYPE decfloat34.
call( EXPORTING iv_stock = 10 iv_reorder_point = 20 iv_target_stock = 12 iv_pack_size = 5 iv_min_qty = 7
IMPORTING ev_qty = lv_qty ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 10 ) act = lv_qty ).
ENDMETHOD.
METHOD negative_minimum_is_zero.
DATA lv_qty TYPE decfloat34.
call( EXPORTING iv_stock = 0 iv_reorder_point = 10 iv_target_stock = 10 iv_pack_size = 4 iv_min_qty = -5
IMPORTING ev_qty = lv_qty ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 12 ) act = lv_qty ).
ENDMETHOD.
METHOD target_below_stock_is_zero.
DATA lv_qty TYPE decfloat34.
call( EXPORTING iv_stock = 10 iv_reorder_point = 20 iv_target_stock = 5 iv_pack_size = 4
IMPORTING ev_qty = lv_qty ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 0 ) act = lv_qty ).
ENDMETHOD.
METHOD invalid_pack_size.
DATA lv_rc TYPE sysubrc.
call( EXPORTING iv_stock = 0 iv_reorder_point = 10 iv_target_stock = 20 iv_pack_size = 0
IMPORTING ev_subrc = lv_rc ).
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_rc ).
ENDMETHOD.
METHOD class_calculates_directly.
DATA(lv_qty) = NEW {{p}}cl_repl( )->calculate(
iv_stock = 10
iv_reorder_point = 20
iv_target_stock = 50
iv_pack_size = 12
iv_min_qty = 0 ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 48 ) act = lv_qty ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,38 @@
CLASS {{p}}cl_repl DEFINITION PUBLIC FINAL CREATE PUBLIC.
PUBLIC SECTION.
METHODS calculate
IMPORTING
iv_stock TYPE decfloat34
iv_reorder_point TYPE decfloat34
iv_target_stock TYPE decfloat34
iv_pack_size TYPE decfloat34
iv_min_qty TYPE decfloat34
RETURNING
VALUE(rv_qty) TYPE decfloat34.
ENDCLASS.
CLASS {{p}}cl_repl IMPLEMENTATION.
METHOD calculate.
IF iv_stock >= iv_reorder_point.
rv_qty = 0.
RETURN.
ENDIF.
DATA(lv_need) = iv_target_stock - iv_stock.
DATA(lv_min_qty) = iv_min_qty.
IF lv_min_qty < 0.
lv_min_qty = 0.
ENDIF.
IF lv_need < lv_min_qty.
lv_need = lv_min_qty.
ENDIF.
IF lv_need <= 0.
rv_qty = 0.
RETURN.
ENDIF.
rv_qty = ceil( lv_need / iv_pack_size ) * iv_pack_size.
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,24 @@
FUNCTION {{p}}repl_calc
IMPORTING
iv_stock TYPE decfloat34
iv_reorder_point TYPE decfloat34
iv_target_stock TYPE decfloat34
iv_pack_size TYPE decfloat34
iv_min_qty TYPE decfloat34
EXPORTING
ev_qty TYPE decfloat34
EXCEPTIONS
invalid_pack_size.
IF iv_pack_size <= 0.
RAISE invalid_pack_size.
ENDIF.
ev_qty = NEW {{p}}cl_repl( )->calculate(
iv_stock = iv_stock
iv_reorder_point = iv_reorder_point
iv_target_stock = iv_target_stock
iv_pack_size = iv_pack_size
iv_min_qty = iv_min_qty ).
ENDFUNCTION.

View File

@@ -0,0 +1,100 @@
CLASS {{p}}t14_test DEFINITION PUBLIC FINAL CREATE PUBLIC
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
METHODS qty_for
IMPORTING
iv_stock TYPE decfloat34
iv_reorder_point TYPE decfloat34
iv_target_stock TYPE decfloat34
iv_pack_size TYPE decfloat34
iv_min_qty TYPE decfloat34 DEFAULT 0
RETURNING
VALUE(rv_qty) TYPE decfloat34.
METHODS replenish_to_target FOR TESTING.
METHODS no_replenishment FOR TESTING.
METHODS minimum_quantity FOR TESTING.
METHODS pack_rounding FOR TESTING.
METHODS invalid_pack_size FOR TESTING.
METHODS class_direct_call FOR TESTING.
METHODS class_no_replenishment FOR TESTING.
ENDCLASS.
CLASS {{p}}t14_test IMPLEMENTATION.
METHOD qty_for.
CALL FUNCTION '{{P}}REPL_CALC'
EXPORTING
iv_stock = iv_stock
iv_reorder_point = iv_reorder_point
iv_target_stock = iv_target_stock
iv_pack_size = iv_pack_size
iv_min_qty = iv_min_qty
IMPORTING
ev_qty = rv_qty
EXCEPTIONS
invalid_pack_size = 1
OTHERS = 2.
cl_abap_unit_assert=>assert_subrc( exp = 0 ).
ENDMETHOD.
METHOD replenish_to_target.
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( 48 )
act = qty_for( iv_stock = 10 iv_reorder_point = 20 iv_target_stock = 50 iv_pack_size = 12 ) ).
ENDMETHOD.
METHOD no_replenishment.
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( 0 )
act = qty_for( iv_stock = 30 iv_reorder_point = 20 iv_target_stock = 50 iv_pack_size = 12 ) ).
ENDMETHOD.
METHOD minimum_quantity.
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( 10 )
act = qty_for( iv_stock = 10 iv_reorder_point = 20 iv_target_stock = 12 iv_pack_size = 5 iv_min_qty = 7 ) ).
ENDMETHOD.
METHOD pack_rounding.
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( 30 )
act = qty_for( iv_stock = 0 iv_reorder_point = 10 iv_target_stock = 25 iv_pack_size = 6 ) ).
ENDMETHOD.
METHOD invalid_pack_size.
DATA lv_qty TYPE decfloat34.
CALL FUNCTION '{{P}}REPL_CALC'
EXPORTING
iv_stock = 0
iv_reorder_point = 10
iv_target_stock = 20
iv_pack_size = 0
iv_min_qty = 0
IMPORTING
ev_qty = lv_qty
EXCEPTIONS
invalid_pack_size = 1
OTHERS = 2.
cl_abap_unit_assert=>assert_equals( exp = 1 act = sy-subrc ).
ENDMETHOD.
METHOD class_direct_call.
DATA(lv_qty) = NEW {{p}}cl_repl( )->calculate(
iv_stock = 0
iv_reorder_point = 10
iv_target_stock = 24
iv_pack_size = 12
iv_min_qty = 0 ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 24 ) act = lv_qty ).
ENDMETHOD.
METHOD class_no_replenishment.
DATA(lv_qty) = NEW {{p}}cl_repl( )->calculate(
iv_stock = 40
iv_reorder_point = 20
iv_target_stock = 100
iv_pack_size = 10
iv_min_qty = 0 ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 0 ) act = lv_qty ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,9 @@
FUNCTION {{p}}repl_sample
IMPORTING
iv_bin TYPE string
EXPORTING
ev_info TYPE string.
ev_info = |Storage bin { iv_bin }|.
ENDFUNCTION.

View File

@@ -0,0 +1,66 @@
# 1. Goal
A warehouse system needs the quantity for a replenishment order of a storage
bin. The calling program calls the function module {{P}}REPL_CALC. The
calculation logic must be in the class {{P}}CL_REPL, because other programs
also use this logic.
# 2. Open questions
None.
# 3. Context
- Function group {{P}}FG_REPL exists in package $TMP.
- Function module {{P}}REPL_SAMPLE exists in this function group. It shows bin
information. Do not change it.
- The class {{P}}CL_REPL does not exist. Create it first.
# 4. Contract
## 4.1 Class {{P}}CL_REPL
- Package: $TMP.
- The class is instantiable without parameters.
- Public instance method calculate:
- importing iv_stock, type decfloat34
- importing iv_reorder_point, type decfloat34
- importing iv_target_stock, type decfloat34
- importing iv_pack_size, type decfloat34
- importing iv_min_qty, type decfloat34
- returning rv_qty, type decfloat34
- The method has no exception. Call it only with a positive pack size.
## 4.2 Function module {{P}}REPL_CALC
- Function group: {{P}}FG_REPL.
- Importing parameters:
- iv_stock, type decfloat34
- iv_reorder_point, type decfloat34
- iv_target_stock, type decfloat34
- iv_pack_size, type decfloat34
- iv_min_qty, type decfloat34
- Exporting parameters:
- ev_qty, type decfloat34
- Exceptions: invalid_pack_size.
- The function module {{P}}REPL_CALC must call the method calculate of the class
{{P}}CL_REPL. Create and activate the class before you activate the function
module.
# 5. Business rules
1. If the pack size is not positive, the function module raises the exception
INVALID_PACK_SIZE. The class method is not called in this case.
2. If the stock is greater than or equal to the reorder point, the
replenishment quantity is 0.
3. Otherwise, the requirement is the target stock minus the stock.
4. If the requirement is less than the minimum quantity, the requirement is the
minimum quantity. A minimum quantity below 0 counts as 0.
5. If the requirement is not positive, the replenishment quantity is 0.
6. Otherwise, round the requirement up to the next full multiple of the pack
size. The replenishment quantity is this multiple multiplied by the pack
size.
# 6. Constraints
- Release target: 7.58.
- Use Clean ABAP. Keep each method below 40 statements.
- Out of scope: do not change {{P}}REPL_SAMPLE. Do not create database tables.
# 7. Acceptance
- The function module and the class are active and have no syntax error.
- The hidden tests pass.
- Write ABAP Unit tests for the function module in a global test class.

View File

@@ -0,0 +1,99 @@
{
"id": "G0011",
"category": "A",
"object_type": "FUNC",
"difficulty": 2,
"release_target": "v758",
"expected_outcome": "implement",
"budget": {
"max_tool_calls": 40,
"max_activations": 10
},
"seed": [
{
"type": "FUGR",
"name": "{{P}}FG_REPL",
"description": "Replenishment function group"
},
{
"type": "FUNC",
"name": "{{P}}REPL_SAMPLE",
"functionGroup": "{{P}}FG_REPL",
"file": "seed/repl_sample.func.abap",
"description": "Sample bin information module"
}
],
"contract": [
{
"type": "CLAS",
"name": "{{P}}CL_REPL"
},
{
"type": "FUNC",
"name": "{{P}}REPL_CALC",
"functionGroup": "{{P}}FG_REPL",
"params": [
{
"name": "iv_stock",
"type": "decfloat34"
},
{
"name": "iv_reorder_point",
"type": "decfloat34"
},
{
"name": "iv_target_stock",
"type": "decfloat34"
},
{
"name": "iv_pack_size",
"type": "decfloat34"
},
{
"name": "iv_min_qty",
"type": "decfloat34"
},
{
"name": "ev_qty",
"type": "decfloat34"
}
]
}
],
"out_of_scope": [
"{{P}}REPL_SAMPLE"
],
"hidden_tests": [
{
"type": "CLAS",
"name": "{{P}}T14_HIDDEN",
"file": "hidden/t14_hidden.clas.abap",
"description": "T14 hidden tests"
}
],
"reference": [
{
"type": "CLAS",
"name": "{{P}}CL_REPL",
"file": "reference/cl_repl.clas.abap",
"description": "Replenishment quantity calculator"
},
{
"type": "FUNC",
"name": "{{P}}REPL_CALC",
"functionGroup": "{{P}}FG_REPL",
"file": "reference/repl_calc.func.abap",
"description": "Replenishment function module"
},
{
"type": "CLAS",
"name": "{{P}}T14_TEST",
"file": "reference/t14_test.clas.abap",
"description": "T14 own tests"
}
],
"craft_checks": [
"method_length",
"clean_abap"
]
}