Stage 2 summary at 50 accepted trajectories

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Kral
2026-10-05 18:02:52 +02:00
parent 332fb4601d
commit 5bcd1bf9cd
1230 changed files with 77563 additions and 33 deletions

View File

@@ -0,0 +1,50 @@
{
"id": "G1108",
"pool": "train",
"object_type": "DDLS",
"category": "B",
"attempts": [
{
"stage": "bundle",
"errors": [
"reference/t31_test.clas.abap line 37: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"SELECT\"",
"hidden/t31_hidden.clas.abap line 57: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"SELECT\"",
"hidden/t31_hidden.clas.abap line 63: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"SELECT\"",
"hidden/t31_hidden.clas.abap line 88: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"SELECT\""
],
"by_check": {
"abaplint": 4
}
},
{
"stage": "bundle",
"errors": [
"reference/t31_test.clas.abap line 37: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"SELECT\"",
"hidden/t31_hidden.clas.abap line 83: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"SELECT\"",
"hidden/t31_hidden.clas.abap line 89: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"SELECT\"",
"hidden/t31_hidden.clas.abap line 95: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"SELECT\""
],
"by_check": {
"abaplint": 4
}
},
{
"stage": "bundle",
"errors": [
"reference/t31_test.clas.abap line 37: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"SELECT\"",
"hidden/t31_hidden.clas.abap line 83: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"SELECT\"",
"hidden/t31_hidden.clas.abap line 91: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"SELECT\"",
"hidden/t31_hidden.clas.abap line 99: syntax error for release v758 (abaplint): Statement does not exist in the configured ABAP version(or a parser error), \"SELECT\""
],
"by_check": {
"abaplint": 4
}
},
{
"stage": "validate",
"oracle": 0,
"null": 0
}
],
"accepted": false
}

View File

