‎2007 Jan 29 10:18 AM
Hi abapers,
i want write join condition between two tables (AQGDBBG & AQLQCAT)
can you give me sample coding.
Table AQGDBBG -SAP Query: User Groups
Field NUM - SAP Query (S): Name of a user group
Field BGCNAM - SAP Query (S): Name of user
Table AQLQCAT - SAP Query: Query Catalog
Field NUM -SAP Query (S): Name of a user group
Field QNUM - SAP Query (S): Query name
Thanks in advance.
Regards
Rajendren.P
‎2007 Jan 29 10:23 AM
Hi rajendren,
select a~num
a~bgcnam
b~qnum
INTO TABLE itab
from AQGDBBG as a
join AQLQCAT as b
on bnum eq anum
‎2007 Jan 29 10:25 AM
select anum abgcnam b~qnum into table itab
from aqgdbbg as a inner join aqlacat as b
on anum = bnum.
‎2007 Jan 29 10:32 AM
Joined tables are used in a select statement to combine data from two or more tables that share one or more columns. With Open SQL you can use inner join and left outer join.
Syntax
')'.
If the join is a left outer join the following additional restrictions apply to the search condition:
· The search condition must contain comparison predicates only
· Comparison predicates can only be combined by use of AND
· Each comparison predicate can compare two columns, where the two columns must be from the respective tables that are to be joined. If the left hand side of the join is itself a join, the column reference must not be from a outer table (where outer table is the right table of a left outer join). The comparison predicate can also compare one column reference from a table on the right-hand side of the join with a constant value.
Examples
This graphic is explained in the accompanying text
SELECT employee_name, manager_name
FROM employees AS e JOIN managers AS m
ON e.manager_id = m.manager_id
The INNER JOIN. This query produces a list of all employees that have a manager along with their respective managers. Here, the FROM clause contains an inner join of two tables.
This graphic is explained in the accompanying text
SELECT employee_name, manager_name
FROM employees AS e LEFT OUTER JOIN managers AS m
ON e.manager_id = m.manager_id
The LEFT OUTER JOIN. This query produces a list of all employees along with their respective managers. If an employee does not have a manager, the managers name is NULL. Here, the FROM clause contains an left outer join of two tables.
Hope this clarified your doubt.
‎2007 Jan 29 10:36 AM
Joined tables are used in a select statement to combine data from two or more tables that share one or more columns. With Open SQL you can use inner join and left outer join.
Syntax
The INNER JOIN. This query produces a list of all employees that have a manager along with their respective managers. Here, the FROM clause contains an inner join of two tables.
This graphic is explained in the accompanying text
SELECT employee_name, manager_name
FROM employees AS e LEFT OUTER JOIN managers AS m
ON e.manager_id = m.manager_id
The LEFT OUTER JOIN. This query produces a list of all employees along with their respective managers. If an employee does not have a manager, the managers name is NULL. Here, the FROM clause contains an left outer join of two tables.
Hope this clarified your doubt.