Skip to main content

Example:

line belnr bukrs koart

1 12345 d01 K

2 12345 d01 S

3 12345 S01 D

4 12345 S01 S

here my extraction logic should pull only line 2 and not line 4.

SELECT B1.BUKRS, B1.BELNR, B1.GJAHR, B1.KOART,B1.BUZEI, B1.BELNR||B1.BUKRS||B1.GJAHR AS CK1 FROM  BSEG_S B1

JOIN BSEG B2 ON

B1.MANDT = B2.MANDT  and

B1.BUKRS = B2.BUKRS  and

B1.GJAHR = B2.GJAHR  

AND B1.BELNR||B1.BUKRS||B1.GJAHR = B2.BELNR||B2.BUKRS||B2.GJAHR

AND B2.KOART = 'K'

 

The above transformation works. However how to add this join in data extraction?

 

when tried to join bseg within bseg extraction, got this error.

image


Hi,

 

first of all it is not possible to join BSEG with itself within extraction join.

My recommendation is:

 

Instead of extracting the information from BSEG (cluster table) use the transparent tables (BSIK, BSAK, BSIS, BSAS) instead.

 

The last letter of the table name stands for the letter used in KOART

BSIK - Open Vendor Documents

BSAK - Closed Vendor Documents

 

BSID - Open Customer Documents

BSAD - Closed Customer Documents

 

BSIS - Open G/L Items

BSAS - Closed G/L Items

 

So just extract BSIS JOINED with BSIK / BSAK and BSAS with BSIK / BSAK and afterwards use UNION all to create a table containing the data from all extracted tables.

 

BR

Dennis


Hi,

 

first of all it is not possible to join BSEG with itself within extraction join.

My recommendation is:

 

Instead of extracting the information from BSEG (cluster table) use the transparent tables (BSIK, BSAK, BSIS, BSAS) instead.

 

The last letter of the table name stands for the letter used in KOART

BSIK - Open Vendor Documents

BSAK - Closed Vendor Documents

 

BSID - Open Customer Documents

BSAD - Closed Customer Documents

 

BSIS - Open G/L Items

BSAS - Closed G/L Items

 

So just extract BSIS JOINED with BSIK / BSAK and BSAS with BSIK / BSAK and afterwards use UNION all to create a table containing the data from all extracted tables.

 

BR

Dennis

Thanks Dennis. will try as suggested.


Reply