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: 

RFC_ERROR_SYSTEM_FAILURE: Error in module RSQL of the database interface

ashish_bansal
Explorer
0 Kudos

HI All,

I am trying to execute an RFC through JCO connection and getting the error "RFC_ERROR_SYSTEM_FAILURE: Error in module RSQL of the database interface".

While debugging I have found that the actual cause of dump is a SQL command written in this RFC. The SQL command is

SELECT DISTINCT *

INTO CORRESPONDING FIELDS OF TABLE lt_calcrule_hol

FROM itc_calcrule_hol

FOR ALL ENTRIES IN calc_rule

WHERE rule_id = calc_rule-rule_id

AND start_date <= sy-datum

AND end_date >= sy-datum

AND (lv_ident)

AND ( (lv_orgs)

OR location_type = '' ).

Here the value of lv_ident is ======>> ident IN ('US','B2'.........................)

and value of lv_orgs is =========>> location_type IN ('S1','S2',..............................)

location_type and ident are columns in table itc_calcrule_hol .

I have analysed that if I pass around 700 enteries in the lv_ident and lv_ogs then it is working fine.

But if I have more than 900 enteries in these variables then it dumps.

Can anybody let me know what is the issue with the query here.And what could be the solution.

Thanks and Regards,

Reena

3 REPLIES 3

Former Member
0 Kudos

Depending on your database there's a maximum length of the SQL statement. Also, SAP itself has limits: For versions up to 6.40 it was 32,000 characters, with 7.00 it was extended to 2MB. So basically you have to ensure that your lists don't get too long as you get the short dump you've seen otherwise.

The only way you can get around this problem is to rewrite your query. If you have to have those long lists, you'll have to split your SQL statement into several smaller pieces.

0 Kudos

Hi Harald,

First of all thanks for the quick response. We checked the length of the SQL statement and its about 15,000 characters. And we are also having 7.0 version. Do you see any other reason for this issue. ?

How can we check what's the maximum length of any particular DB?

Thanks in advance.

Ashish...

0 Kudos

I'd recommend talking to an experienced basis admin or ABAP developer. First of all it would help to look at the short dump in SAP, to see if that gives any useful information. In case of a generic error like DBIF_RSQL_INVALID_RSQL, the developer trace of the work process (dev_w<n>) should contain further information (to get the number of the work process that handled your RFC call check the system log, which contains the reference along with a comment about the dump). So I'd check those first to see what actually caused the problem.

Information on maximum SQL statement length can either be retrieved from the database vendor's documentation or alternatively by searching SAP [OSS notes|https://service.sap.com/notes]. For the latter you need a valid user ID for the SAP service market place.