No this will result in an error and code cannot be activated.
We can use REDUCE and FOR to add all the amount fields without using LOOP statement.
We can use LOOP AT GROUP BY and provide fields required for grouping similar records and then use LOOP AT GROUP.
By using FILTER operator with KEY and WHERE specific records can be moved to another internal table.