01-16-2005 2:59 PM
Dear Friends,
I need to prepare a classic report based on the following parameters :
I would like to know, how to join these three tables using Inner Joins - MARA, MARC, MSTA.
I should be able to view the fields from these tables.
I tried out with the common fields from these tables, viz. MARA - MATNR - MARC, MARC - WERKS - MSTA.
I would appreciate, if anyone replies me with the select statement using the above mentioned tables using Inner Joins statement with any common fields .
Thanking you in anticipation.
01-16-2005 6:13 PM
Demo program is available.
demo_select_inner_join
I suggest you also consider using the dictionary.
I found database view MA06V as an example.
You can use these examples and add a join to MSTA from MARA.
Let us know how it goes.
01-17-2005 2:04 PM
01-17-2005 6:57 AM
Dear dinesh kumar
1. We can join the three tables with matnr field.
2. WERKS has to be provided from the program - (plant).
ie. For which plant, data is required.
3. Due to MSTA table, you may get multiple records
for same MATNR. bcos of maintenance records
by different departments in MSTA Table.
If it helps, pls give points.
*----
REPORT abc.
data : begin of itab occurs 0,
matnr like mara-matnr,
"---- Other Fields
end of itab.
data : matnr like mara-matnr.
data : werks like marc-werks.
*----
Query
select a~matnr
into table itab
from mara as a
inner join marc as b
on amatnr = bmatnr
inner join msta as c
on amatnr = cmatnr
*----
Required Conditions From Program
where a~matnr = matnr
and b~werks = werks.
Thanks & Regards,
Amit Mittal.
01-18-2005 7:16 AM
Hi friends,
I really donot feel this is something that was needed to be posted on the forum, was it?
The query could be formed using the ABAP f1 help too. Also the requirements were best known by dinesh.
All he had to do was try out a few options which best suited his requirements.
Same about reply like 'Let me check and Ill get back'.
Regards,
Amit Trivedi.