Memory problems when invoking SAP RFC or db query

  1. I have a call from webMethods to SAP which could return a large number of IData records for a given date range. I would like to avoid out of memory errors of course. Is there a way to read in data from SAP in small chunks (say X records at a time) somewhat like a db cursor? If not, what are some workarounds you guys have come up with?

  2. Similarly when I make a database call I might get back a lot of records which kills all the memory. If I get a total count and then make multiple calls I need to figure out where to continue from on the subsequent call.

  3. How can we figure out how many records is reasonable to read in - ie. how big is an IData compared to the raw data fields?