Hi Daniel,
You should write your code in i_step 2. But, the user will not be able to make further selections from the populated values for ZVAR. Is that ok?
Right now I do not have access to a BW system, so I cannot help you with the exact structure and variable names where you can access the values for year and plant that the user selects.
But your idea is right. In i_step 2 you get the values for the year and plant from the other variables and then do a selection on the z table.