‎2008 May 29 10:53 AM
Hi Gurus,
What is Purpose of Joint Command Using Internal Table. how many type in join. briefly Explain.
regards,
JH
‎2008 May 29 12:01 PM
Assuming that Joint was a typo..
I've never seen or heard of a JOIN command used on an internal table.
However it is used frequently in a SELECT statement for reading DB Tables.
Like this
SELECT * INTO CORRESPONDING FIELDS OF TABLE it_mska
FROM mara AS a
JOIN marc AS b ON a~matnr = b~matnr.
‎2008 May 29 12:14 PM
‎2008 May 29 12:27 PM
Hi,
v use join to club the data into one internal table from multiple tables..
but using join is not a performance intensive...so we use it if we are to join 2 or max 3 tables...
simply its a cartesian product which joins the two tables...based on a key.
for example, we fetch the data from iflot and iflo tables and put into out_tab say then,
SELECT i~tplnr
f~pltxt
i~invnr
i~objnr
i~erdat
i~fltyp
i~iwerk
INTO TABLE out_tab
FROM ( ( ( iflot AS i INNER JOIN iflo AS f ON ftplnr = itplnr )
WHERE itplnr IN s_tplnr AND ifltyp IN s_fltyp AND i~objnr IN s_objnr.
plz revert if any clarifications required.
regards.
‎2008 May 29 1:11 PM
Table joins are 2 types:
1. Inner join
2.Left Outer Join
Joins r used to take the data from tables....max is 3.
but these r not used because of performance
Ex:
2 tables having data
Emp table: Dept.Table:
ID NAME ID DEPT
1 A 1 D1
2 B 1 D2
3 C 3 D1
4 D 4 D1
4 D3
SELECT A~ID
A~NAME
B~DEPT
FROM EMP as A INNERJOIN DEPT as B
on AID = BID
INTO table ITAB.
output:
INNERJOIN:((ONLY MATCHING ENTRIES)
1-A-D1
1-A-D2
3-C-D1
4-D-D1
4-D-D3
OUTERJOIN:(ALL ENTRIES)
1-A-D1
1-A-D2
2-B-
3-C-D1
4-D-D1
4-D-D3
reward if helpful
regards
GIRI
‎2008 May 29 1:19 PM
Hi,
Why not try to use help.sap.com or your F1 online help to read about the SELECT statement and JOIN statement. Or search the forums as these questions have been asked over and over and over before.