Material Master Update

Hi Abap Experts,
I am facing an issue with an update of material master data when using a Bapi BAPI_MATERIAL_SAVEREPLICA. I am trying to update the below fields
Minlotsize,pl_ti_fince,plnd_delry.
Below is the code which i have used
  LOOP AT it_zcostupdate INTO zcostupdate.
    READ TABLE it_cost_clr INTO wa_cost_clr                 "+JS01
                           WITH KEY lifnr = zcostupdate-lifnr"+JS01
                                    matnr = zcostupdate-matnr."+JS01
    IF sy-subrc EQ 0.                                       "+JS01
      CLEAR wa_headdata.
      wa_headdata-function  = c_upd.
      wa_headdata-material  = zcostupdate-matnr.   "Material
      wa_headdata-mrp_view  = c_x.
      APPEND wa_headdata TO it_headdata.
Plant Data
      CLEAR wa_plantdata.
      wa_plantdata-function   = c_upd.
      wa_plantdata-material   = zcostupdate-matnr. "Material
      wa_plantdata-plant      = zcostupdate-dwerk. "Plant
      wa_plantdata-minlotsize = zcostupdate-bstmi. "Min Lot Size
      wa_plantdata-round_val  = zcostupdate-bstrf. "Rounding Value
      wa_plantdata-pl_ti_fnce = zcostupdate-plifz. "Plnd Delivery Time
      wa_plantdata-plnd_delry = zcostupdate-plifz. "Plnd Delivery Time
      APPEND    wa_plantdata TO it_plantdata.
Plant Data
      CLEAR wa_plantdatax.
      wa_plantdatax-function   = c_upd.
      wa_plantdatax-material   = zcostupdate-matnr. "Material
      wa_plantdatax-plant      = zcostupdate-dwerk. "Plant
      wa_plantdatax-minlotsize = c_x.
      wa_plantdatax-round_val  = c_x.
      wa_plantdatax-pl_ti_fnce = c_x.
      wa_plantdatax-plnd_delry = c_x.
      APPEND    wa_plantdatax TO it_plantdatax.
    ENDIF.                                                  "+JS01
  ENDLOOP.
When Plantdata internal table is not initial proceed with an update.
  IF NOT it_plantdata[] IS INITIAL.
    CALL FUNCTION 'BAPI_MATERIAL_SAVEREPLICA'
      EXPORTING
        noappllog      = 'X'
        nochangedoc    = ' '
        testrun        = ' '
        inpfldcheck    = ' '
      IMPORTING
        return         = wa_return
      TABLES
        headdata       = it_headdata
        plantdata      = it_plantdata
        plantdatax     = it_plantdatax
        returnmessages = it_returnmsg.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
ENDIF.
And later stage i am deleting the messages from the it_returnnmsg table other than error and then displaying the log.
It worked perfectly fine when i have done testing in Development & Quality system with couple of test . But it has not done the same when it went into production and no log is displayed .
And in production it has executed for 24k Materials at the same time. I am Just think that due to mass of material it has executed ,it may have cause a problem in update,But not sure whether this is the issue . I am planning to split into 100 materials update at one time.But if any one have any other solution ,i would be great ful to you.
Thanks in advance.
Cheers
J.

Hi
Check this link
BAPI_MATERIAL_SAVEDATA with custom z-fields

