09-08-2008 12:28 PM
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
09-08-2008 1:20 PM
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
but the thing is both table should have a common field with same domain check
and u should now the table name
here all <tablename> are same
09-08-2008 12:54 PM
09-08-2008 12:59 PM
Hi in my o/p i want to fetch waers and hwae2 fields along with some other fields from bseg table.The fields waere and hwae2 is not present in bseg table but when you look in the bseg table these are the fields DMBTR and BDIF2 which contains waers and hwae2 as ref field(inorder to see the ref field you can double click on the fields dmbtr and bdif2.
09-08-2008 1:01 PM
what are the selection parameters so i can add it in the where clause.
09-08-2008 1:10 PM
in the where codn I have to put the report date which I have fetched.Can you please tell the select query part excluding the where codn.
09-08-2008 1:31 PM
09-08-2008 1:08 PM
09-08-2008 1:20 PM
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
but the thing is both table should have a common field with same domain check
and u should now the table name
here all <tablename> are same
09-08-2008 1:23 PM
>
> 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.