SAP-Forum.ORG
   
This web site isn't affiliated with, sponsored by, or approved by SAP AG. Is only a SAP users community.

Go Back   SAP-Forum.ORG > SAP Forums > SAPScript - Smartforms

Aprenda SAP!
Reply
 
Thread Tools Display Modes
  #1  
Old 08-20-2011, 12:14 AM
Ramma Ramma is offline
Senior Member
 
Join Date: May 2010
Location: California
Posts: 287
Default RFC_READ_TABLE (too many records)

Hello experts,

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,
Ramma
Reply With Quote
Sponsors
  #2  
Old 08-20-2011, 12:16 AM
Portal Portal is offline
Senior Member
 
Join Date: May 2010
Location: Miami
Posts: 791
Default Re: RFC_READ_TABLE (too many records)

Hi Ramma,

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

Regards,
Portal
Reply With Quote
  #3  
Old 08-20-2011, 12:19 AM
Lala Lala is offline
Senior Member
 
Join Date: May 2010
Location: Chicago
Posts: 394
Default Re: RFC_READ_TABLE (too many records)

Hi Ramma,

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,
Lala
Reply With Quote
Entre a los Links relacionados
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 10:19 AM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Forum Design By inferno