Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Select strange error

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

Tags:
replied

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~gjahr

It would actually be better to join VBKPF instead of BKPF. Also delete CLIENT SPECIFIED and the WHERE-condition on bkpf~mandt, not needed.

Thomas

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question