Object type mix: INTF, TABL, STRU, MSAG, exception tasks (harness G2, mutants, generator notes), balanced generator, kind-deficit job order, dashboard mix card
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
16
tasks_gen/train/G1901/faulty/m1_stock.tabl.asabap
Normal file
16
tasks_gen/train/G1901/faulty/m1_stock.tabl.asabap
Normal file
@@ -0,0 +1,16 @@
|
||||
@EndUserText.label : 'Bin stock'
|
||||
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
|
||||
@AbapCatalog.tableCategory : #TRANSPARENT
|
||||
@AbapCatalog.deliveryClass : #A
|
||||
@AbapCatalog.dataMaintenance : #RESTRICTED
|
||||
define table {{p}}stock {
|
||||
key client : abap.clnt not null;
|
||||
key bin_id : abap.numc(8) not null;
|
||||
key article_id : abap.char(12) not null;
|
||||
@Semantics.quantity.unitOfMeasure : '{{p}}stock.unit_of_measure'
|
||||
quantity : abap.dec(13,3);
|
||||
unit_of_measure : abap.unit(3);
|
||||
shelf_no : abap.numc(4);
|
||||
last_count_date : abap.dats;
|
||||
blocked : abap.char(1);
|
||||
}
|
||||
16
tasks_gen/train/G1901/faulty/m2_stock.tabl.asabap
Normal file
16
tasks_gen/train/G1901/faulty/m2_stock.tabl.asabap
Normal file
@@ -0,0 +1,16 @@
|
||||
@EndUserText.label : 'Bin stock'
|
||||
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
|
||||
@AbapCatalog.tableCategory : #TRANSPARENT
|
||||
@AbapCatalog.deliveryClass : #A
|
||||
@AbapCatalog.dataMaintenance : #RESTRICTED
|
||||
define table {{p}}stock {
|
||||
key client : abap.clnt not null;
|
||||
key bin_id : abap.char(8) not null;
|
||||
key article_id : abap.char(12) not null;
|
||||
@Semantics.quantity.unitOfMeasure : '{{p}}stock.unit_of_measure'
|
||||
quantity : abap.dec(13,4);
|
||||
unit_of_measure : abap.unit(3);
|
||||
shelf_no : abap.numc(4);
|
||||
last_count_date : abap.dats;
|
||||
blocked : abap.char(1);
|
||||
}
|
||||
16
tasks_gen/train/G1901/faulty/m3_stock.tabl.asabap
Normal file
16
tasks_gen/train/G1901/faulty/m3_stock.tabl.asabap
Normal file
@@ -0,0 +1,16 @@
|
||||
@EndUserText.label : 'Bin stock'
|
||||
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
|
||||
@AbapCatalog.tableCategory : #TRANSPARENT
|
||||
@AbapCatalog.deliveryClass : #A
|
||||
@AbapCatalog.dataMaintenance : #RESTRICTED
|
||||
define table {{p}}stock {
|
||||
key client : abap.clnt not null;
|
||||
key bin_id : abap.char(8) not null;
|
||||
key article_id : abap.char(12) not null;
|
||||
@Semantics.quantity.unitOfMeasure : '{{p}}stock.unit_of_measure'
|
||||
quantity : abap.dec(13,3);
|
||||
unit_of_measure : abap.unit(3);
|
||||
shelf_no : abap.numc(3);
|
||||
last_count_date : abap.dats;
|
||||
blocked : abap.char(1);
|
||||
}
|
||||
16
tasks_gen/train/G1901/faulty/m4_stock.tabl.asabap
Normal file
16
tasks_gen/train/G1901/faulty/m4_stock.tabl.asabap
Normal file
@@ -0,0 +1,16 @@
|
||||
@EndUserText.label : 'Bin stock'
|
||||
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
|
||||
@AbapCatalog.tableCategory : #TRANSPARENT
|
||||
@AbapCatalog.deliveryClass : #A
|
||||
@AbapCatalog.dataMaintenance : #RESTRICTED
|
||||
define table {{p}}stock {
|
||||
key client : abap.clnt not null;
|
||||
key bin_id : abap.char(8) not null;
|
||||
key article_id : abap.char(12) not null;
|
||||
@Semantics.quantity.unitOfMeasure : '{{p}}stock.unit_of_measure'
|
||||
quantity : abap.dec(13,3);
|
||||
unit_of_measure : abap.unit(3);
|
||||
shelf_no : abap.numc(4);
|
||||
last_count_date : abap.tims;
|
||||
blocked : abap.char(1);
|
||||
}
|
||||
19
tasks_gen/train/G1901/generation.json
Normal file
19
tasks_gen/train/G1901/generation.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"id": "G1901",
|
||||
"pool": "train",
|
||||
"object_type": "TABL",
|
||||
"category": "B",
|
||||
"attempts": [
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 100.0,
|
||||
"null": 0,
|
||||
"mutation": {
|
||||
"valid": 4,
|
||||
"killed": 4,
|
||||
"ok": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"accepted": true
|
||||
}
|
||||
182
tasks_gen/train/G1901/hidden/t20_hidden.clas.abap
Normal file
182
tasks_gen/train/G1901/hidden/t20_hidden.clas.abap
Normal file
@@ -0,0 +1,182 @@
|
||||
CLASS {{p}}t20_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
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 setup.
|
||||
METHODS fields_exist FOR TESTING.
|
||||
METHODS key_fields FOR TESTING.
|
||||
METHODS field_lengths FOR TESTING.
|
||||
METHODS field_types FOR TESTING.
|
||||
METHODS insert_and_read FOR TESTING.
|
||||
METHODS decimal_roundtrip FOR TESTING.
|
||||
METHODS duplicate_key FOR TESTING.
|
||||
METHODS other_key_allowed FOR TESTING.
|
||||
METHODS get_fields RETURNING VALUE(rt_fields) TYPE ddfields.
|
||||
METHODS field_of IMPORTING it_fields TYPE ddfields
|
||||
iv_name TYPE string
|
||||
RETURNING VALUE(rs_field) TYPE dfies.
|
||||
METHODS assert_has_field IMPORTING it_fields TYPE ddfields
|
||||
iv_name TYPE string.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t20_hidden IMPLEMENTATION.
|
||||
|
||||
METHOD class_setup.
|
||||
go_env = cl_osql_test_environment=>create( i_dependency_list = VALUE #( ( '{{P}}STOCK' ) ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD setup.
|
||||
go_env->clear_doubles( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD get_fields.
|
||||
DATA(lo_descr) = CAST cl_abap_structdescr( cl_abap_typedescr=>describe_by_name( '{{P}}STOCK' ) ).
|
||||
rt_fields = lo_descr->get_ddic_field_list( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD field_of.
|
||||
LOOP AT it_fields INTO DATA(ls_field).
|
||||
IF to_upper( ls_field-fieldname ) = to_upper( iv_name ).
|
||||
rs_field = ls_field.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
ENDLOOP.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD assert_has_field.
|
||||
cl_abap_unit_assert=>assert_true(
|
||||
act = boolc( field_of( it_fields = it_fields iv_name = iv_name )-fieldname IS NOT INITIAL )
|
||||
msg = |Field { iv_name } is missing| ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD fields_exist.
|
||||
DATA(lt_fields) = get_fields( ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 8 act = lines( lt_fields ) ).
|
||||
assert_has_field( it_fields = lt_fields iv_name = 'CLIENT' ).
|
||||
assert_has_field( it_fields = lt_fields iv_name = 'BIN_ID' ).
|
||||
assert_has_field( it_fields = lt_fields iv_name = 'ARTICLE_ID' ).
|
||||
assert_has_field( it_fields = lt_fields iv_name = 'QUANTITY' ).
|
||||
assert_has_field( it_fields = lt_fields iv_name = 'UNIT_OF_MEASURE' ).
|
||||
assert_has_field( it_fields = lt_fields iv_name = 'SHELF_NO' ).
|
||||
assert_has_field( it_fields = lt_fields iv_name = 'LAST_COUNT_DATE' ).
|
||||
assert_has_field( it_fields = lt_fields iv_name = 'BLOCKED' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD key_fields.
|
||||
DATA(lt_fields) = get_fields( ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'X' act = field_of( it_fields = lt_fields iv_name = 'CLIENT' )-keyflag ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'X' act = field_of( it_fields = lt_fields iv_name = 'BIN_ID' )-keyflag ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'X' act = field_of( it_fields = lt_fields iv_name = 'ARTICLE_ID' )-keyflag ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = ' ' act = field_of( it_fields = lt_fields iv_name = 'QUANTITY' )-keyflag ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = ' ' act = field_of( it_fields = lt_fields iv_name = 'UNIT_OF_MEASURE' )-keyflag ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = ' ' act = field_of( it_fields = lt_fields iv_name = 'SHELF_NO' )-keyflag ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = ' ' act = field_of( it_fields = lt_fields iv_name = 'LAST_COUNT_DATE' )-keyflag ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = ' ' act = field_of( it_fields = lt_fields iv_name = 'BLOCKED' )-keyflag ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD field_lengths.
|
||||
DATA(lt_fields) = get_fields( ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 3 act = field_of( it_fields = lt_fields iv_name = 'CLIENT' )-leng ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 8 act = field_of( it_fields = lt_fields iv_name = 'BIN_ID' )-leng ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 12 act = field_of( it_fields = lt_fields iv_name = 'ARTICLE_ID' )-leng ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 13 act = field_of( it_fields = lt_fields iv_name = 'QUANTITY' )-leng ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 3 act = field_of( it_fields = lt_fields iv_name = 'UNIT_OF_MEASURE' )-leng ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 4 act = field_of( it_fields = lt_fields iv_name = 'SHELF_NO' )-leng ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 8 act = field_of( it_fields = lt_fields iv_name = 'LAST_COUNT_DATE' )-leng ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = field_of( it_fields = lt_fields iv_name = 'BLOCKED' )-leng ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD field_types.
|
||||
DATA(lt_fields) = get_fields( ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'CLNT' act = field_of( it_fields = lt_fields iv_name = 'CLIENT' )-datatype ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'CHAR' act = field_of( it_fields = lt_fields iv_name = 'BIN_ID' )-datatype ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'CHAR' act = field_of( it_fields = lt_fields iv_name = 'ARTICLE_ID' )-datatype ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'P' act = field_of( it_fields = lt_fields iv_name = 'QUANTITY' )-inttype ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 3 act = field_of( it_fields = lt_fields iv_name = 'QUANTITY' )-decimals ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'UNIT' act = field_of( it_fields = lt_fields iv_name = 'UNIT_OF_MEASURE' )-datatype ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'NUMC' act = field_of( it_fields = lt_fields iv_name = 'SHELF_NO' )-datatype ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'DATS' act = field_of( it_fields = lt_fields iv_name = 'LAST_COUNT_DATE' )-datatype ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'CHAR' act = field_of( it_fields = lt_fields iv_name = 'BLOCKED' )-datatype ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD insert_and_read.
|
||||
DATA ls_row TYPE {{p}}stock.
|
||||
DATA ls_read TYPE {{p}}stock.
|
||||
DATA lv_subrc TYPE sy-subrc.
|
||||
ls_row-client = sy-mandt.
|
||||
ls_row-bin_id = 'BIN-0001'.
|
||||
ls_row-article_id = 'ART-000001'.
|
||||
ls_row-quantity = '12.500'.
|
||||
ls_row-unit_of_measure = 'ST'.
|
||||
ls_row-shelf_no = '0042'.
|
||||
ls_row-last_count_date = '20250115'.
|
||||
ls_row-blocked = 'X'.
|
||||
INSERT {{p}}stock FROM @ls_row.
|
||||
lv_subrc = sy-subrc.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_subrc ).
|
||||
SELECT SINGLE * FROM {{p}}stock
|
||||
WHERE bin_id = 'BIN-0001' AND article_id = 'ART-000001'
|
||||
INTO @ls_read.
|
||||
cl_abap_unit_assert=>assert_equals( exp = ls_row-quantity act = ls_read-quantity ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = ls_row-unit_of_measure act = ls_read-unit_of_measure ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = ls_row-shelf_no act = ls_read-shelf_no ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = ls_row-last_count_date act = ls_read-last_count_date ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = ls_row-blocked act = ls_read-blocked ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = ls_row-client act = ls_read-client ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD decimal_roundtrip.
|
||||
DATA ls_row TYPE {{p}}stock.
|
||||
DATA lv_quantity TYPE {{p}}stock-quantity.
|
||||
ls_row-client = sy-mandt.
|
||||
ls_row-bin_id = 'BIN-0002'.
|
||||
ls_row-article_id = 'ART-000002'.
|
||||
ls_row-quantity = '0.125'.
|
||||
ls_row-unit_of_measure = 'KG'.
|
||||
INSERT {{p}}stock FROM @ls_row.
|
||||
SELECT SINGLE quantity FROM {{p}}stock
|
||||
WHERE bin_id = 'BIN-0002' AND article_id = 'ART-000002'
|
||||
INTO @lv_quantity.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = CONV decfloat34( '0.125' )
|
||||
act = CONV decfloat34( lv_quantity ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD duplicate_key.
|
||||
DATA ls_row TYPE {{p}}stock.
|
||||
DATA lv_subrc TYPE sy-subrc.
|
||||
ls_row-client = sy-mandt.
|
||||
ls_row-bin_id = 'BIN-0003'.
|
||||
ls_row-article_id = 'ART-000003'.
|
||||
INSERT {{p}}stock FROM @ls_row.
|
||||
lv_subrc = sy-subrc.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_subrc ).
|
||||
INSERT {{p}}stock FROM @ls_row.
|
||||
lv_subrc = sy-subrc.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 4 act = lv_subrc ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD other_key_allowed.
|
||||
DATA ls_row TYPE {{p}}stock.
|
||||
DATA lv_subrc TYPE sy-subrc.
|
||||
DATA lv_count TYPE i.
|
||||
ls_row-client = sy-mandt.
|
||||
ls_row-bin_id = 'BIN-0004'.
|
||||
ls_row-article_id = 'ART-000004'.
|
||||
INSERT {{p}}stock FROM @ls_row.
|
||||
ls_row-article_id = 'ART-000005'.
|
||||
INSERT {{p}}stock FROM @ls_row.
|
||||
lv_subrc = sy-subrc.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_subrc ).
|
||||
SELECT COUNT(*) FROM {{p}}stock INTO @lv_count.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 2 act = lv_count ).
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
||||
55
tasks_gen/train/G1901/mutation.json
Normal file
55
tasks_gen/train/G1901/mutation.json
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"task": "G1901",
|
||||
"mutants": [
|
||||
{
|
||||
"object": "{{P}}STOCK",
|
||||
"mutant": "line 8: key bin_id : -> bin_id : (key)",
|
||||
"status": "invalid",
|
||||
"hidden": "0/0",
|
||||
"failed_tests": []
|
||||
},
|
||||
{
|
||||
"object": "{{P}}STOCK",
|
||||
"mutant": "line 8: abap.char(8) -> abap.numc(8) (type)",
|
||||
"status": "killed",
|
||||
"hidden": "5/8",
|
||||
"failed_tests": [
|
||||
"DECIMAL_ROUNDTRIP",
|
||||
"FIELD_TYPES",
|
||||
"INSERT_AND_READ"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}STOCK",
|
||||
"mutant": "line 11: abap.dec(13,3) -> abap.dec(13,4) (decimals)",
|
||||
"status": "killed",
|
||||
"hidden": "7/8",
|
||||
"failed_tests": [
|
||||
"FIELD_TYPES"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}STOCK",
|
||||
"mutant": "line 13: abap.numc(4) -> abap.numc(3) (length)",
|
||||
"status": "killed",
|
||||
"hidden": "7/8",
|
||||
"failed_tests": [
|
||||
"FIELD_LENGTHS"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}STOCK",
|
||||
"mutant": "line 14: abap.dats -> abap.tims (type)",
|
||||
"status": "killed",
|
||||
"hidden": "6/8",
|
||||
"failed_tests": [
|
||||
"FIELD_LENGTHS",
|
||||
"FIELD_TYPES"
|
||||
]
|
||||
}
|
||||
],
|
||||
"valid": 4,
|
||||
"killed": 4,
|
||||
"kill_rate": 1.0,
|
||||
"ok": true
|
||||
}
|
||||
16
tasks_gen/train/G1901/reference/stock.tabl.asabap
Normal file
16
tasks_gen/train/G1901/reference/stock.tabl.asabap
Normal file
@@ -0,0 +1,16 @@
|
||||
@EndUserText.label : 'Bin stock'
|
||||
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
|
||||
@AbapCatalog.tableCategory : #TRANSPARENT
|
||||
@AbapCatalog.deliveryClass : #A
|
||||
@AbapCatalog.dataMaintenance : #RESTRICTED
|
||||
define table {{p}}stock {
|
||||
key client : abap.clnt not null;
|
||||
key bin_id : abap.char(8) not null;
|
||||
key article_id : abap.char(12) not null;
|
||||
@Semantics.quantity.unitOfMeasure : '{{p}}stock.unit_of_measure'
|
||||
quantity : abap.dec(13,3);
|
||||
unit_of_measure : abap.unit(3);
|
||||
shelf_no : abap.numc(4);
|
||||
last_count_date : abap.dats;
|
||||
blocked : abap.char(1);
|
||||
}
|
||||
80
tasks_gen/train/G1901/reference/t20_test.clas.abap
Normal file
80
tasks_gen/train/G1901/reference/t20_test.clas.abap
Normal file
@@ -0,0 +1,80 @@
|
||||
CLASS {{p}}t20_test DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
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 setup.
|
||||
METHODS stores_row FOR TESTING.
|
||||
METHODS rejects_duplicate FOR TESTING.
|
||||
METHODS keeps_three_decimals FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t20_test IMPLEMENTATION.
|
||||
|
||||
METHOD class_setup.
|
||||
go_env = cl_osql_test_environment=>create( i_dependency_list = VALUE #( ( '{{P}}STOCK' ) ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD setup.
|
||||
go_env->clear_doubles( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD stores_row.
|
||||
DATA ls_row TYPE {{p}}stock.
|
||||
DATA ls_read TYPE {{p}}stock.
|
||||
DATA lv_subrc TYPE sy-subrc.
|
||||
ls_row-client = sy-mandt.
|
||||
ls_row-bin_id = 'BIN-0001'.
|
||||
ls_row-article_id = 'ART-000001'.
|
||||
ls_row-quantity = '12.500'.
|
||||
ls_row-unit_of_measure = 'ST'.
|
||||
ls_row-shelf_no = '0042'.
|
||||
ls_row-last_count_date = '20250115'.
|
||||
ls_row-blocked = 'X'.
|
||||
INSERT {{p}}stock FROM @ls_row.
|
||||
lv_subrc = sy-subrc.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_subrc ).
|
||||
SELECT SINGLE * FROM {{p}}stock
|
||||
WHERE bin_id = 'BIN-0001' AND article_id = 'ART-000001'
|
||||
INTO @ls_read.
|
||||
cl_abap_unit_assert=>assert_equals( exp = ls_row-quantity act = ls_read-quantity ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = ls_row-unit_of_measure act = ls_read-unit_of_measure ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = ls_row-blocked act = ls_read-blocked ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD rejects_duplicate.
|
||||
DATA ls_row TYPE {{p}}stock.
|
||||
DATA lv_subrc TYPE sy-subrc.
|
||||
ls_row-client = sy-mandt.
|
||||
ls_row-bin_id = 'BIN-0002'.
|
||||
ls_row-article_id = 'ART-000002'.
|
||||
INSERT {{p}}stock FROM @ls_row.
|
||||
INSERT {{p}}stock FROM @ls_row.
|
||||
lv_subrc = sy-subrc.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 4 act = lv_subrc ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD keeps_three_decimals.
|
||||
DATA ls_row TYPE {{p}}stock.
|
||||
DATA lv_quantity TYPE {{p}}stock-quantity.
|
||||
ls_row-client = sy-mandt.
|
||||
ls_row-bin_id = 'BIN-0003'.
|
||||
ls_row-article_id = 'ART-000003'.
|
||||
ls_row-quantity = '0.125'.
|
||||
ls_row-unit_of_measure = 'KG'.
|
||||
INSERT {{p}}stock FROM @ls_row.
|
||||
SELECT SINGLE quantity FROM {{p}}stock
|
||||
WHERE bin_id = 'BIN-0003' AND article_id = 'ART-000003'
|
||||
INTO @lv_quantity.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = CONV decfloat34( '0.125' )
|
||||
act = CONV decfloat34( lv_quantity ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
||||
36
tasks_gen/train/G1901/spec.md
Normal file
36
tasks_gen/train/G1901/spec.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# 1. Goal
|
||||
The warehouse team counts the stock of each article in each storage bin. The team needs one table that stores the result of these counts. Other programs read the table, so the structure of the table is fixed.
|
||||
|
||||
# 2. Open questions
|
||||
None.
|
||||
|
||||
# 3. Context
|
||||
- System: SAP ABAP Platform 2025 (SAP_BASIS 816), client 001.
|
||||
- Package: $TMP.
|
||||
- No table for this data exists. Do not use tables of SAP application components.
|
||||
|
||||
# 4. Contract
|
||||
- Create the transparent database table {{P}}STOCK in package $TMP.
|
||||
- The table contains these fields: CLIENT, BIN_ID, ARTICLE_ID, QUANTITY, UNIT_OF_MEASURE, SHELF_NO, LAST_COUNT_DATE, BLOCKED.
|
||||
- Key fields: CLIENT, BIN_ID, ARTICLE_ID.
|
||||
|
||||
# 5. Business rules
|
||||
1. One row of the table is the stock of one article in one storage bin of one client. The key fields CLIENT, BIN_ID and ARTICLE_ID identify the row. A second row with the same key values is not allowed.
|
||||
2. CLIENT: data type CLNT, length 3. Key field. Not null.
|
||||
3. BIN_ID: data type CHAR, length 8. Key field. Not null. The number of the storage bin.
|
||||
4. ARTICLE_ID: data type CHAR, length 12. Key field. Not null. The number of the article.
|
||||
5. QUANTITY: data type DEC, length 13, 3 decimals. The stock quantity. It is a quantity in the unit of measure that UNIT_OF_MEASURE contains.
|
||||
6. UNIT_OF_MEASURE: data type UNIT, length 3. The unit of measure of QUANTITY.
|
||||
7. SHELF_NO: data type NUMC, length 4. The shelf number in the storage bin.
|
||||
8. LAST_COUNT_DATE: data type DATS. The date of the last count.
|
||||
9. BLOCKED: data type CHAR, length 1. The value 'X' means that the storage bin is blocked for withdrawals. The value is initial if the storage bin is not blocked.
|
||||
|
||||
# 6. Constraints
|
||||
- Release target: SAP_BASIS 816 (ABAP Platform 2025).
|
||||
- Coding standards: Clean ABAP. Use ABAP SQL and ABAP Unit.
|
||||
- Out of scope: do not create a CDS view, a report or a function module. Do not change other objects.
|
||||
|
||||
# 7. Acceptance
|
||||
- The table {{P}}STOCK is active and has no syntax error.
|
||||
- The hidden tests pass.
|
||||
- Write ABAP Unit tests with CL_OSQL_TEST_ENVIRONMENT in a global test class.
|
||||
53
tasks_gen/train/G1901/task.json
Normal file
53
tasks_gen/train/G1901/task.json
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"id": "G1901",
|
||||
"category": "B",
|
||||
"object_type": "TABL",
|
||||
"difficulty": 2,
|
||||
"release_target": "v816",
|
||||
"expected_outcome": "implement",
|
||||
"budget": {
|
||||
"max_tool_calls": 60,
|
||||
"max_activations": 15
|
||||
},
|
||||
"seed": [],
|
||||
"contract": [
|
||||
{
|
||||
"type": "TABL",
|
||||
"name": "{{P}}STOCK",
|
||||
"fields": [
|
||||
"client",
|
||||
"bin_id",
|
||||
"article_id",
|
||||
"quantity",
|
||||
"unit_of_measure",
|
||||
"shelf_no",
|
||||
"last_count_date",
|
||||
"blocked"
|
||||
]
|
||||
}
|
||||
],
|
||||
"out_of_scope": [],
|
||||
"hidden_tests": [
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}T20_HIDDEN",
|
||||
"file": "hidden/t20_hidden.clas.abap",
|
||||
"description": "T20 hidden tests"
|
||||
}
|
||||
],
|
||||
"reference": [
|
||||
{
|
||||
"type": "TABL",
|
||||
"name": "{{P}}STOCK",
|
||||
"file": "reference/stock.tabl.asabap",
|
||||
"description": "Bin stock table"
|
||||
},
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}T20_TEST",
|
||||
"file": "reference/t20_test.clas.abap",
|
||||
"description": "T20 own tests"
|
||||
}
|
||||
],
|
||||
"craft_checks": []
|
||||
}
|
||||
Reference in New Issue
Block a user