I am not exactly sure what you want want to achieve with a "counter". If you just want to number the lines of the table (based on a certain order?) you can generate the number via the analytic row_number function:
ROW_NUMBER () OVER (ORDER BY <order_by_columns_separated_by_comma>)
Alternatively you can implement a number range based on a SAP HANA sequence.