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

Problem with select

Former Member
0 Likes
905

Hello everyone

I have a huge problem with select:

I'm using this one

SELECT * FROM bseg

INTO TABLE t_bseg_aux

WHERE bukrs = '5500'

AND belnr IN r_belnr

AND gjahr IN s_lfgja

AND koart = 'M'

AND bschl IN r_bschl

AND matnr IN s_matnr

AND bwkey IN s_bwkey

AND bwtar IN s_bwtar

AND hkont IN s_hkont.

the funny thing is that sometimes it works and others it doesn't

sometimes the system gives me a dump -> DBIF_RSQL_INVALID_RSQL

Does anyone know why that happened if i didn't make any changes in this select???

Thanks in Advance

9 REPLIES 9
Read only

Former Member
0 Likes
867

Hi,

is this right (bold marked)? Can you show the definion of your selections?


SELECT * FROM bseg
INTO TABLE t_bseg_aux
WHERE bukrs = '5500'
*AND belnr IN r_belnr*
AND gjahr IN s_lfgja
AND koart = 'M'
*AND bschl IN r_bschl* 
AND matnr IN s_matnr 
AND bwkey IN s_bwkey 
AND bwtar IN s_bwtar 
AND hkont IN s_hkont. 

Regards, Dieter

Read only

0 Likes
867

Hello thanks for your answer, dieter.....but i think thomas got the point, i'll check it and i'll post it if it's right

my ranges are:

r_belnr LIKE RANGE OF bkpf-belnr

r_bschl LIKE RANGE OF bseg-bschl

do you think it's because of the type i declared them?

Edited by: Lolita Lupi on Feb 3, 2009 1:29 PM

Read only

0 Likes
867

Hi Lolita,

how do you fille these ranges?

regards, Dieter

Read only

0 Likes
867

i think it is due to this which u told lolita.

u have to use inner join on bseg and bkpf.

but u cant make inner join on the cluster table bseg transparent tabke bkpf.

u have to select data one by one from both tables and then process them again.

Read only

ThomasZloch
Active Contributor
0 Likes
867

Depends on how your selection ranges are filled. If you are filling too many single values, you will end up with that dump. The exact maximum number is difficult to determine, it depends on the overall size of the SQL statement that is being passed to the database, but it is somewhere between 1000 and 3000 in my experience.

Thomas

P.S. nice user name

Read only

0 Likes
867

Thanks Thomas...i think you got the point my range r_belnr's got too many single values...i'll try take it off and if i suceed i'll mark this thread as answered...

Thank you very much and my user name is my real name....

Read only

former_member404244
Active Contributor
0 Likes
867

Hi,

Bseg is a clsuter table and it will have huge data..

instead of using * , take only those fields which are required... and see.

also u might be filling too many single values for the ranges..please check

Regards,

Nagaraj

Read only

0 Likes
867

Hello

Yes Thomas was right...the problem was my range belnr

It worked out just fine with that:

SELECT bukrs belnr gjahr buzei koart shkzg matnr werks bwkey bwtar

dmbtr hkont lifnr FROM bseg

INTO TABLE t_bseg_aux

FOR ALL ENTRIES IN t_bkpf

WHERE bukrs = '5500'

AND belnr = t_bkpf-belnr

AND gjahr = t_bkpf-gjahr

AND koart = 'M'

AND bschl IN r_bschl

AND matnr IN s_matnr

AND bwkey IN s_bwkey

AND bwtar IN s_bwtar

AND hkont IN s_hkont.

one more thing: I had chosen the fields like you said but it wasn't working anyway....the way above it worked!!

Thanks for everyone!

Read only

Former Member
0 Likes
867

Declare like this


Ranges: r_belnr FOR bkpf-belnr,
             r_bschl FOR bseg-bschl