*select statement to select data from the table as input into*our dynamic internal table.*Here i have restricted only till 5 rows.*You can set a variable and give no of rows to be fetched*The variable can be set in your select statement

SELECT * INTO CORRESPONDING FIELDS OF TABLE FROM (p_table) up to 5 rows.