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: 

Report which gives list of materials

Former Member
0 Kudos

Hi All,

I am about to write a report which gives the list of materials.

Foe\r that I want to know the relations between the tables

MARA

MAKT

MARC

MARM

MVKE

Its a little bit urgent

Edited by: ravee indra on Mar 21, 2008 1:57 PM

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

check this link for their relationship.

All the tables u have mentioned have matnr as primary key so u can use it.

http://www.erpgenie.com/abap/tables_mm.htm

MARA General Data, material type, group,

configurable & batch ind.

MAKT Short Texts, descriptions

MARM Conversion Factors

MVKE Sales Org, distribution channel

MARC classification

Regards

2 REPLIES 2

Former Member
0 Kudos

Hi,

check this link for their relationship.

All the tables u have mentioned have matnr as primary key so u can use it.

http://www.erpgenie.com/abap/tables_mm.htm

MARA General Data, material type, group,

configurable & batch ind.

MAKT Short Texts, descriptions

MARM Conversion Factors

MVKE Sales Org, distribution channel

MARC classification

Regards

GrahamRobbo
Active Contributor
0 Kudos

Hi Ravee,

umm...I'm a little reluctant to give you this advice as it sounds a bit like a rant, so please accept it in the spirit it is intended.

You do not need to know anything about the data model to get a list of materials.

Way back when ABAP was a boy, knowing which tables held which data and the relationships between them was a key ABAP developer skill. It does not need to be now.

(Yes I know this is not an absolute truth - no flame wars please guys.)

As a general rule all SAP backend business functionality is exposed via standard and open interfaces. These interfaces can take several forms, but in general they are implemented using remote-enabled function modules.

In the case of materials (and most of the old ERP functionality) SAP has "modeled" business objects inside the Business Object Repository (BOR). These models include the data model itself, but also include methods to interact with the model in the form of Business Object Application Programming Interfaces (BAPI's). These BAPI's are implemented as remote-enabled function modules.

You can use these interfaces to interact with the backend data and be comfortable that SAP will (generally) not change these interfaces. So even if an upgrade makes major changes in the data model the BAPI's should still work as before.

So taking your example of wanting a list of materials. If you go to the BAPI Explorer, transaction BAPI , and use either the hierarchical or alphabetic navigator to find the Business Object called "Material" you will see it has a number of methods.

One of these methods is called GetList and if you double-click on it you will see that it provides a List of Materials with Description. You can display the documentation for the method which shows you to call the method, and in the Detail tab you can see that the method is implemented as a function module called BAPI MATERIALGETLIST. You can even double-click on the function module and to go to the Function Builder where you can test the method.

If you place these entries in the MATNRSELECTION data structure...

 
MATNRSELECTION-SIGN = 'I'. 
MATNRSELECTION-OPTION = 'CP'. 
MATNRSELECTION-LOW = '*'. 

...and execute the function module it wiull return a complete list of all materials defined in the system in the MATNRLIST itab.

You may find that you want more details about each material, say for example availability. If you go back to the BAPI Explorer you can see there is another method called "Availability" that is implemented using function module BAPI MATERIALAVAILABILITY, and so on....

This is the way you should be looking to do all your development work. Look for the SAP delivered standard interfaces and use them, avoid direct database access as much as possible.

Cheers

Graham Robbo