cancel
Showing results for 
Search instead for 
Did you mean: 

RFC_READ_TABLE (too many records)

Former Member
0 Kudos

Hi,

I am trying to download a massive amount of records from table CDPOS using VBA and the SAP.Functions library. It works fine for other tables. It also works if I limit the records to be obtained using "OPTIONS". However, if this criteria covers a high number of records or if I don't define a criteria at all then I get a "SYSTEM FAILURE" message. I have a simiar problem when useing SE16 and the number of records is too high.

Any ideas on how to deal with this? There is not a date field in CDPOS for me to extract by date ranges and sometimes there is a high number of records associated to a single document number.

Thanks in advance,

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

What i have done is, split the RFC call into several times and join the result after that.

Former Member
0 Kudos

Hi!

I haven't been working with this table myself so I might be drawing incorrect conclusions here but I when a had a look at the table I noticed there is a field called CHANGENR. When checking the data in this field in my system I notice it's escalating and maybe you can use this to fetch all the records in smaller loads.

Lets say you start by calling RFC_READ_TABLE with a CHANGENR interval set to min 0 max 9999999 and then you restrict the number of hits to an appropriate value. This would result in records with the smallest number from changenr up to a number where the max records hits. After that you could just take the last received CHANGENR value and use it as min in your interval redo the search and then continue this until the returned number of records is less then "maximum number of hits" which would indicate that you've extracted all the data from the table.

Concrete example:

Search criteria CHANGENR 0 to 99999999 with maximum number of hits set to 6 (lets make it low for the sake of argument):

1500000

1500001

1500002

1500002

1500002

1500003

Redo search with search criteria CHANGENR 1500003 (yes we want this one again) to 99999999

1500003

1500003

1500003

1500004

1500005

1500006

Now we would like to withdraw the number of 1500003 we received in the previous search (1) from the "top" to avoid duplicates, in this case we would have 5 usable records in search batch 2. Then just continue like that until records returned is less then maximum number of hits or equal to zero.

Maybe the CHANGENR isn't as fixed as this, just a thought when I read your question:)

Hope it helps!

Regards, Ernst.

Former Member
0 Kudos

Ernst,

Thanks! I actually impelented this idea yesterday after all the feedback received and it worked. Although, it works the only issue that I have is that the connection has to be closed and all the objects initialized everytime that the criteria is changed to pull the data.

Thanks again!

Jose

Former Member
0 Kudos

Hi ,

Even i am getting the same kind of error...

I am using two functions which are exposed as webservice and consumed in .NET

RFC_READ_TABLE - to read username from USR02 table

bapi_user_get_detail - to fetch detail of each user.

I first call RFC_READ_TABLE for 150 records. then for each record i call BAPI_USER_GET_DETAIl.

But when i call RFC_READ_TABLE for second set of 150 records, the sap system gets disconnected.

Please help me to solve the issue

Thanks,

Anshul.

Former Member
0 Kudos

I am trying to download a massive amount of records from table CDPOS using VBA and the SAP.Functions library. It works fine for other tables. It also works if I limit the records to be obtained using "OPTIONS". However, if this criteria covers a high number of records or if I don't define a criteria at all then I get a "SYSTEM FAILURE" message. I have a similar problem when using SE16 and the number of records is too high.

Any ideas on how to deal with this? There is not a date field in CDPOS for me to extract by date ranges and sometimes there is a high number of records associated to a single document number.

Note,

1) Rule of thumb is 600,000+ entries would cause SYSTEM FAILURE or PAGE ALLOC FAILED errors.

2) Use

Best not use the RFC Approach, use Proxy/Web Service.

Nevertheless, few points, on how I used the similar situations.

try limiting your extraction.

1) If you are looking for only INSERTS, or UPDATES, DELETES or so, use Change type as either (U, I, E, D)

2) if you are looking for changes done by a particular SAP Transaction, 2 calls of RFC_READ_TABLE

Use CDHDR Table, give your Change Doc Type, Document No & Transaction, get the Change Doc No's.

Use the Change Doc No's on CDPOS