01-19-2005 2:15 AM
Hello ABAPpers,
In my custom application, an external .NET program invokes a custom RFC. This custom RFC processes some queries and sends the records back to the .NET program. As the number of records are more than 10 million, the RFC sends the records in batches of 1000. Here is the pseudo ABAP code:
SELECT blah
IF ROWCNT = 1000.
CALL FUNCTION CLIENT_RFC DESTINATION 'BACK'
ROWCNT = 0.
ENDIF.
ENDSELECT.
When the RFC executes, CLIENT_RFC is invoked as expected. However, once we return from CLIENT_RFC, the ABAP program terminates with an error "Invalid interruption of selected database when accessing..."
It appears that the SELECT mechanism does not like making outgoing calls:-(.
Can someone please enlighten me on how to fix this problem? I am hoping there is some way to instruct the database not to interrupt itself.
Thank you in advance for your help.
Sheetal
01-19-2005 6:17 AM
Hi,
you should select the data into a internal table first, loop over the table and do the call.
select * into table itab from dbtab
where cond.
rowcnt = 0.
loop at itab.
if rowcnt = 1000.
call function ....
rowcnt = 0.
endif.
endloop.
regards
Siggi
01-19-2005 6:30 PM
Thanks Siggi.
In this case my only concern is the performance penalties when dealing with 10+ million records?
Would having to move all data into an internal table affect SAPs performance?
Thanks for your help.
Regards,
Sheetal
01-19-2005 7:03 PM
Hi Sheetal,
this depends on how much 'blah' you select.
Let's say, you select 10 000 000 entries with 1 Byte, then you have (about) 10MB. Each additional selected Byte will add another 10MB...
Reasonable size of program in memory is about 200MB, 500MB is possible (but should be discussed with basis team) and 1GB doesn't make much sense any more - program parts will be swapped to harddisk much earlier.
This is the border, were performance will break in: swapping.
So count selected fields carefully.
If you need to select to much columns, split execution by restriction with something like
do.
select * into itab up to 1000 rows
from DB
where key > old_key
order by primary key.
RFC
if sy-dbcnt < 1000.
exit.
endif.
old_key = last line of itab.
enddo.
Regards,
Christian
01-19-2005 9:00 PM
Were you in debugging mode when you get this error.
You also want to look at using PACKAGE SIZE n when doing the select statement for performance improvement.