Hi Loed,
could you try this change in a source code from your original posting:
1. from the
IF s_counter_datapakid = 0
ENDIF.
please delete and put the "ENDIF"
befor:
s_counter_datapakid = s_counter_datapakid + 1.
2. delete from
"IF sy-subrc = 0.
RAISE no_more_data.
ENDIF"
"IF sy-subrc = 0." and "ENDIF"
3. put befor RAISE no_more_data a "ELSE".
So you call you FM the first call, when s_counter_datapackd = 0, and at the next call you raise the no_more_data exception.
Best regards
Peter