Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

give syntax of inner join. with example program

give syntax of inner join. with example program

Tags:
Former Member
replied

hi,

SYNTAX:

Select tab1field1 tab2field2

into table t_table

from tab1

inner join tab2

on tab1field1 = tab2field2

where field1 in s_field1.

copy paste the below program..

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 ccarrname pconnid f~fldate

INTO CORRESPONDING FIELDS OF TABLE itab

FROM ( ( scarr AS c

INNER JOIN spfli AS p ON pcarrid = ccarrid

AND p~cityfrom = p_cityfr

AND p~cityto = p_cityto )

INNER JOIN sflight AS f ON fcarrid = pcarrid

AND fconnid = pconnid ).

LOOP AT itab INTO wa.

WRITE: / wa-fldate, wa-carrname, wa-connid.

ENDLOOP.

rewards if useful,

regards,

'Nazeer'

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question