Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ALV REPORT

Former Member
0 Likes
436

Hai senior's,

Thanks for KT,but i wish to know about selecting fields from different tables(two r three tables).

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
414

1. U can use joins

for help on joins go to F1 help provided

Hai senior's,

Thanks for KT,but i wish to know about selecting fields from different tables(two r three tables).

2 REPLIES 2
Read only

Former Member
0 Likes
414

Hi Saravanan,

Use Inner Joins for that or if it is more than 3 tabeles , use for all entries.

Eg 1: Inner Joins

DATA: DATE LIKE SFLIGHT-FLDATE,

CARRID LIKE SFLIGHT-CARRID,

CONNID LIKE SFLIGHT-CONNID.

SELECT FCARRID FCONNID F~FLDATE

INTO (CARRID, CONNID, DATE)

FROM SFLIGHT AS F INNER JOIN SPFLI AS P

ON FCARRID = PCARRID AND

FCONNID = PCONNID

WHERE P~CITYFROM = 'FRANKFURT'

AND P~CITYTO = 'NEW YORK'

AND F~FLDATE BETWEEN '20010910' AND '20010920'

AND FSEATSOCC < FSEATSMAX.

WRITE: / DATE, CARRID, CONNID.

ENDSELECT.

Eg 2: For all entries

Select fld1 fld2 fld3

from itab1

into table itab2 where fld1 = " ".

if sy-subrc eq 0.

select fld1 fld2 fld3 form itab3 into table itab4 for all entries in itab2

where fld1 = itab2-fld3.

Reward if Useful.

Regards,

Chitra

Read only

Former Member
0 Likes
415

1. U can use joins

for help on joins go to F1 help provided