-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
My code runs in ABAP System of on-prem but gives error in Exercism #203
Comments
thanks, this looks like a new bug 👍 |
first fix = abaplint/abaplint@f0f948f |
Dear Team, I have a similar solution which runs well on-premise but not in Exercism. My solutionCLASS zcl_itab_aggregation DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
TYPES group TYPE c LENGTH 1.
TYPES: BEGIN OF initial_numbers_type,
group TYPE group,
number TYPE i,
END OF initial_numbers_type,
initial_numbers TYPE STANDARD TABLE OF initial_numbers_type WITH EMPTY KEY.
TYPES: BEGIN OF aggregated_data_type,
group TYPE group,
count TYPE i,
sum TYPE i,
min TYPE i,
max TYPE i,
average TYPE f,
END OF aggregated_data_type,
aggregated_data TYPE STANDARD TABLE OF aggregated_data_type WITH EMPTY KEY.
METHODS perform_aggregation
IMPORTING
initial_numbers TYPE initial_numbers
RETURNING
VALUE(aggregated_data) TYPE aggregated_data.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_itab_aggregation IMPLEMENTATION.
METHOD perform_aggregation.
aggregated_data = VALUE #(
FOR GROUPS <group_key> OF <wa> IN initial_numbers
GROUP BY ( key = <wa>-group count = GROUP SIZE )
LET group_sum = REDUCE i( INIT sum = 0
FOR m IN GROUP <group_key>
NEXT sum += m-number )
group_max = REDUCE i( INIT max = 0
FOR m IN GROUP <group_key>
NEXT max = nmax( val1 = max
val2 = m-number ) )
IN ( group = <group_key>
sum = group_sum
max = group_max
min = REDUCE i( INIT min = group_max
FOR m IN GROUP <group_key>
NEXT min = nmin( val1 = min
val2 = m-number ) )
average = group_sum / <group_key>-count
count = <group_key>-count ) ).
ENDMETHOD.
ENDCLASS. abaplint issues received on Exercism
|
another fix = abaplint/abaplint#2706 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dear Team,
Issue reported
We received the following error when we ran your code:
./zcl_itab_aggregation.clas.abap[37, 5] - Statement does not exist in ABAPopen-abap(or a parser error), "aggregated_data" (parser_error) [E]
abaplint: 1 issue(s) found
The text was updated successfully, but these errors were encountered: