02-19-2010 6:37 AM
Hi Friends,
I want to retrieve data from mara and mseg tables,matnr from mara and menge from mseg but problem is there is no key fields
from these two tables how can i retrieve the data from these two tables?
regards,
bikash
02-19-2010 6:59 AM
Hi,
To retrieve data from two table there is no need to have common key fields. In MSEG you have MATNR field which is key of MARA, so if you have MATNR in your selection you first get all material numbers of your selection and for those material numbers you get material document umbers , using for all entries of MATNR. If you material document number in your selection then get all material document number and get material details for that document number.
Hope this information will help you.
Regards,
Narendra.Soma
02-19-2010 7:09 AM
Hi,
You need to have a common field between 2 tables if you want to put a join between them.
Or otherwise,
Find the check table of the primary keys of the tables.
Try to find the common fields from one of the check tables of the primary keys.
Example,
If you want to join tables A and B.
Both tables don't contain common fields.
A has primary key fields X and Y.
go to check table of X or Y.
Let check table of X is C.
check any field in C which are exist in table B.
Join tables A and C.
Based on this pick the data from B.
Regards,
Prashant
02-22-2010 6:37 AM
Hi Bikash,
Both the tables have MATNR, yes it is not necessary that is should be a primary key. Yes in your case since the table MSEG will have number of entries, Primary key would ease the job but you can do it with out it too.
Selet the data from MARA first and then based on that selection you can retieve data from MSEG. As Narendra suggested 'For all entries' is good option to do so.
Regards.
Amuktha