Application Development 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: 

selecting fields from 2 different tables with single select query..

Former Member
0 Kudos

hi...

can we select fields from two different tables in a single select query... under some where condition for both the tables...

the same thing can be done in sql what about in abap...

thanks...

1 ACCEPTED SOLUTION

abdul_hakim
Active Contributor
0 Kudos

Hi Naveen,

You can do in ABAP Very well using Joins...

eg.

SELECT a~kunnr

a~name1

b~pernr

INTO TABLE itab

FROM kna1 AS a

INNER JOIN knvk AS b

ON akunnr = bkunnr.

2 REPLIES 2

Former Member
0 Kudos

Yes,

By using joins we can select feilds from 2 different tables, criteria is the tables must have a common key amontg them.

Regards,

Raghav

abdul_hakim
Active Contributor
0 Kudos

Hi Naveen,

You can do in ABAP Very well using Joins...

eg.

SELECT a~kunnr

a~name1

b~pernr

INTO TABLE itab

FROM kna1 AS a

INNER JOIN knvk AS b

ON akunnr = bkunnr.