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: 

For all entries in select query

Former Member
0 Kudos

Hi Guys,

I am fetching the BUKRS GJAHR BELNR and BUZEI from BSEG table, using for all entires of BSEG data, i am getting the data from BSID table.

But in BSID table, i have duplicate records, those records i am not able to get.

Could you please suggest me, is any wrong in my code. Please sugest is any other way to get the data.

SELECT bukrs

belnr

gjahr

buzei

xref1 INTO TABLE it_bseg

FROM bseg

WHERE bukrs = p_bukrs

AND gjahr IN s_gjahr

AND xref1 IN s_xref1.

SORT it_bseg BY bukrs gjahr belnr buzei.

SELECT bukrs

kunnr

zuonr

gjahr

belnr

budat

bldat

xblnr

blart

dmbtr

shkzg INTO TABLE it_bsid

FROM bsid

FOR ALL ENTRIES IN it_bseg

WHERE bukrs = it_bseg-bukrs

AND belnr = it_bseg-belnr

AND gjahr = it_bseg-gjahr

AND buzei = it_bseg-buzei

AND blart IN r_blart.

Thanks

Gourisankar.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

This is a FAQ. FOR ALL ENTRIES eliminates duplicates. Press F1 on SELECT and look at FOR ALL ENTRIES.

Rob

4 REPLIES 4

Former Member
0 Kudos

This is a FAQ. FOR ALL ENTRIES eliminates duplicates. Press F1 on SELECT and look at FOR ALL ENTRIES.

Rob

Former Member
0 Kudos

Hi Sankar,

if there are duplicates entries select statement will omit those records. try to include fields in the select statement which makes the selected record different from other atleast by one field.

cheers!!

0 Kudos

Hi Guys,

I know that For all entries will eliminate the duplicate entries, is any way can i get the duplicate entries using for all entries.

thanks,

Gourisankar.

0 Kudos

Thanks gusy, after passing different filed, i could able to get ncessary thanks.