Reason why I think, u are not getting the correct data, its because you are limiting your select statement through Package.
I think we are deviating here, data is coming correctly. It's just that to see 5 days old data, i have to pull 250,000 records(with my doc types and status) and filter them to 50 records using BLDAT and BUDAT.
I used package to avoid memory issues as i'm dealing with large table.
Planning to create secondary index for the below fields.
MANDT
BUKRS
BLART
BLDAT
BUDAT
What do you think? Will it impact on any other areas (while INSERT or UPDATE the documents)??