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: 

how to get different field in two are more different table using open sql

former_member502409
Discoverer
0 Kudos
62

Dear all,

This SenthilMani am very new into sap abap am having doubt in reports how get the different fields from different tables like mara,marc,mard using open sql and native sql program give me some tips to get the data .

with regards,

senthil

2 REPLIES 2

Former Member
0 Kudos
31

Hi,

Please go through TCODE:- ABAPDOCU->BC-ABAP Programming->ABAP Database access., which will give some sample code.

Please search the in the SDN before you post, there alots of info available already.

Close the thread, if solved

Regards,

Aditya

Former Member
0 Kudos
31

HI ,

1) If u want to select data from more the two table then u can use FOR ALL ENTRIES.

EX ..Open sql

select matnr from mara into table t_mara.

select matnr werks from marc into table t_marc for all entries in t_mara where matnr = t_mara-matnr.

2) U can join more than one table.

ex:

select mara~matnr

marc~werks

from mara join marc into table t_maramarc

on maramatnr = marcmatnr

3) Using native sql ...only u can use JOIN statement