10-17-2008 1:06 PM
Hi,
Can anyone post the solution for given below requirement.
I need to update MARA,MARC(some Z fields) tables ,so that I have to first check if there is any record for Plant(werks) = 9700
in both of tables.
Then I have to update both of them based on entries in an internal table where the internal table contains data for both of zfields of mara, marc.
Thanks,
G Sandeep Kumar.
10-17-2008 1:26 PM
Hi sandeep ,
see this sample program to update the standard tables
data: itab type table of bseg WITH HEADER LINE.
select single * from bseg INTO itab WHERE belnr = '0051000004' and BSCHL = '93'.
itab-projk = '00000153'.
modify bseg from itab.
in similar way u can apply to zfields also
10-17-2008 1:26 PM
Hi sandeep ,
see this sample program to update the standard tables
data: itab type table of bseg WITH HEADER LINE.
select single * from bseg INTO itab WHERE belnr = '0051000004' and BSCHL = '93'.
itab-projk = '00000153'.
modify bseg from itab.
in similar way u can apply to zfields also
10-17-2008 2:56 PM
Srinivasu - I notice that in this thread and at least one other today, you are showing people how to make direct updates to BSEG.
Modifying data in standard SAP tables and BSEG in particular is a very bad idea. There is a real danger of losing data integrety.
Rob
10-17-2008 1:32 PM
in mara you cannot check for werks.
select matnr werks
from marc as a
join mara as b
on a~matnr = b~matnr
into table it_marc
for all entries in itab_input
where matnr = itab_input-matnr
werks = '9700'.
if you donnot have a itab_input kind of table...
select matnr werks
from marc as a
join mara as b
on a~matnr = b~matnr
into table it_marc
where werks = '9700'.
"materials in it_marc have entries both in MARA and MARC.
you can loop on the it_marc..
loop at it_marc into wa_marc.
modify mara from... transporting...
modify marc from.. transporting...
endloop.