‎2007 May 02 11:15 AM
Hi all,
Is There any Function Module which modifys the table MARC.
please suggest.
regards,
chandra.
‎2007 May 02 11:29 AM
‎2007 May 02 11:21 AM
Hi ,
Which feild do you want to update in MARC , as there are many FM which update the table MARC , but they update specific feilds only e.g. KE_PRCTR_MARC_UPDATE.
To get a list of similar FM enter MARC in SE37 and search for the list of FM.
Regards
Arun
‎2007 May 02 11:23 AM
Hi Arun,
i need to modify field VINT2.
please suggest.
regards,
reddy.
‎2007 May 02 11:27 AM
Hi ,
I did not find any FM updating the said feild , why dont you use the UPDATE or SET Command for the same.
Regards
Arun
‎2007 May 02 11:26 AM
Instead of using function module for modifying a single field you can use the statement
modify marc using <internmal table> transporintg <that fieldname>
keep this inside a loop .
and this will modify the db table marc .. only thefield you want to modify accoring to you internal table...
Regards,
Jayant.
please award if helpful
‎2007 May 02 11:29 AM
Hello Chandra
The suggestion proposed by Jayant is - by far - the worst way of dealing with any master data.
Regards
Uwe
‎2007 May 02 11:26 AM
HI,
I dont know exactly but try using FM "MARC_MODIFY_BY_RQGRP_DB"..
or use Modify statement
Modify MARC using the filed name you want to
rewards if useful
regards,
nazeer
Message was edited by:
nazeer shaik
‎2007 May 02 11:27 AM
Hello Chandra
Since you want to update material master data you should use the appropriate <b>BAPI</b>. If you are dealing with "normal" materials then you can use <b>BAPI_MATERIAL_SAVEDATA </b>(IMPORTING parameter PLANTDATA). For retail related material you probably need to use the retail-related BAPI.
In general you should use BAPIs for modifying master data because the BAPIs check very scrupulous whether all incoming data are consistent. Furthermore, if updating of additional tables is required the BAPI will take care of this.
Regards
Uwe
‎2007 May 02 11:53 AM
hello Uwe,
Thank you for your suggestion.
i tried with BAPI_MATERIAL_SAVEDATA but i am getting run time errors.
under headdata what i have to specify???
could u please suggest.
thanks,
chandra.
‎2007 May 02 11:58 AM
Hello Reddy,
Check this sample code:
*&---------------------------------------------------------------------*
*& Report ZYTEST02 *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*
report zytest02 .
parameters:matnr like bapimathead-material,
maktx like bapi_makt-matl_desc default 'Mat. autm. AE',
werks like bapi_marc-plant,
vkorg like bapi_mvke-sales_org,
vtweg like bapi_mvke-distr_chan.
start-of-selection.
perform material_create using matnr
maktx
werks
vkorg
vtweg.
*&---------------------------------------------------------------------*
*& Form material_create
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_MATERIAL text
*----------------------------------------------------------------------*
form material_create using value(p_matnr)
value(p_maktx)
value(p_werks)
value(p_vkorg)
value(p_vtweg).
tables: mara.
* shift p_matnr right deleting trailing space.
* translate p_matnr using ' 0'.
data: headdata like bapimathead occurs 0 with header line.
data: clientdata like bapi_mara.
data: clientdatax like bapi_marax.
data: salesdata like bapi_mvke.
data: salesdatax like bapi_mvkex.
data: plantdata like bapi_marc.
data: plantdatax like bapi_marcx.
data: return like bapiret2.
data: taxclassifications like bapi_mlan occurs 0 with header line.
data: commitmessages like bapi_matreturn2 occurs 0 with header line.
data: returnmessages like bapiret2 occurs 0 with header line.
data: materialdescription like bapi_makt occurs 0 with header line.
data: charx value 'X'.
* Kopfdaten
headdata-material = p_matnr.
headdata-matl_type = 'FERT'.
headdata-ind_sector = 'M'.
* Sichten die gepflegt werden sollen
headdata-basic_view = charx. "Sicht auf Grunddaten
headdata-sales_view = charx. "Sicht auf Vertriebsdaten
* Daten für die Sicht GRUNDDATEN 1
materialdescription-langu = sy-langu.
materialdescription-matl_desc = p_maktx.
append materialdescription.
*---------------------------------------------------------------------*
* Mandantenspezifische Materialdaten
*---------------------------------------------------------------------*
clientdata-base_uom = 'ST'.
clientdatax-base_uom = charx.
*
clientdata-trans_grp = '0001'.
clientdatax-trans_grp = charx.
*---------------------------------------------------------------------*
* Materialdaten auf Werksebene
*---------------------------------------------------------------------*
plantdata-plant = p_werks.
plantdatax-plant = p_werks.
plantdata-loadinggrp = '0001'.
plantdatax-loadinggrp = charx.
*---------------------------------------------------------------------*
* Verkaufsdaten
*---------------------------------------------------------------------*
salesdata-sales_org = p_vkorg.
salesdatax-sales_org = p_vkorg.
salesdata-distr_chan = p_vtweg.
salesdatax-distr_chan = p_vtweg.
*---------------------------------------------------------------------*
* Steuerklassifikation
*---------------------------------------------------------------------*
taxclassifications-depcountry = 'DE'.
taxclassifications-tax_type_1 = 'MWST'.
taxclassifications-taxclass_1 = '1'.
append taxclassifications.
call function 'BAPI_MATERIAL_SAVEDATA'
exporting
headdata = headdata
clientdata = clientdata
clientdatax = clientdatax
plantdata = plantdata
plantdatax = plantdatax
* FORECASTPARAMETERS =
* FORECASTPARAMETERSX =
* PLANNINGDATA =
* PLANNINGDATAX =
* STORAGELOCATIONDATA =
* STORAGELOCATIONDATAX =
* VALUATIONDATA =
* VALUATIONDATAX =
* WAREHOUSENUMBERDATA =
* WAREHOUSENUMBERDATAX =
salesdata = salesdata
salesdatax = salesdatax
* STORAGETYPEDATA =
* STORAGETYPEDATAX =
importing
return = return
tables
materialdescription = materialdescription
* UNITSOFMEASURE =
* UNITSOFMEASUREX =
* INTERNATIONALARTNOS =
* MATERIALLONGTEXT =
taxclassifications = taxclassifications
returnmessages = returnmessages
* PRTDATA =
* PRTDATAX =
* EXTENSIONIN =
* EXTENSIONINX =
.
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = charx
importing
return = commitmessages.
* commit work and wait.
* Für den Fall das es notwendig wird die Exclusive Sperre wegräumen
CALL FUNCTION 'DEQUEUE_EMMARAE'
EXPORTING
matnr = p_matnr.
* if return-type ne 'S'.
format color col_negative.
loop at returnmessages.
write: / returnmessages-message.
endloop.
* endif.
loop at commitmessages.
write: / commitmessages-message.
endloop.
endform. " material_create
If useful reward.
Vasanth
‎2007 May 02 11:29 AM
‎2007 May 16 6:41 AM