JOINS
JOINS
INNER JOIN:
1. In this join only the matching records between the tables will be fetched.
2. The unmatched records are not selected.
OUTER JOIN:
1. In this join all the records from the first table or left table will be selected
first.
2. If there are any matching records from second, third tables, then the data
will be displayed.
3. Suppose if there are no matching records, the data will be displayed as
blank from second and third tables.
SYNTAX:
Select T1~F1
T1~F2
T2~F1
T2~F2
T3~F1
T3~F2
where <condition>.
ZCUST_DATA ZCUST_BANKDATA
Joined on ZCUST_DATA~CNO
ZCUST_BANKDATA~CNO
SELECT mara~matnr
mara~mtart
mara~mbrsh
mara~meins
makt~spras
makt~maktx
INTO TABLE i_mara_makt
FROM mara AS mara INNER JOIN makt AS makt
ON mara~matnr = makt~matnr
WHERE mara~mtart = 'FERT'
AND makt~spras = 'EN' .
LOOP AT i_mara_makt INTO wa_mara_makt.
WRITE : / wa_mara_makt-matnr ,
wa_mara_makt-mtart COLOR 6,
wa_mara_makt-mbrsh ,
wa_mara_makt-meins ,
wa_mara_makt-spras COLOR 1,
wa_mara_makt-maktx COLOR 1 .
ENDLOOP.
The output is :
Ex on JOINS with 3 Tables
The output is :
Select……For All Entries:
SYNTAX:
Select F1 F2 F3…..
Select F1 F2 F3…..
From <DB.Table2>
Endif.
7. The prerequisite for the above statement is, the first ITAB should
be checked whether it has any data.
8. Suppose if it has data, then for all entries statement will execute
based on the condition and only matching records will be
selected.
9. Suppose if first ITAB is empty then for all entries statement will
fail and all the records will be selected, irrespective of condition.
Finally the first ITAB should be checked for any records using below
statement.
Save->Act->Test.
Third Way: In Real Time, we always move the data into Final Int.Table
Save->Act->Test.
SELECTION SCREEN:
An input screen to a program or report is called selection screen.
PARAMETERS:
SYNTAX:
default ‘X’,
SELECT-OPTIONS:
This statement is used to create two input fields so that the user
can enter a range of values.
All these options are available when you click on multiple selection or
Syntax:
No- Extension.
NOTE:
By default I is stored.
i. The operators are: BT, NB, EQ, NE, LT, LE, GT, and GE.
ii. By default BT is stored..
LOW: Stores lower value from the range entered on selection screen.
HIGH: Stores higher value from the range entered on selection screen.
SELECTION SCREEN MISCELLANEOUS COMMANDS:
Ex on selection-screen commands:
Selection-screen uline.
Parameters: p_land1 type kna1-land1.
Selection-screen skip.