Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
Showing results for 
Search instead for 
Did you mean: 

How to send 10000 records to RFC in packets of 1000 records

Former Member
0 Kudos

Hi Folks,

I have to send some 10k record to a rfc and that RFC will return the details of those 10k records.

Now since the processing time for all the 10k records crosses 5 hrs, RFC connection is getting failed.

So i want to send the data in packets of lets say 1000 , so that system will process only 1000 records at a time.

The main important logic is, the 1000 records which has been processes first time should not get process in next time.

Note: I dont know the exact numbers of records, but most of the time more than 10k

What would be the most efficient way to implement this logic.




Product and Topic Expert
Product and Topic Expert
0 Kudos

Well you can put a counter inside teh loop.

Count the number of rows and decide a package size accordingly.

Add the entries upto package size to anotehr internal table and pass it to the RFC for furtehr processing.

Delete these entries from the original internal table.

Active Participant
0 Kudos


itab_10k -> internal table that consists of records to be processed by RFC.

itab_rfc -> internal table that consists of records to be passed to RFC say 1000 at a time.

Now, say for 1000 records the RFC is taking reasonable amount of time and acknowledging with the results. itab_results.

data: counter type i.

Loop at itab_10k into wa_10k.

add 1 to i.

append wa_10k to itab_rfc.

if i = 1000.

pass itab_rfc to the RFC.

append the results table obtained after calling RFC to the itab_results.

refresh itab_rfc.
clear i.


clear: wa_10k.


if not i is initial.

pass itab_rfc to the RFC.

append the results table to the itab_results.

refresh itab_rfc.


By now all the records are processed and the data is available in itab_results.