Finally! Thanks Frederic :-) But how do I declare an internal table and append the g_t_ZPY_P01 to it? My ABAP skills are quite moderate...
I noted that there is another mistake in the code aswell, but I don't think it makes any difference to my issue.
FORM get_all_data_from_infocube CHANGING g_s_ZPY_P01should be ...CHANGING g_t_ZPY_P01.