Give the syntax of Inner,outer Join?"

Answers were Sorted based on User's Feedback



Give the syntax of Inner,outer Join?"..

Answer / navneet

inner join :
select P~<fieldname> d~<fieldname> into corresponding
fields of table <internaltable> from ( <table> as p inner
join <table> as d on <join condition> and <cond>.

outer join:
select P~<fieldname> d~<fieldname> into corresponding
fields of table <internaltable> from ( <table> as p left
outer join <table> as d on <join condition> and <cond>.

Is This Answer Correct ?    29 Yes 3 No

Give the syntax of Inner,outer Join?"..

Answer / shreeshail diggi

Effect
The join syntax represents a recursively nestable join
expression. A join expression consists of a left-hand and a
right- hand side, which are joined either by means of
[INNER] JOIN or LEFT [OUTER] JOIN. Depending on the type of
join, a join expression can be either an inner (INNER) or
an outer (LEFT OUTER) join. Every join expression can be
enclosed in round brackets. If a join expression is used,
the SELECT command circumvents SAP buffering.

The syntax of the join conditions join_cond is the same as
that of the sql_cond conditions after the addition WHERE,
with the following differences:

At least one comparison must be specified after ON.

Individual comparisons may be joined using AND only.

All comparisons must contain a column in the database table
or the view dbtab_right on the right-hand side as an
operand.

The following additions not be used: NOT, LIKE, IN.

No sub-queries may be used.

For outer joins, only equality comparisons (=, EQ) are
possible.

If an outer join occurs after FROM, the join condition of
every join expression must contain at least one comparison
between columns on the left-hand and the right-hand side.

In outer joins, all comparisons that contain columns as
operands in the database table or the view dbtab_right on
the right-hand side must be specified in the corresponding
join condition. In the WHERE condition of the same SELECT
command, these columns are not allowed as operands

Example INNER JOIN :

Join the columns carrname, connid, fldate of the database
tables scarr, spfli and sflight by means of two inner
joins. A list is created of the flights from p_cityfr to
p_cityto. Alternative names are used for every table.

PARAMETERS: p_cityfr TYPE spfli-cityfrom,
p_cityto TYPE spfli-cityto.

DATA: BEGIN OF wa,
fldate TYPE sflight-fldate,
carrname TYPE scarr-carrname,
connid TYPE spfli-connid,
END OF wa.

DATA itab LIKE SORTED TABLE OF wa
WITH UNIQUE KEY fldate carrname connid.

SELECT c~carrname p~connid f~fldate
INTO CORRESPONDING FIELDS OF TABLE itab
FROM ( ( scarr AS c
INNER JOIN spfli AS p ON p~carrid = c~carrid
AND p~cityfrom = p_cityfr
AND p~cityto = p_cityto )
INNER JOIN sflight AS f ON f~carrid = p~carrid
AND f~connid = p~connid ).

LOOP AT itab INTO wa.
WRITE: / wa-fldate, wa-carrname, wa-connid.
ENDLOOP.

Example OUTER JOIN:

PARAMETERS p_cityfr TYPE spfli-cityfrom.

DATA: BEGIN OF wa,
carrid TYPE scarr-carrid,
carrname TYPE scarr-carrname,
connid TYPE spfli-connid,
END OF wa,
itab LIKE SORTED TABLE OF wa
WITH NON-UNIQUE KEY carrid.

SELECT s~carrid s~carrname p~connid
INTO CORRESPONDING FIELDS OF TABLE itab
FROM scarr AS s
LEFT OUTER JOIN spfli AS p ON s~carrid = p~carrid
AND p~cityfrom =
p_cityfr.

LOOP AT itab INTO wa.
IF wa-connid = '0000'.
WRITE: / wa-carrid, wa-carrname.
ENDIF.
ENDLOOP.

Thank's and Regards,
Shreeshail Diggi
SAP Technical Consultant Infinite India

Is This Answer Correct ?    12 Yes 1 No

Give the syntax of Inner,outer Join?"..

Answer / ravi ranjan

*&-----------------------------------*
*& Report ZSELECT_STA *
*& *
*&-----------------------------------*
*& Author : Ravi Ranajn upadhyay *
*& *
*&-----------------------------------*

REPORT zselect_sta.
TABLES: mara.
TYPES:BEGIN OF it_mara,
ernam TYPE mara-ernam,
matnr TYPE mara-matnr,
meins TYPE mara-meins,
burks TYPE ekpo-bukrs,
werks TYPE ekpo-werks,
END OF it_mara.

DATA:its_mara TYPE TABLE OF it_mara,
wa_mara TYPE it_mara.

SELECT m~matnr m~ernam m~meins k~werks k~bukrs
INTO CORRESPONDING FIELDS OF TABLE its_mara
FROM mara AS m inner JOIN ekpo AS k
ON m~matnr = k~matnr.


LOOP AT its_mara INTO wa_mara.
WRITE: / wa_mara-ernam,
wa_mara-matnr,
wa_mara-meins,
wa_mara-burks,
wa_mara-werks.
ENDLOOP.

Is This Answer Correct ?    9 Yes 0 No

Give the syntax of Inner,outer Join?"..

Answer / ravi ranjan

syntax of inner join:-
select t1~field1 t1~field2 t2~field3 t3~field4
INTO CORRESPONDING FIELD OF TABLES <INTERNAL TABLE>
FROM TABLE1 AS t1 inner join table2 as t2 on
t1~field1(key field) = t2~field2(key field).

Is This Answer Correct ?    9 Yes 1 No

Give the syntax of Inner,outer Join?"..

Answer / venumadhav

suppose tables LFA1 ,EKKO.

select a~lifnr a~name1 a~ort01
b~ebeln b~ebelp
from a as LFA1 inner join b as EKKO on
a~lifnr = b~lifnr.

Is This Answer Correct ?    22 Yes 17 No

Give the syntax of Inner,outer Join?"..

Answer / ravi kanth

@ Shreeshail Diggi
Your answer is Awesome.
Good Conceptual Answer.
Thanks to all others posts as well.

Is This Answer Correct ?    0 Yes 1 No

Give the syntax of Inner,outer Join?"..

Answer / lal bahadur sharma

SELECT c~carrname p~connid f~fldate
INTO CORRESPONDING FIELDS OF TABLE itab

Is This Answer Correct ?    1 Yes 6 No

Post New Answer

More SAP ABAP Interview Questions

How do you find if a logical database exists for your program requrements?

0 Answers  


Write the bdc table structure? : abap bdc

0 Answers  


Is there Any Module in SAP for Internal Audit?

1 Answers  


in start of selection if we perform validation ,what happens?

2 Answers   Bristle Cone, Cap Gemini, HP, Satyam, Wipro,


What is generic area buffering in abap?

0 Answers  






What are client dependant objects in abap/sap?

0 Answers  


What is the table buffer?

0 Answers  


What are Change header/detail tables? Have you used them?

1 Answers  


Advantages and disadvantages of different types of bdc's?

0 Answers  


How to create secondary index ?

2 Answers  


Tell me a scenario where did you use secondary index?

0 Answers  


Difference between inner join and outer join in abap

1 Answers  


Categories
  • SAP Basis Interview Questions SAP Basis (1262)
  • SAP ABAP Interview Questions SAP ABAP (3939)
  • SAPScript Interview Questions SAPScript (236)
  • SAP SD (Sales & Distribution) Interview Questions SAP SD (Sales & Distribution) (2716)
  • SAP MM (Material Management) Interview Questions SAP MM (Material Management) (911)
  • SAP QM (Quality Management) Interview Questions SAP QM (Quality Management) (99)
  • SAP PP (Production Planning) Interview Questions SAP PP (Production Planning) (523)
  • SAP PM (Plant Maintenance) Interview Questions SAP PM (Plant Maintenance) (252)
  • SAP PS (Project Systems) Interview Questions SAP PS (Project Systems) (138)
  • SAP FI-CO (Financial Accounting & Controlling) Interview Questions SAP FI-CO (Financial Accounting & Controlling) (2766)
  • SAP HR (Human Resource Management) Interview Questions SAP HR (Human Resource Management) (1180)
  • SAP CRM (Customer Relationship Management) Interview Questions SAP CRM (Customer Relationship Management) (432)
  • SAP SRM (Supplier Relationship Management) Interview Questions SAP SRM (Supplier Relationship Management) (132)
  • SAP APO (Advanced Planner Optimizer) Interview Questions SAP APO (Advanced Planner Optimizer) (92)
  • SAP BW (Business Warehouse) Interview Questions SAP BW (Business Warehouse) (896)
  • SAP Business Workflow Interview Questions SAP Business Workflow (72)
  • SAP Security Interview Questions SAP Security (597)
  • SAP Interfaces Interview Questions SAP Interfaces (74)
  • SAP Netweaver Interview Questions SAP Netweaver (282)
  • SAP ALE IDocs Interview Questions SAP ALE IDocs (163)
  • SAP Business One Interview Questions SAP Business One (110)
  • SAP BO BOBJ (Business Objects) Interview Questions SAP BO BOBJ (Business Objects) (388)
  • SAP CPS (Central Process Scheduling) Interview Questions SAP CPS (Central Process Scheduling) (14)
  • SAP GTS (Global Trade Services) Interview Questions SAP GTS (Global Trade Services) (21)
  • SAP Hybris Interview Questions SAP Hybris (132)
  • SAP HANA Interview Questions SAP HANA (700)
  • SAP PI (Process Integration) Interview Questions SAP PI (Process Integration) (113)
  • SAP PO (Process Orchestration) Interview Questions SAP PO (Process Orchestration) (25)
  • SAP BI (Business Intelligence) Interview Questions SAP BI (Business Intelligence) (174)
  • SAP BPC (Business Planning and Consolidation) Interview Questions SAP BPC (Business Planning and Consolidation) (38)
  • SAP BODS (Business Objects Data Services) Interview Questions SAP BODS (Business Objects Data Services) (49)
  • SAP BODI (Business Objects Data Integrator) Interview Questions SAP BODI (Business Objects Data Integrator) (26)
  • SAP Ariba Interview Questions SAP Ariba (9)
  • SAP Fiori Interview Questions SAP Fiori (45)
  • SAP EWM (Extended Warehouse Management) Interview Questions SAP EWM (Extended Warehouse Management) (58)
  • Sap R/3 Interview Questions Sap R/3 (150)
  • SAP FSCM Financial Supply Chain Management Interview Questions SAP FSCM Financial Supply Chain Management (101)
  • SAP WM (Warehouse Management) Interview Questions SAP WM (Warehouse Management) (31)
  • SAP GRC (Governance Risk and Compliance) Interview Questions SAP GRC (Governance Risk and Compliance) (64)
  • SAP MDM (Master Data Management) Interview Questions SAP MDM (Master Data Management) (0)
  • SAP MRS (Multi Resource Scheduling) Interview Questions SAP MRS (Multi Resource Scheduling) (0)
  • SAP ESS MSS (Employee Manager Self Service) Interview Questions SAP ESS MSS (Employee Manager Self Service) (13)
  • SAP CS (Customer Service) Interview Questions SAP CS (Customer Service) (0)
  • SAP TRM (Treasury and Risk Management) Interview Questions SAP TRM (Treasury and Risk Management) (0)
  • SAP Web Dynpro ABAP Interview Questions SAP Web Dynpro ABAP (198)
  • SAP IBP (Integrated Business Planning) Interview Questions SAP IBP (Integrated Business Planning) (0)
  • SAP OO-ABAP (Object Oriented ABAP) Interview Questions SAP OO-ABAP (Object Oriented ABAP) (70)
  • SAP S/4 HANA Finance (Simple Finance) Interview Questions SAP S/4 HANA Finance (Simple Finance) (143)
  • SAP FS-CD (Collections and Disbursements) Interview Questions SAP FS-CD (Collections and Disbursements) (0)
  • SAP PLM (Product Lifecycle Management) Interview Questions SAP PLM (Product Lifecycle Management) (0)
  • SAP SuccessFactors Interview Questions SAP SuccessFactors (33)
  • SAP Vistex Interview Questions SAP Vistex (0)
  • SAP ISR (IS Retail) Interview Questions SAP ISR (IS Retail) (28)
  • SAP IdM (Identity Management) Interview Questions SAP IdM (Identity Management) (0)
  • SAP IM (Investment Management) Interview Questions SAP IM (Investment Management) (0)
  • SAP UI5 Interview Questions SAP UI5 (59)
  • SAP SCM (Supply Chain Management) Interview Questions SAP SCM (Supply Chain Management) (51)
  • SAP XI (Exchange Infrastructure) Interview Questions SAP XI (Exchange Infrastructure) (49)
  • SAP Cloud Platform Interview Questions SAP Cloud Platform (34)
  • SAP Testing Interview Questions SAP Testing (89)
  • SAP SolMan (Solution Manager) Interview Questions SAP SolMan (Solution Manager) (63)
  • SAP MaxDB Interview Questions SAP MaxDB (116)
  • SAP GUI Interview Questions SAP GUI (15)
  • SAP AllOther Interview Questions SAP AllOther (329)