Similar Messages

  • Material Master Update from group routing.

    Dear All,
    When we make material routing. in CA02>scheduling>Results--->Update material master (marking). can be done for the lead time scheduling Purpose. and update in CA96.
    But when we use Group Routing, and assign multiple materials in routing header, and then go for
    CA02>scheduling>Results--->** (no Material Master Update tab Appeared)
    Do we have a solution for this?
    Thanks & regards
    Raghu

    Dear,
    Follow these steps,
    Scheduling in routing (CA02 ) as :
    Call up the operation overview for the routing.
    Choose Extras-- Scheduling -- Schedule.
    You reach the Scheduling dialog box.
    Maintain the data on the dialog box. The system proposes Backward scheduling for the scheduling type.
    Choose Continue.
    You reach the Enter overview variant dialog box  00000001.
    Enter the overview variant you want to use to display the scheduling results. Choose Continue.
    The routing is scheduled. You reach the Schedule Overview screen containing the scheduling data.
    After the scheduling run has been carried out, click on scheduling Result-- update material master
    You use this function to update material master. Go to the CA96 and update material master.
    Please try and come back.
    Regards,
    R.Brahmankar

  • Exit for Material Master UPdate

    Hi Friends,
    could anyone let me know any user exit for Material Master UPdate.
    Thanks in Advance
    Regards

    hi
    good
    MGA00001            Material Master (Industry): Checks and Enhancements
    MGA00002            Material Master (Industry): Number Assignment
    MGA00003            Material Master (Industry and Retail): Number Display
    thanks
    mrutyun^

  • Issue in material master update from presentation server  using BAPI....

    Hi Guru's...
    i am trying to change the material master from presentation server (desktop flat file)
    using BAPI(BAPI_MATERIAL_SAVEDATA) ....
    while executing my program i am getting the message like material had changed...
    but while in mm02 i am un able to fine the updates...
    please find below program logic and correct me if any mistakes....
    thanks in advance...
    *& Report  ZAREPAS36
    REPORT  zarepas36.
    DATA : gs_bapimathead             TYPE  bapimathead,
           gs_clientdata              TYPE  bapi_mara,
           gs_clientdatax             TYPE  bapi_marax.
    TYPES : BEGIN OF gty_itab1,
            matnr(18),
            matkl(9),
            spart(2),
            ntgew(13),
            gewei(3),
            meins(3),
            END OF gty_itab1.
    DATA : gt_itab1 TYPE STANDARD TABLE OF gty_itab1,
           gwa_itab1 TYPE gty_itab1.
    TYPES: BEGIN OF gty_itab2,
           abc(132),
           END OF gty_itab2.
    DATA: gt_itab2 TYPE STANDARD TABLE OF gty_itab2,
          gwa_itab2 TYPE gty_itab2.
    flat file at selection screen
    PARAMETERS: p_files TYPE string.
    CALL METHOD cl_gui_frontend_services=>gui_upload
      EXPORTING
        filename = p_files
        filetype = 'ASC'
      CHANGING
        data_tab = gt_itab2
      EXCEPTIONS
        OTHERS   = 8.
    LOOP AT gt_itab2 INTO gwa_itab2.
      IF gwa_itab2-abc(1) = 'S'.
        gwa_itab1 = gwa_itab2-abc(132).
        APPEND gwa_itab1 TO gt_itab1.
      ENDIF.
    ENDLOOP.
    loop at gt_itab1 into gwa_itab1.
    *Material
    gs_bapimathead-material    = gwa_itab1-matnr.
    *Material details at client data
    *material group.
    gs_clientdata-matl_group = gwa_itab1-matkl.
    gs_clientdatax-matl_group = 'X'.
    *Division
    gs_clientdata-division = gwa_itab1-spart.
    gs_clientdatax-division = 'X'.
    *Net Weight
    gs_clientdata-net_weight = gwa_itab1-ntgew.
    gs_clientdatax-net_weight = 'X'.
    *Unit of Weight
    gs_clientdata-unit_of_wt = gwa_itab1-gewei.
    gs_clientdatax-unit_of_wt = 'X'.
    *Base Unit of Measure
    gs_clientdata-base_uom = gwa_itab1-meins.
    gs_clientdatax-base_uom = 'X'.
    endloop.
    *calling BAPI for making changes in material and saving thru BAPI.
    CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
      EXPORTING
        headdata    = gs_bapimathead
        clientdata  = gs_clientdata
        clientdatax = gs_clientdatax.
    IF sy-subrc NE 0.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
      WRITE: / 'Error occured while changing material'.
    ELSE.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
      WRITE: / 'material',gs_bapimathead-material,'changed'.
    ENDIF.

    hi hello Guru's
    i resolved the issuee..
    pleaso go thru the below proram logic for your reference..........
    *& Report  ZAREPAS36
    REPORT  zarepas36.
    DATA : gs_bapimathead             TYPE  bapimathead,
           gs_clientdata              TYPE  bapi_mara,
           gs_clientdatax             TYPE  bapi_marax.
    TYPES : BEGIN OF gty_itab1,
            matnr(18),
            matkl(9),
            spart(2),
            ntgew(13),
            gewei(3),
            meins(3),
            END OF gty_itab1.
    DATA : gt_itab1 TYPE STANDARD TABLE OF gty_itab1,
           gwa_itab1 TYPE gty_itab1.
    TYPES: BEGIN OF gty_itab2,
           abc(132),
           END OF gty_itab2.
    DATA: gt_itab2 TYPE STANDARD TABLE OF gty_itab2,
          gwa_itab2 TYPE gty_itab2.
    DATA:ls_return         TYPE bapiret2,
         lt_bapiret2       TYPE standard table of bapiret2.
    flat file at selection screen
    PARAMETERS: p_files TYPE string.
    CALL METHOD cl_gui_frontend_services=>gui_upload
      EXPORTING
        filename = p_files
        filetype = 'ASC'
      CHANGING
        data_tab = gt_itab2
      EXCEPTIONS
        OTHERS   = 8.
    LOOP AT gt_itab2 INTO gwa_itab2.
      IF gwa_itab2-abc(1) = 'S'.
        gwa_itab1 = gwa_itab2-abc(132).
        APPEND gwa_itab1 TO gt_itab1.
      ENDIF.
    ENDLOOP.
    LOOP AT gt_itab1 INTO gwa_itab1.
    *Material
      gs_bapimathead-material    = gwa_itab1-matnr.
    *Material details at client data
    *material group.
      gs_clientdata-matl_group = gwa_itab1-matkl.
      gs_clientdatax-matl_group = 'X'.
    *Division
      gs_clientdata-division = gwa_itab1-spart.
      gs_clientdatax-division = 'X'.
    *Net Weight
      gs_clientdata-net_weight = gwa_itab1-ntgew.
      gs_clientdatax-net_weight = 'X'.
    *Unit of Weight
      gs_clientdata-unit_of_wt = gwa_itab1-gewei.
      gs_clientdatax-unit_of_wt = 'X'.
    *Base Unit of Measure
      gs_clientdata-base_uom = gwa_itab1-meins.
      gs_clientdatax-base_uom = 'X'.
    ENDLOOP.
    *calling BAPI for making changes in material and saving thru BAPI.
    CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
      EXPORTING
        headdata    = gs_bapimathead
        clientdata  = gs_clientdata
        clientdatax = gs_clientdatax
      IMPORTING
        return      = ls_return.
    LOOP AT lt_bapiret2 INTO ls_return.
      EXIT.
    ENDLOOP.
    IF sy-subrc = 0.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
      WRITE: / 'Error occured while changing material'.
    ELSE.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
      WRITE: / 'material',gs_bapimathead-material,'changed'.
    ENDIF.

  • Material Master Update through BAPI - Follow up material not updated

    Hi Experts,
    I am updating the material master through a custom transaction using the BAPI  'BAPI_MATERIAL_SAVEDATA'. Rest of the fields are updating correctly except for discontinuation ind., effective out date & follow-up material.
    When I try to update it through MM02 it is working fine. However, when I pass the same data through BAPI it is throwing an error message that 'the material XXXXXX does not exist or is not activated'.
    Please advice.
    Thanks & Regards,
    Ashu Arora

    Some more fields need to be updated along with the discont. indicator. Now working fine.

  • Weight change in material master, update all open PO's

    Hello
    IS there any standard way for mass update open purchase orders, when weights and volumen in material master change ?
    example:
    there is a change in neto weight for material AAAA, which is inserted into mm02, basic data for his material. This change doesn't effect already created  open orders with this material. Is there any standard way to update them in sap 4.7 ?

    Changes will get reflected for new docs only. This is standard.
    Now other question comes, why you want to change in PO. I am sure PO are already sent to vendor. Then ideally it is not advisable to change in those PO.
    If you haven't sent those PO to vendor, open those PO do some minor corrections SAP will populate the change information in PO documents.
    Also changed information will get effective later at GR stage also.
    So no question to worry.
    Check and revert

  • Custom - Material Master Update using an IDOC (Message Type - MATMAS_BAPI)

    Hello everyone,
    I was writing a functional specs. Basically, I want to update the material master MM02 using an IDOC (MATMAS_BAPI01 - Basic Type & MATMAS_BAPI - Message Type). This is currently working.
    To my understanding, this currently uses function module - BAPI_IDOC_INPUT1 to update the material master after the IDOC is posted to SAP ECC from XI system.
    Now I want to add one small validation logic before it actually updates the material master (MM02).
    I looked around and found one exit - EXIT_SAPLMV02_002 in enhancement MGV00001. I was almost sure that this EXIT can be used to write the custom validation code before, actual MM02 updation.
    However while trying to establish a link between this EXIT and BAPI_IDOC_INPUT1, I found that EXIT_SAPLMV02_002 is actually a part of another function module - IDOC_INPUT_MATMAS01 and not BAPI_IDOC_INPUT1. I am stuck here if adding the custom logic in the exit really going to work.
    a bit of googling and I found from WE30 that the purpose of both these function modules are actually different. While BAPI_IDOC_INPUT1  actually create & updates the material master (also plant specific master data which is my need), IDOC_INPUT_MATMAS01 is just for maintenence of few fields in MM02 (may be custom fields).
    Can anyone point out if my thing is in right direction?
    Also please offer any solution where shall I put the Custom Logic in the EXIT or the some variants of
    BAPI_IDOC_INPUT1.
    A less technical explanation would be appreciated as I come from a functional background and invloved in this for writing the func specs. I want to make it sure that what I write is not useless and makes some sense.
    Thanks in advance,
    Arunesh

    Hi Lalit,
    Did some head breaking with the function module - BAPI_IDOC_INPUT1 to check whether it is calling the EXIT_SAPLMV02_002 internally. Couldn't get anywhere.
    On question of another EXIT in BAPI_IDOC_INPUT1, I don't see any. I am not very proficient in ABAP code, I must say though.
    I found the list of exits from google, almost same list everywhere.
    http://www.sapfans.com/forums/viewtopic.php?f=21&t=296637
    here I got the EXIT, I am talking about.
    Any other way to find either the EXIT or link the above?
    -- Arunesh

  • Material master update through BAPI

    Hello Experts,
    We are using BAPI_MATERIAL_SAVEREPLICA to update material master . It is required to update RefPlant:consumption (MARC-VRBWK) in forecast view . We could not find any field corresponding to MARC-VRBWK in table parameters PLANTDATA .
    Please help me if there is any way to update  RefPlant:consumption (MARC-VRBWK ) in forecast view by using  BAPI_MATERIAL_SAVEREPLICA  .
    If there is any other BAPI to update the field please let me know .
    Regards,
    Kiran.

    Hi Suhas,
    I tried EXTENSIONIN & EXTENSIONINX  approach but the MARC-VRBWK was not reflected. I did some research and came to know that these extensions can be used to update the custom fields . If there is any way to update the standard field like MARC-VRBWK  using extension please let me know . It would be great help .
    Thanks,
    Kiran.

  • Material Master: Update the Z fields using BAPI

    Hi to all,
    My requirement is simple. But I do not have much knowledge on BAPI. I have got some information that we can extend th BAPI and update the Z fields in material master. I have added the z fields in MARA. So when I call the bapi z fields has to get update.
    Which BAPI can i use? I have got one BAPI - BAPI_MATERIAL_SAVEDATA.   plz suggest me to do it.
    1. how do i enhance the BAPI or extend th BAPI.
    2. Is ther any approch to do it.
    thnks
    Yerukala Setty

    Hi,
    Append the z fields to BAPI_TE_MARA and BAPI_TE_MARAX structures using append structures.
    Populate two structures for the fields in BAPI_TE_MARA and BAPI_TE_MARAX.
    To BAPI_MATERIAL_SAVEDATA, under EXTENSIONIN parameters, pass structure name as BAPI_TE_MARA and Value Part1, 2, 3, 4 with the filled structure info.
    Similarly append X structure as well.
    Regards,
    Ganga

  • Availability Check Changed on the Material Master Update Existing Orders

    I need to know if there is a way to update existing orders once changes have been made to the material.  Currently the only way that I know of is to go into individual orders change the plant save then change it back to the original plant on the order then the changes take effect.  How can I achieve this without touching every order individually.  Is there something to mass update existing orders to take a new snapshot of the material master settings for a material.

    Try with t.code VA05 - Open sales order list.
    Execute this list. In the output, sort the data by plant. Then go to menu Edit -> mass change -> new plant. Change the plant for group of sales orders that have similar plants. Then again do the same thing to bring the previous plant in the sales orders.
    This can help reduce the time instead of going one by one.
    Regards,

  • Material Master Updation

    hi gurus.......
    What is he difference between using 'MATERIAL_BTCI_SELECTION_NEW'  function module and 'SELECTION_VIEWS_FIND'  in updating the material master (MM02)

    Hello Chakri,
    go through the below thread entierly
    Update of material master in SRM
    Arshad

  • BAPI for Material master update

    Hello,
    I need to upload and change data to the classification screen of Material master (MM01/02). I am thinking of using BAPI_CHARACT_CREATE and BAPI_CHARACT_CHANGE. Can we use BAPI_MATERIAL_SAVEDATA to upload and change characteristic data for material master(MM01/02)?
    Can anybody provide me some sample code for mass upload and mass change of characteristic data to material master?
    Thanks in advance
    Rajesh.

    Hi Rajesh,
    You can use standard SAP program <b>RCCLBI03</b> to do mass upload.
    Please check the program documentation for more information.
    Also you can take a look this BAPI/FM.
    <b>BAPI_OBJCL_CREATE
    BAPI_OBJCL_CHANGE
    CLVF_INSERT_AUSP
    CLVF_UPDATE_AUSP
    CLVF_VB_INSERT_CLASSIFICATION</b>
    Hope this will help.
    Regards,
    Ferry Lianto
    Please reward points if helpful.

  • Reg Material Master Updation

    Dear SAP Genius
    is it possible to delete the sales view for a material in material master?
    if it's possible how to delete that?
    please explain the steps.
    Advance thanks.
    Regards
    Irshath

    Dear Kayalan,
    1.In standard SAP it is not possible to delete one particular view once after created.
    2.The only way in my understanding s setting the deltion flag and carryingout a reoganizing run and create a new material
    master for the same.
    Regards
    Mangalraj.S

  • Material master updation IDOC mapping

    Hi  Experts,
    I am getting IDOC MATMAS05 from an external system.I want to put a check on the field status(MARC-MMSTA) and update the MRP 1 data .For eg if status is 40 (inactive),I have to update MRP type to X0.How can I process further?
    I am using the function module IDOC_INPUT_MATMAS01 .
    Thanks,
    Saumia

    Hi,
    Try the BADI "BADI_MATMAS_ALE_IN", method "CHANGE_UEB_TAB". 
    The enhancements mentioned in my earlier post will be trigger based on the existance of certain Data segments in the idoc. Eg. E1MARAM (Master article general data (MARA)), E1MARA1 (Additional Fields for E1MARAM).  You can find the Segments for which the Enhancement is activated by going through the function module code.
    Regards
    Vinod

  • Inspection setup in view quality management update in material master

    Hi all,
    We are using BAPI_MATERIAL_SAVEDATA for our material master updation.
    Here one  of the change in the program is to update the inspection setup in the view quality management.
    Can anybody tell in which stucture of the bapi BAPI_MATERIAL_SAVEDATA  i can pass the values of the inspection set up fields.If not is there any other bapi through which can be done?
    Thanks in advance.
    regards
    Nazmul

    Hi,
    To deactivate the Inspection Types for materials, you can use transaction QA08.
    Here use tab "Deactivate insp. type" and specify the inspection type which you want to dactivate.

