Your first select statement stores a result in a variable called RESULT_SOFORT. As such it is a table type - not a scalar type.
Then in your for loop, you try to use it as a scalar: FOR RESULT_SOFORT IN ...
That's the problem.
To be honest though, I think you need to step back and re-consider how you build your solution. Re-factoring ABAP code or stored procedures from another DB in a 1:1 fashion in HANA is a bad idea.
In the above, all I see is you moving some data around, calculating a percentage, etc. You can expect *awful* performance above compared to what you could do with some careful modeling with Analytic/Calculation Views, etc....