@@ -0,0 +1,109 @@
CLASS {{p}}t31_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
CLASS-DATA go_env TYPE REF TO if_cds_test_environment.
CLASS-METHODS class_setup.
CLASS-METHODS class_teardown.
METHODS setup.
METHODS rows_only_long FOR TESTING.
METHODS short_lesson_hidden FOR TESTING.
METHODS instr_id_shown FOR TESTING.
METHODS date_shown FOR TESTING.
METHODS duration_shown FOR TESTING.
METHODS fee_shown FOR TESTING.
METHODS instructor_name FOR TESTING.
METHODS instructor_city FOR TESTING.
METHODS no_instructor_shown FOR TESTING.
METHODS no_instructor_empty FOR TESTING.
ENDCLASS.
CLASS {{p}}t31_hidden IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_LESSON_INSTR' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_instr TYPE STANDARD TABLE OF {{p}}instr WITH EMPTY KEY.
DATA lt_lesson TYPE STANDARD TABLE OF {{p}}lesson WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_instr = VALUE #( ( instr_id = 'I1' full_name = 'ANNA' city = 'BERLIN' )
( instr_id = 'I2' full_name = 'BEN' city = 'HAMBURG' ) ).
lt_lesson = VALUE #( ( lesson_id = 'L1' instr_id = 'I1' lesson_date = '20240110'
duration = 45 fee = '50.00' )
( lesson_id = 'L2' instr_id = 'I1' lesson_date = '20240111'
duration = 90 fee = '95.00' )
( lesson_id = 'L3' instr_id = 'I2' lesson_date = '20240112'
duration = 30 fee = '35.00' )
( lesson_id = 'L4' instr_id = 'I9' lesson_date = '20240113'
duration = 60 fee = '70.00' ) ).
go_env->insert_test_data( lt_instr ).
go_env->insert_test_data( lt_lesson ).
ENDMETHOD.
METHOD rows_only_long.
SELECT COUNT(*) FROM {{p}}i_lesson_instr INTO @DATA(lv_count).
cl_abap_unit_assert=>assert_equals( exp = 3 act = lv_count ).
ENDMETHOD.
METHOD short_lesson_hidden.
SELECT SINGLE lesson_id FROM {{p}}i_lesson_instr
WHERE lesson_id = 'L3' INTO @DATA(lv_lesson_id).
cl_abap_unit_assert=>assert_initial( act = lv_lesson_id ).
ENDMETHOD.
METHOD instr_id_shown.
SELECT SINGLE instr_id FROM {{p}}i_lesson_instr
WHERE lesson_id = 'L1' INTO @DATA(lv_instr_id).
cl_abap_unit_assert=>assert_equals( exp = 'I1' act = lv_instr_id ).
ENDMETHOD.
METHOD date_shown.
SELECT SINGLE lesson_date FROM {{p}}i_lesson_instr
WHERE lesson_id = 'L1' INTO @DATA(lv_date).
cl_abap_unit_assert=>assert_equals( exp = CONV dats( '20240110' ) act = lv_date ).
ENDMETHOD.
METHOD duration_shown.
SELECT SINGLE duration FROM {{p}}i_lesson_instr
WHERE lesson_id = 'L2' INTO @DATA(lv_duration).
cl_abap_unit_assert=>assert_equals( exp = 90 act = lv_duration ).
ENDMETHOD.
METHOD fee_shown.
SELECT SINGLE fee FROM {{p}}i_lesson_instr
WHERE lesson_id = 'L2' INTO @DATA(lv_fee).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '95.00' )
act = CONV decfloat34( lv_fee ) ).
ENDMETHOD.
METHOD instructor_name.
SELECT SINGLE instructor_name FROM {{p}}i_lesson_instr
WHERE lesson_id = 'L1' INTO @DATA(lv_name).
cl_abap_unit_assert=>assert_equals( exp = 'ANNA' act = lv_name ).
ENDMETHOD.
METHOD instructor_city.
SELECT SINGLE instructor_city FROM {{p}}i_lesson_instr
WHERE lesson_id = 'L2' INTO @DATA(lv_city).
cl_abap_unit_assert=>assert_equals( exp = 'BERLIN' act = lv_city ).
ENDMETHOD.
METHOD no_instructor_shown.
SELECT SINGLE lesson_id FROM {{p}}i_lesson_instr
WHERE lesson_id = 'L4' INTO @DATA(lv_lesson_id).
cl_abap_unit_assert=>assert_equals( exp = 'L4' act = lv_lesson_id ).
ENDMETHOD.
METHOD no_instructor_empty.
SELECT SINGLE instructor_name FROM {{p}}i_lesson_instr
WHERE lesson_id = 'L4' INTO @DATA(lv_name).
cl_abap_unit_assert=>assert_initial( act = lv_name ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,17 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Lessons with instructor'
define view entity {{P}}I_LESSON_INSTR
as select from {{p}}lesson as lesson
association [1..1] to {{p}}instr as _instructor
on lesson.instr_id = _instructor.instr_id
{
key lesson.lesson_id as lesson_id,
lesson.instr_id as instr_id,
lesson.lesson_date as lesson_date,
lesson.duration as duration,
lesson.fee as fee,
_instructor.full_name as instructor_name,
_instructor.city as instructor_city,
_instructor
}
where lesson.duration >= 45

View File

@@ -0,0 +1,55 @@
CLASS {{p}}t31_test DEFINITION PUBLIC FINAL CREATE PUBLIC
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
CLASS-DATA go_env TYPE REF TO if_cds_test_environment.
CLASS-METHODS class_setup.
CLASS-METHODS class_teardown.
METHODS setup.
METHODS lesson_with_instructor FOR TESTING.
METHODS lesson_without_instructor FOR TESTING.
ENDCLASS.
CLASS {{p}}t31_test IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_LESSON_INSTR' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_instr TYPE STANDARD TABLE OF {{p}}instr WITH EMPTY KEY.
DATA lt_lesson TYPE STANDARD TABLE OF {{p}}lesson WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_instr = VALUE #( ( instr_id = 'A' full_name = 'CARA' city = 'KOELN' ) ).
lt_lesson = VALUE #( ( lesson_id = 'X1' instr_id = 'A' lesson_date = '20240201'
duration = 45 fee = '40.00' )
( lesson_id = 'X2' instr_id = 'A' lesson_date = '20240202'
duration = 20 fee = '20.00' )
( lesson_id = 'X3' instr_id = 'Z' lesson_date = '20240203'
duration = 60 fee = '30.00' ) ).
go_env->insert_test_data( lt_instr ).
go_env->insert_test_data( lt_lesson ).
ENDMETHOD.
METHOD lesson_with_instructor.
SELECT SINGLE lesson_id, instructor_name, instructor_city
FROM {{p}}i_lesson_instr
WHERE lesson_id = 'X1' INTO @DATA(ls_result).
cl_abap_unit_assert=>assert_equals( exp = 'X1' act = ls_result-lesson_id ).
cl_abap_unit_assert=>assert_equals( exp = 'CARA' act = ls_result-instructor_name ).
cl_abap_unit_assert=>assert_equals( exp = 'KOELN' act = ls_result-instructor_city ).
ENDMETHOD.
METHOD lesson_without_instructor.
SELECT SINGLE lesson_id, instructor_name
FROM {{p}}i_lesson_instr
WHERE lesson_id = 'X3' INTO @DATA(ls_result).
cl_abap_unit_assert=>assert_equals( exp = 'X3' act = ls_result-lesson_id ).
cl_abap_unit_assert=>assert_initial( act = ls_result-instructor_name ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,11 @@
@EndUserText.label : 'Instructor'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}instr {
key client : abap.clnt not null;
key instr_id : abap.char(10) not null;
full_name : abap.char(30);
city : abap.char(20);
}

