‎2009 Feb 03 12:10 PM
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
‎2009 Feb 03 12:24 PM
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
‎2009 Feb 03 12:29 PM
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
‎2009 Feb 03 12:32 PM
‎2009 Feb 03 12:32 PM
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.
‎2009 Feb 03 12:25 PM
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
‎2009 Feb 03 12:32 PM
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....
‎2009 Feb 03 12:32 PM
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
‎2009 Feb 03 12:54 PM
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!
‎2009 Feb 03 12:32 PM
Declare like this
Ranges: r_belnr FOR bkpf-belnr,
r_bschl FOR bseg-bschl