Application Development and Automation 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: 
Read only

Syncing 3 tables and fields

Former Member
0 Likes
543

Hi,

I have a requirement where i need to display several fields from marc.

However, the material number (MARA-MATNR) and the description (MAKT-MAKTX) also have to be shown.

How do i sync all 3 tables and populate the correct data? I know that they are all connected by MATNR.

I don't want to filter any data. All data from MARC should should show up, but with those fields filled

in as well, in reference to there specific record.

Either you can use join on the three tables.

OR

Select all MATNR from MARA.

SELECT all MAKTX from MAKT for all entries in MARA.

SELECT fields from MARC for all entries in MARC..

Regards,

Amit

2 REPLIES 2
Read only

amit_khare
Active Contributor
0 Likes
487

Either you can use join on the three tables.

OR

Select all MATNR from MARA.

SELECT all MAKTX from MAKT for all entries in MARA.

SELECT fields from MARC for all entries in MARC..

Regards,

Amit

Read only

Former Member
0 Likes
487

you could get matnr from marc itself. if no other field is required from mara, you could acheive this using marc and maktx.

select * from marc into corresponding fields of table t_marc.

if not t_marc[] is initial.

select matnr from mara into table t_mara for all entries in t_marc where

matnr = t_marc-matnr.

select matnr maktx from makt into table t_makt for all entries in t_mara where

matnr = t_mara-matnr.

endif.

loop at t_marc.

read table t_matnr with key matnr = t_marc-matnr.

if sy-subrc = 0.

move t_mara-field to t_marc-field.

endloop.