- select --distinct LPBELNR,
- *
- --BPSTUECK,
- --aranummer,
- --BPPOSNR,
- from mention.dbo.ael ael
- left join mention.dbo.AELLIEF lief on ael.ARIDNR=lief.ALIDNR and lief.ALMANKEY=1
- left join mention.dbo.BESTLP kp on ael.ARIDNR=kp.LPBELNR and kp.LPMANKEY=1
- left join mention.dbo.BESTLK rk on kp.LPBELNR=rk.LBBELNR
- where lief.ALLNUMMER='71000001'
- --and BSBELTYP='B' and bsoffen<>'R'