SELECT kcharg kmatnr kwerks kmblnr kmjahr kzeile lbldat lbudat kkunnr kmenge
kmeins kaufnr kbukrs khsdat FROM mseg as k inner join mkpf as l
on kmblnr = lmblnr
INTO table vit_final
WHERE bukrs eq p_bukrs and l~bldat in s_bldat.
PERFORM f_change_format
The above code reads all data from database table into internal table vit_final and then calls function f_change_format, that writes the read data into a file.
This leads to roll memory full error ...
How can I fine tune this code so that each record is read and immediately function call is made so that one record at a time is read and written to file instead of full set of records getting read into internal table vit_final as this leads to dump.