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: 

Materials for plant

Former Member
0 Kudos

i am using follwoing fields for getting materials combination of plant and distribution channels..

MVKE - Matnr,VKORG,VTWEG

MARC - MATNR,WERKS

how to write code for getting materials mixing of plant and distribution channels.

4 REPLIES 4

Former Member
0 Kudos

Hey MVKE is having plant information also.

Check the filed DWERK. depending on that u can get data.

hey DWERK seems to fail in some conditions. So do one thing.

Get materials from MARC.

Next get data from MVKE using for all entries on MATNR from MARC table.

you will get the combinations.

in this case you will miss entries for which no plant data is there but sales data is available. That is Materials with sales view and no plant view.

if you want that also.. then check for other alternatives.

Message was edited by:

Jyothi

0 Kudos
select matnr werks from marc
into table itab
where matnr in s_matnr and 
          werks in s_werks.

select matnr vkorg vtweg 
from mvke
into table itab2
for all entries in itab
where matnr = itab-matnr.

please reward if useful.

Thanks,

Naveena.

Former Member
0 Kudos

Check this code:

TABLES: mara.

TYPES: BEGIN OF ty_mvke_marc,

matnr TYPE mvke-matnr,

vkorg TYPE mvke-vkorg,

vtweg TYPE mvke-vtweg,

werks TYPE marc-werks,

END OF ty_mvke_marc.

DATA: gt_mvke_marc TYPE TABLE OF ty_mvke_marc.

SELECT-OPTIONS: s_matnr FOR mara-matnr.

SELECT mvke~matnr vkorg vtweg werks

FROM mvke INNER JOIN marc

ON mvkematnr = marcmatnr

INTO TABLE gt_mvke_marc

WHERE mvke~matnr IN s_matnr.

which gives the input of Sales area(Sales org. and Dist. Channel) and its plant data.

Former Member
0 Kudos

using join concept u can collect all the fields from different tables.