Application Development and Automation 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: 
Read only

Database error DBIF_RSQL_SQL_ERROR - related to program?

Former Member
0 Likes
696

Dear users,

We are stuck with a rather unusual problem.

There's this program which runs in batch every week providing information from a few database tables and all of a sudden it wants to playup!

The following error comes up with the cancelled batchjob.

Runtime Errors         DBIF_RSQL_SQL_ERROR  
Exception              CX_SY_OPEN_SQL_DB    
  Database error text........: "[1101] Could not allocate a new page for database   
   'TEMPDB' because of insufficient disk space in filegroup 'DEFAULT'. Create the   
   necessary space by dropping objects in the filegroup, adding additional files    
   to the filegroup, or setting autogrowth on for e"                                
  Internal call code.........: "[RSQL/OPEN/AUFK ]"

This error happens at the following SELECT query.

SELECT A~AUFNR B~BELNR B~BUZEI B~KSTAR B~MEINB B~WKGBTR B~MBGBTR E~KTEXT

INTO CORRESPONDING FIELDS OF COST_TAB

FROM ( AUFK AS A INNER JOIN COEP AS B
       ON A~OBJNR = B~OBJNR

       INNER JOIN COBK AS C
       ON B~BELNR = C~BELNR

       INNER JOIN CSKA AS D
       ON B~KSTAR = D~KSTAR

       INNER JOIN CSKU AS E
       ON D~KSTAR = E~KSTAR )

WHERE     A~AUFNR IN AUFNR
          AND B~VERSN IN VERSN
          AND B~WRTTP IN WRTTP
          AND B~BEKNZ IN BEKNZ
          AND C~BUDAT IN BUDAT
          AND D~KSTAR IN S_KSTAR.

APPEND COST_TAB.

ENDSELECT.

I was wondering if the SELECT query could be written any better to ensure that this error doesn't happen.

If not, what other options am I left with please?

Thanks,

VJ

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
588

Hi Vijay,

It is believed that select into internal table has better performance than select-endselect.

so, try this..

*COST_TAB_NEW is an internal table which has the fields

AAUFNR BBELNR BBUZEI BKSTAR BMEINB BWKGBTR BMBGBTR EKTEXT in the same order as defined in the select.

SELECT A~AUFNR B~BELNR B~BUZEI B~KSTAR B~MEINB B~WKGBTR B~MBGBTR E~KTEXT
 
INTO TABLE COST_TAB_NEW
 
FROM ( AUFK AS A INNER JOIN COEP AS B
       ON A~OBJNR = B~OBJNR
 
       INNER JOIN COBK AS C
       ON B~BELNR = C~BELNR
 
       INNER JOIN CSKA AS D
       ON B~KSTAR = D~KSTAR
 
       INNER JOIN CSKU AS E
       ON D~KSTAR = E~KSTAR )
 
WHERE     A~AUFNR IN AUFNR
          AND B~VERSN IN VERSN
          AND B~WRTTP IN WRTTP
          AND B~BEKNZ IN BEKNZ
          AND C~BUDAT IN BUDAT
          AND D~KSTAR IN S_KSTAR.

.

4 REPLIES 4
Read only

Former Member
0 Likes
589

Hi Vijay,

It is believed that select into internal table has better performance than select-endselect.

so, try this..

*COST_TAB_NEW is an internal table which has the fields

AAUFNR BBELNR BBUZEI BKSTAR BMEINB BWKGBTR BMBGBTR EKTEXT in the same order as defined in the select.

SELECT A~AUFNR B~BELNR B~BUZEI B~KSTAR B~MEINB B~WKGBTR B~MBGBTR E~KTEXT
 
INTO TABLE COST_TAB_NEW
 
FROM ( AUFK AS A INNER JOIN COEP AS B
       ON A~OBJNR = B~OBJNR
 
       INNER JOIN COBK AS C
       ON B~BELNR = C~BELNR
 
       INNER JOIN CSKA AS D
       ON B~KSTAR = D~KSTAR
 
       INNER JOIN CSKU AS E
       ON D~KSTAR = E~KSTAR )
 
WHERE     A~AUFNR IN AUFNR
          AND B~VERSN IN VERSN
          AND B~WRTTP IN WRTTP
          AND B~BEKNZ IN BEKNZ
          AND C~BUDAT IN BUDAT
          AND D~KSTAR IN S_KSTAR.

.

Read only

Former Member
0 Likes
588

use INTO TABLE COST_TAB.

and still if the error persists

try to use view

and from view extract the data.

with regards

s.janagar

Read only

Former Member
0 Likes
588

Hi VJ,

In the select options there is a limitation of objects that can be indicated individually (approximately 5000). Is it possible that in some case this limit is excelling itself?.

In this case you should avoid it, indicating ranges instead of individual values.

Regards,

Pepe

Read only

0 Likes
588

Many thanks for all your replies Gentlemen!

I will surely try the option of replacing the workarea with an Internal table and see how it goes.

@Jose - Just checked the Select-options and there are hardly 3 entries in each field. But thanks for coming up with this perspective since I never knew there was a hard limit on the number of single values in a select option.