Maybe you are looking for

  • "Select" Physical table as LTS for a Fact table

    Hi, I am very new to OBIEE, still in the learning phase. Scenario 1: I have a "Select" Physical table which is joined (inner join) to a Fact table in the Physical layer. I have other dimensions joined to this fact table. In BMM, I created a logical t

  • DVD burner doesn't fit correctly in Mac Pro

    Added a new (second) DVD burner to my Mac Pro. It fits (I took the tray face plate off) but it's tight. So tight it won't eject all the way. I have to help it come out all the way. It's a Phillips DVD burner but seems to be the same dimensions as any

  • Tagged Text

    Hi folks, I have some text in CSV file(Excel file) containing first row as header, and the reset is data vaues belonging to those columns. I can read the data from the file, now I want to assign the each row of data to parts of a text box in InDesign

  • Why does Keynote 09 started to crash on heavy presentations?

    I have always worked with big, heavy presentations, that includes text, images and videos, but a few weeks ago Keynote 09 is crashing when I try to opne it!!! I have my entire life in those presentation and can't even think about losing it! I have tr

  • Expand /Collapse push button

    Hi Guys, I have problem with expand/collapse push button in my selection-screen. In the older version 4.6c icon is displaying  good where as in the ECC6  the instead of symbol, the icon id is displaying.     How to display the symbol ? Regards, Naras