We received the following error when we ran your code:
./zcl_itab_basics.clas.abap[9, 5] - Statement does not exist in ABAPopen-abap(or a parser error), "TYPES" (parser_error) [E]
./zcl_itab_basics.clas.abap[9, 5] - Statement does not exist in ABAPopen-abap(or a parser error), "TYPES" (parser_error) [E]
./zcl_itab_basics.clas.abap[9, 5] - Statement does not exist in ABAPopen-abap(or a parser error), "TYPES" (parser_error) [E]
./zcl_itab_basics.clas.abap[9, 5] - Statement does not exist in ABAPopen-abap(or a parser error), "TYPES" (parser_error) [E]
./zcl_itab_basics.clas.abap[9, 5] - Statement does not exist in ABAPopen-abap(or a parser error), "TYPES" (parser_error) [E]
./zcl_itab_basics.clas.abap[9, 5] - Statement does not exist in ABAPopen-abap(or a parser error), "TYPES" (parser_error) [E]
abaplint: 6 issue(s) found
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,
group TYPE group A,
number TYPE i 10,
description TYPE string GROUP A-2,
group TYPE group B,
number TYPE i 5,
description TYPE group B,
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.
"add solution here
ENDMETHOD.
METHOD add_to_itab.
updated_data = initial_data.
"add solution here
ENDMETHOD.
METHOD sort_itab.
updated_data = initial_data.
"add solution here
ENDMETHOD.
METHOD search_itab.
DATA(temp_data) = initial_data.
"add solution here
ENDMETHOD.
ENDCLASS.
this is my solution and it might look embarrassing but yes it is my solution
Not to discourage you, because that is not the intention here, but you might want to look at this discussion about being a beginner in programming and how it relates here, along with our ideas about what is coming to address that.
It can be done, but my suggestion is to find a mentor that can help you navigate these waters, or go down that road on these tires, as it were.
Good luck on your adventure. While it can be done here, from this starting point, you will want to have some additional resources and hopefully some good mentors.
You should see pictures of (anything) that I started doing, when learning, and I guarantee you they could be a source of embarrassment, except that I think “how can it be embarrassing when it looks like anyone that ever did that thing for the first time?”
So, no, I am not embarrassed to look at code that looks like that, and neither should you.
If you do not have a good reason to learn ABAP specifically (like work, or friends, or pre-existing code you want to work on, or…), as a complete beginner you might want to look elsewhere for your first language. Judging by how very little I have heard of ABAP in some 14 years of being around, I fear a relative lack of learning resources about ABAP.
(I realize that absence of evidence is merely weak evidence of absence; please correct me if I’m wrong on this!)
Sorry for not seeing this earlier. The errors you got are because of an incorrect syntax in the type definitions. Currently the ABAP integration in Exercism so not able to give better more detailed error messages in this case (it’s still pretty new).
The itab exercises are a bit advanced for a beginner in ABAP. Try some of the easier ones like “reverse” or “two fer” at the start. Requesting a mentor will also help you learn more quickly if you’re stuck (better than the forum).
Finally, if you have other technical issues with ABAP, it’s better to check for known issues or open a new issue in the corresponding repo on GitHub: ABAP on Exercism
I’m not an absolute beginner at programming, but I am new to ABAP. I tried to tackle this exercise for a few hours, checked every syntax reference I could, double-checked everything, until I noticed that the errors were in cl_itab_basics.clas.testclasses.abap. I don’t discard the possibility that the errors are related to something I’m doing wrong with my code in zcl_itab_basics.clas.abap. But either way, I’m going to go ahead and try a different exercise.
We received the following error when we ran your code:
./zcl_itab_basics.clas.testclasses.abap[3, 10] - Variable "CUT" contains unknown: REF, unable to resolve zcl_itab_basics (unknown_types) [E]
./zcl_itab_basics.clas.testclasses.abap[16, 5] - Target type unknown, cut (check_syntax) [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[54, 5] - Method "fill_itab" not found, methodCallChain (check_syntax) [E]
./zcl_itab_basics.clas.testclasses.abap[62, 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[105, 5] - Method "add_to_itab" not found, methodCallChain (check_syntax) [E]
./zcl_itab_basics.clas.testclasses.abap[114, 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[154, 5] - Method "sort_itab" not found, methodCallChain (check_syntax) [E]
./zcl_itab_basics.clas.testclasses.abap[160, 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[166, 5] - Method "search_itab" not found, methodCallChain (check_syntax) [E]
abaplint: 11 issue(s) found
If you want help, it would be good to share your code Without seeing any code, it’s hard to say anything other than the linter is probably working correctly.