hi
I would suggest, to implement your data source within ABAP OO and then create an object "DataExtractor", which will be able to deliver your data package by package. In this object, you can define a method "init", there, all your processing will be done and the data will be stored into an attribute.
After this, you can perform a opencursor / fetch processing and read packages from your internal table.
For this: Use a factory which holds the instance of your DataExtractor during the whole extraction. Look at this, on how to build factories: Factory-Pattern in ABAP OO
Kind regards,