Hi Paulo,
First of all, for such complex requirements, I recommend to use the Expert Routine. This will lead to a more transparent piece of coding in my opinion.
Furthermore, I suggest to avoid using UPDATE and COMMIT WORK in the coding. You are not working with a stand-alone program, it's part of the transformation framework of BW. Instead, you must work with 0RECORDMODE to insert, delete or modify records. Transfer the records to RESULT_PACKAGE and the framework will take care of the rest.
For performance reasons, avoid using SELECT SINGLE. It's much better to fill an internal table first and then READ TABLE to read from the internal table. Hashed table is preferable if you can use the primary key.
Using field-symbols can also improve performance (i.e. for season).
Best regards,
Sander