Application Development 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: 

select sql

Former Member
0 Kudos

SELECT vbelv posnv vbeln posnn vbtyp_n rfmng meins plmin erdat bwart

FROM vbfa

INTO TABLE it_vbfa

FOR ALL ENTRIES IN it_ekbe_del

WHERE vbelv = it_ekbe_del-belnr

AND vbeln IN pr_vbel2

AND posnn = it_ekbe_del-ebelp

AND ( vbtyp_n = '5' OR vbtyp_n = 'i' ) .

what wrong with this sql stametment vbtyp_n = 'i' is not comming only '5' is comming

if i remove breaket then it going to display both for i, and 5 but all the 'i' from table near about 2000 of 'i' its fetching...

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Try if u r getting any result for the below query

if no there is no data in ur table with vbtyp_n = 'i' which satisfies other conditions also

SELECT vbelv posnv vbeln posnn vbtyp_n rfmng meins plmin erdat bwart
FROM vbfa
INTO TABLE it_vbfa
FOR ALL ENTRIES IN it_ekbe_del
WHERE vbelv = it_ekbe_del-belnr
AND vbeln IN pr_vbel2
AND posnn = it_ekbe_del-ebelp
AND vbtyp_n = 'i' .

4 REPLIES 4

former_member404244
Active Contributor
0 Kudos

Hi,

it seems the query is correct

try like this

AND ( vbtyp_n = '5' OR vbtyp_n = 'I' ) .

small I is for goods receipt and big I is for order w/o change..

Regards,

Nagaraj

Former Member
0 Kudos

Try if u r getting any result for the below query

if no there is no data in ur table with vbtyp_n = 'i' which satisfies other conditions also

SELECT vbelv posnv vbeln posnn vbtyp_n rfmng meins plmin erdat bwart
FROM vbfa
INTO TABLE it_vbfa
FOR ALL ENTRIES IN it_ekbe_del
WHERE vbelv = it_ekbe_del-belnr
AND vbeln IN pr_vbel2
AND posnn = it_ekbe_del-ebelp
AND vbtyp_n = 'i' .

Former Member
0 Kudos

no its right small 'i' for Good Receipt

0 Kudos

SELECT vbelv posnv vbeln posnn vbtyp_n rfmng meins plmin erdat bwart

FROM vbfa

INTO TABLE it_vbfa

FOR ALL ENTRIES IN it_ekbe_del

WHERE vbelv = it_ekbe_del-belnr

AND vbeln IN pr_vbel2

AND posnn = it_ekbe_del-ebelp

AND VBTYP_N IN ( '5' , 'i' ) .

use this query.i think it helps u.

regards,

sastry