hi Junaid,
Your logic should be like below:
OPEN CURSOSR STATEMENT
WHILE 1 = 1. (INFINITE LOOP WHICH WILL EXIT WHENEVER SY-SUBRC NE 0)
FETCH CURSOR WITH PACKAGE SIZE I_MAXSIZE.
IF SY-SUBRC EQ 0.
POPULATE DATA IN E_T_DATA
ELSE.
RAISE NO_MORE_DATA.
ENDIF.
ENDWHILE.
You have not used fetch cursor statement neither Raise No More data statement.
Note: The purpose of RAISE_NO_MORE_DATA is to specify that the load is complete. If you raise it without specifying the correct condition it will not fetch any records.
Thanks,
Puneet