Skip to Content
Former Member
Dec 10, 2012 at 08:01 PM

Basic select does not work


Hello Expert,

I'm trying to write the following select to fetch list of records based on the various filters. There are two fields in Standard SAP VBAK table (VDATU and BSTDK) where I'm keep getting error. On the first AND ( vdatu EQ bstdk ) I'm keep getting error that (Field "BSTDK" is unknown). However, when I look at VBAP both the fields are part of this table. Can anybody please point out my mistake and how to rectify it.

SELECT vbeln erdat vdatu bstdk
FROM vbak
INTO TABLE git_vbak
WHERE erdat IN so_date
"AND ( vdatu EQ bstdk )
AND ( vbtyp EQ lc_vbtyp )
AND ( auart EQ lc_zshp OR auart EQ lc_zlcy )
AND ( augru EQ lc_sh OR augru EQ lc_lc )
AND ( bsark EQ lc_zonl OR bsark EQ lc_zpws OR bsark EQ lc_zoff OR bsark EQ lc_zedi OR bsark EQ lc_zotb ).
sort git_vbak by vbeln.

Many thanks in advance.