Skip to Content
0
Former Member
May 21, 2010 at 02:59 PM

For all entries in select query

63 Views

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.