‎2007 Mar 14 11:37 PM
Hi all,
I have got 3 tables to select data from, how can I join them, and also need to check a field on each table,get the total count of the records!
Regards,
Bharat
‎2007 Mar 15 1:45 AM
Here is how you Join 3 tables.
MARA. MAKT, MARC are the tables to join.
select amatnr baedat bmaktx cwerks
from ( mara as a inner join makt as b
on bmatnr = amatnr )
inner join marc as c
on cmatnr = amatnr
into table itab.
For joining more than two tables, the result set of a join of two tables has to be joined to the third and the same continues for more tables.
To get the total number of records of field, you can use the System defined data object SY-DBCNT after the select statement.
‎2007 Mar 15 12:13 AM
Hi,
Use this to get used to joins:
http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb39c4358411d1829f0000e829fbfe/frameset.htm
To get the total count of the records you can use the system field SY-TABIX.
Hpoe this helps,
Sudhi
‎2007 Mar 15 1:45 AM
Here is how you Join 3 tables.
MARA. MAKT, MARC are the tables to join.
select amatnr baedat bmaktx cwerks
from ( mara as a inner join makt as b
on bmatnr = amatnr )
inner join marc as c
on cmatnr = amatnr
into table itab.
For joining more than two tables, the result set of a join of two tables has to be joined to the third and the same continues for more tables.
To get the total number of records of field, you can use the System defined data object SY-DBCNT after the select statement.
‎2007 Mar 15 1:57 AM
If you have proper key for select then go for join
other wise
make 3 separate select and
use describe command to count.
aRs
‎2007 Mar 15 9:39 PM