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

ABAP code for enhancement from multiple tables

Former Member
0 Likes
565

Hello Folks,

I have 0CUSTOMER_ATTR to which i've appended 4 zfields which corresponds to 4 fields from 3 tables. I need to write the ABAP code for enhancement. The question is "What is the syntax for a single Select statement to choose fields from Multiple tables"

for ex.

select single * from knvv,knvp,knvb1 where kunn2 = s_tab-kunnr and knvv-kunnr = s_tab-kunnr and knvp-kunnr = s_tab-kunnr and knb1-kunnr = s_tab-kunnr

what will be the equivalent of the above in ABAP. Is this feasible? or would it be better to use views and then load the data?

I would appreciate your response!

Hello Folks,

I have 0CUSTOMER_ATTR to which i've appended 4 zfields which corresponds to 4 fields from 3 tables. I need to write the ABAP code for enhancement. The question is "What is the syntax for a single Select statement to choose fields from Multiple tables"

for ex.

select single * from knvv,knvp,knvb1 where kunn2 = s_tab-kunnr and knvv-kunnr = s_tab-kunnr and knvp-kunnr = s_tab-kunnr and knb1-kunnr = s_tab-kunnr

what will be the equivalent of the above in ABAP. Is this feasible? or would it be better to use views and then load the data?

I would appreciate your response!

2 REPLIES 2
Read only

Former Member
0 Likes
517

You can do this usign the concept of Joins. Using Joins you can read data from multiple tables in a single shot.

- Guru

Read only

Former Member
0 Likes
517

You can use inner joins

http://www.sap-img.com/abap/inner-joins.htm

Regards

Kathirvel