View File

@@ -0,0 +1,13 @@
@EndUserText.label : 'Lesson'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}lesson {
key client : abap.clnt not null;
key lesson_id : abap.char(10) not null;
instr_id : abap.char(10);
lesson_date : abap.dats;
duration : abap.int4;
fee : abap.dec(15,2);
}

View File

@@ -0,0 +1,43 @@
# 1. Goal
A driving school shows its lessons together with the instructor of each lesson.
A report and an OData service read the data. The data must be prepared in the
database, in a CDS view. The view exposes the instructor data of a lesson
through an association.
# 2. Open questions
None.
# 3. Context
- Table {{P}}INSTR (instructor), package $TMP. Key: INSTR_ID (CHAR 10).
Fields: FULL_NAME (CHAR 30), CITY (CHAR 20).
- Table {{P}}LESSON (lesson), package $TMP. Key: LESSON_ID (CHAR 10).
Fields: INSTR_ID (CHAR 10), LESSON_DATE (DATS), DURATION (INT4, in minutes),
FEE (DEC 15,2).
# 4. Contract
- Create the CDS view entity {{P}}I_LESSON_INSTR in package $TMP.
- Elements, with these names: LESSON_ID (key), INSTR_ID, LESSON_DATE, DURATION,
FEE, INSTRUCTOR_NAME, INSTRUCTOR_CITY, and the association _INSTRUCTOR.
- The association _INSTRUCTOR points to the table {{P}}INSTR. Its ON condition
compares the INSTR_ID of the lesson with the INSTR_ID of the instructor.
- No authorization check (#NOT_REQUIRED).
# 5. Business rules
1. The view shows one row for each lesson that lasts at least 45 minutes. Do not
show a lesson that is shorter than 45 minutes.
2. LESSON_ID, INSTR_ID, LESSON_DATE, DURATION and FEE are the values of the
lesson.
3. INSTRUCTOR_NAME is the FULL_NAME of the instructor whose INSTR_ID is the
INSTR_ID of the lesson. INSTRUCTOR_CITY is the CITY of that instructor.
4. A lesson whose instructor does not exist is still shown. INSTRUCTOR_NAME and
INSTRUCTOR_CITY of that lesson are empty.
# 6. Constraints
- Release target: 8.16.
- Coding standards: Clean ABAP.
- Out of scope: do not change {{P}}INSTR and {{P}}LESSON.
# 7. Acceptance
- The view is active and has no syntax error.
- The hidden tests pass.
- Write ABAP Unit tests with CL_CDS_TEST_ENVIRONMENT in a global test class.

View File

@@ -0,0 +1,69 @@
{
"id": "G1108",
"category": "B",
"object_type": "DDLS",
"difficulty": 2,
"release_target": "v816",
"expected_outcome": "implement",
"budget": {
"max_tool_calls": 60,
"max_activations": 15
},
"seed": [
{
"type": "TABL",
"name": "{{P}}INSTR",
"file": "seed/instr.tabl.asabap",
"description": "Instructor"
},
{
"type": "TABL",
"name": "{{P}}LESSON",
"file": "seed/lesson.tabl.asabap",
"description": "Lesson"
}
],
"contract": [
{
"type": "DDLS",
"name": "{{P}}I_LESSON_INSTR",
"fields": [
"LESSON_ID",
"INSTR_ID",
"LESSON_DATE",
"DURATION",
"FEE",
"INSTRUCTOR_NAME",
"INSTRUCTOR_CITY",
"_INSTRUCTOR"
]
}
],
"out_of_scope": [
"{{P}}INSTR",
"{{P}}LESSON"
],
"hidden_tests": [
{
"type": "CLAS",
"name": "{{P}}T31_HIDDEN",
"file": "hidden/t31_hidden.clas.abap",
"description": "T31 hidden tests"
}
],
"reference": [
{
"type": "DDLS",
"name": "{{P}}I_LESSON_INSTR",
"file": "reference/i_lesson_instr.ddls.asddls",
"description": "Lessons with instructor"
},
{
"type": "CLAS",
"name": "{{P}}T31_TEST",
"file": "reference/t31_test.clas.abap",
"description": "T31 own tests"
}
],
"craft_checks": []
}