Why is online editor for ABAP failing?

Hello everyone, I just started the ABAP track. Working on the first exercise(ITAB Basics) and no matter what I do it won’t pass the tests but it works in Eclipse IDE. I’ve even copied and pasted community solutions and no luck. Is there something wrong with my browser(tried windows edge and google chrome) or the online editor?

Can you provide your code? What error message are you seeing? Provide both as text preferably.

CLASS zcl_itab_basics DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .

PUBLIC SECTION.
TYPES group TYPE c LENGTH 1.
TYPES: BEGIN OF initial_type,
group TYPE group,
number TYPE i,
description TYPE string,
END OF initial_type,
itab_data_type TYPE STANDARD TABLE OF initial_type WITH EMPTY KEY.

METHODS fill_itab
       RETURNING
         VALUE(initial_data) TYPE itab_data_type.

METHODS add_to_itab
       IMPORTING initial_data TYPE itab_data_type
       RETURNING
        VALUE(updated_data) TYPE itab_data_type.

METHODS sort_itab
       IMPORTING initial_data TYPE itab_data_type
       RETURNING
        VALUE(updated_data) TYPE itab_data_type.

METHODS search_itab
       IMPORTING initial_data TYPE itab_data_type
       RETURNING
         VALUE(result_index) TYPE i.

PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.

CLASS zcl_itab_basics IMPLEMENTATION.
METHOD fill_itab.
initial_data = VALUE #( ( group = ‘A’ number = 10 description = ‘Group A-2’ )
( group = ‘B’ number = 5 description = ‘Group B’ )
( group = ‘A’ number = 6 description = ‘Group A-1’ )
( group = ‘C’ number = 22 description = ‘Group C-1’ )
( group = ‘A’ number = 13 description = ‘Group A-3’ )
( group = ‘C’ number = 500 description = ‘Group C-2’ )
).

ENDMETHOD.

METHOD add_to_itab.
updated_data = initial_data.
APPEND VALUE #(group = ‘A’ number = 19 description = ‘Group A-4’) TO updated_data.
ENDMETHOD.

METHOD sort_itab.
updated_data = initial_data.
SORT updated_data BY group ASCENDING number DESCENDING.
ENDMETHOD.

METHOD search_itab.
DATA(temp_data) = initial_data.
result_index = line_index( temp_data[ number = 6 ] ).
ENDMETHOD.

ENDCLASS.

We received the following error when we ran your code:

./zcl_itab_basics.clas.abap[8, 5]              - Statement does not exist in ABAPopen-abap(or a parser error), "TYPES" (parser_error) [E]
./zcl_itab_basics.clas.abap[17, 20]            - Contains unknown, ITAB_DATA_TYPE not found, lookup (unknown_types) [E]
./zcl_itab_basics.clas.abap[20, 22]            - Variable "INITIAL_DATA" contains unknown: ITAB_DATA_TYPE not found, lookup (unknown_types) [E]
./zcl_itab_basics.clas.abap[22, 19]            - Variable "UPDATED_DATA" contains unknown: ITAB_DATA_TYPE not found, lookup (unknown_types) [E]
./zcl_itab_basics.clas.abap[25, 22]            - Variable "INITIAL_DATA" contains unknown: ITAB_DATA_TYPE not found, lookup (unknown_types) [E]
./zcl_itab_basics.clas.abap[27, 19]            - Variable "UPDATED_DATA" contains unknown: ITAB_DATA_TYPE not found, lookup (unknown_types) [E]
./zcl_itab_basics.clas.abap[30, 22]            - Variable "INITIAL_DATA" contains unknown: ITAB_DATA_TYPE not found, lookup (unknown_types) [E]
./zcl_itab_basics.clas.abap[43, 5]             - Statement does not exist in ABAPopen-abap(or a parser error), "initial_data" (parser_error) [E]
./zcl_itab_basics.clas.abap[55, 5]             - Statement does not exist in ABAPopen-abap(or a parser error), "APPEND" (parser_error) [E]
./zcl_itab_basics.clas.abap[64, 5]             - "DATA" not found, Target (check_syntax) [E]
./zcl_itab_basics.clas.abap[65, 5]             - Statement does not exist in ABAPopen-abap(or a parser error), "result_index" (parser_error) [E]
./zcl_itab_basics.clas.testclasses.abap[16, 5] - Statement does not exist in ABAPopen-abap(or a parser error), "cut" (parser_error) [E]
./zcl_itab_basics.clas.testclasses.abap[21, 5] - "DATA" not found, Target (check_syntax) [E]
./zcl_itab_basics.clas.testclasses.abap[22, 5] - "actual" not found, findTop (check_syntax) [E]
./zcl_itab_basics.clas.testclasses.abap[24, 5] - Statement does not exist in ABAPopen-abap(or a parser error), "DATA" (parser_error) [E]
./zcl_itab_basics.clas.testclasses.abap[32, 5] - "expected_values" not found, findTop (check_syntax) [E]
./zcl_itab_basics.clas.testclasses.abap[40, 5] - Statement does not exist in ABAPopen-abap(or a parser error), "cl_abap_unit_assert" (parser_error) [E]
./zcl_itab_basics.clas.testclasses.abap[49, 5] - Statement does not exist in ABAPopen-abap(or a parser error), "DATA" (parser_error) [E]
./zcl_itab_basics.clas.testclasses.abap[58, 5] - "expected_values" not found, findTop (check_syntax) [E]
./zcl_itab_basics.clas.testclasses.abap[65, 5] - Statement does not exist in ABAPopen-abap(or a parser error), "cl_abap_unit_assert" (parser_error) [E]
./zcl_itab_basics.clas.testclasses.abap[71, 5] - Statement does not exist in ABAPopen-abap(or a parser error), "DATA" (parser_error) [E]
./zcl_itab_basics.clas.testclasses.abap[80, 5] - "expected_values" not found, findTop (check_syntax) [E]
./zcl_itab_basics.clas.testclasses.abap[86, 5] - Statement does not exist in ABAPopen-abap(or a parser error), "cl_abap_unit_assert" (parser_error) [E]
abaplint: 23 issue(s) found

I got it figured out. The test didn’t like how I added values to the table. Used these instead:
value itab_data_type(
append value initial_type(

1 Like