‎2008 Oct 01 11:25 AM
Hello,
I'm doing a SELECT on bkpf and vbsegs with a join and got an "error" only when I fill 2 values in my select-options
ex:
1)
p_bukrs = 1000
s_gjahr = 2007
s_kostl= XXX
-> work fine
2)
p_bukrs = 1000
s_gjahr = 2007 to 2008
s_kostl = XXX
-> no reply no error, nothing :s
SELECT * INTO CORRESPONDING FIELDS OF TABLE it_fact
FROM bkpf INNER JOIN vbsegs ON bkpf~belnr = vbsegs~belnr
client specified
WHERE bkpf~mandt = sy-mandt
AND bkpf~bukrs = p_bukrs
AND bkpf~gjahr IN s_gjahr
AND bkpf~budat IN s_budat
AND bkpf~bldat IN s_bldat
AND vbsegs~kostl IN s_kostl.I ve tried the same select only on the bkpf table (without JOIN) and all hapen fine.....
I got crazy : )
Thanks for help
‎2008 Oct 01 12:22 PM
The ON-conditions need to be enhanced:
FROM bkpf INNER JOIN vbsegs ON bkpf~bukrs = vbsegs~ausbk
AND bkpf~belnr = vbsegs~belnr
AND bkpf~gjahr = vbsegs~gjahrIt would actually be better to join VBKPF instead of BKPF. Also delete CLIENT SPECIFIED and the WHERE-condition on bkpf~mandt, not needed.
Thomas
‎2008 Oct 01 11:35 AM
hii
may i know where u r using this query an module pool or report
‎2008 Oct 01 11:53 AM
Hi,
it would be helpful to know what error you are getting.
Greetings,
Gert.
‎2008 Oct 01 12:04 PM
I need this tables to select a belnr based on the gjahr and kost data selection...
-> Unfortunatly, i dont have any error 😕
Just waiting in debug until I cut the transaction...
Thx for reply
‎2008 Oct 01 12:14 PM
Strange,
i'm tried your code in our test system, and your test scenario, but no error here !
What is exactly the error you're get ?
regards,
Hans
‎2008 Oct 01 12:22 PM
The ON-conditions need to be enhanced:
FROM bkpf INNER JOIN vbsegs ON bkpf~bukrs = vbsegs~ausbk
AND bkpf~belnr = vbsegs~belnr
AND bkpf~gjahr = vbsegs~gjahrIt would actually be better to join VBKPF instead of BKPF. Also delete CLIENT SPECIFIED and the WHERE-condition on bkpf~mandt, not needed.
Thomas
‎2008 Oct 01 12:27 PM