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.
cancel
Showing results for 
Search instead for 
Did you mean: 

Error making an outgoing call within a SELECT loop.

Former Member
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

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

0 Kudos

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

christian_wohlfahrt
Active Contributor
0 Kudos

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

nablan_umar
Active Contributor
0 Kudos

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.