Hi in my requirement i want to get the o/p which contains the fields bukrs,belnr,gjahr,koart,shkzg,anln2,bzdat and also waers and hwae2.All the fields are present in bseg table except the 2 fields waers and hwae2.For the field dmbtr the ref field is waers and for the field BDIF2 the ref field is hwae2.How to write the select query to fetch these 2 fields.Please help
Eric Cartman replied
> select bsegbukrs......bsegbzdat <tablename>waers <tablename>haew2 into table itab from bseg inner join table <tablename> on condition
> where input condition also u need to mention
> hope this will help u
unfortunately it won't...
BSEG is cluster table, which means you cannot use in JOIN
waers and hwae2 will come from BKPF table: you either select from BSEG and BKPF in two separate steps (and merge the data later into one internal table) or instead of BSEG you can join BSIS/BSAS, BSID/BSAD, BSIK/BSAK (depending on your exact needs) with BKPF.