Duplicates in material master

hello experts
what does it mean by identification of duplicates in material master and how its done?
whether its applicable for all master records?
regards

Hi,
The safety time / actual range of coverage ensures that the planned warehouse stock covers the requirements of a defined number of days. It therefore serves as a time float and thus works alongside the safety stock, which acts as quantity float.
The system simulates bringing the requirements forward by the specified number of days and the planning for the receipts, created for these requirements in the planning run, is also brought forward by this number of days.
Prerequisites
·   You have set the Safety Time indicator in the material master record (MRP 2 View) to define whether the safety time is only to apply to independent requirements or to all requirements.
·    In the material master record (MRP 2 View), in the Safety Time/Actual Range of Coverage field, you have entered the number of workdays by which the requirements are to be brought forward.
·    If, in addition to this actual range of coverage, you also want to define a different number of workdays in certain periods or a safety time less than one day then, in Customizing for MRP in the activity Define Period Profile for Safety Time/Actual Range of Coverage you can define a period profile and assign it to the material in the material master record.
Regards,
Vijay

Similar Messages

  • Prevent creation of duplicate material master record

    Hi Experts
    1)  Is there any control or validation to prevent creation of duplicate material? I mean, if the description of new material is 100% or 95% matching with an existing material, there should be a validation.
    2) Is there any feature of usage of catelogs for creation of material master description?
    warm regards
    ramSiva

    Hi,
    Have a try to use Enhancement: MGA00001, user exit: EXIT_SAPLMGMU_001 for control you need.
    You can also use BAdI for this:
    BADI_MATERIAL_CHECK -> method CHECK.
    In both enhacements there is a structure STEXT - here short text(s) of new created material should be found for validation.
    Here you can make some ABAP works necessary.
    Hope it helps,
    regards,
    w.
    Edited by: Wojciech Zalech on May 19, 2010 9:43 AM

  • Duplicate records in material master

    Hi All
    I am trying to init material master and I am getting this error message
    "281 duplicate record found. 0 recordings used in table /BI0/XMATERIAL"
    This is not the first time , I am initializing . Deltas were running for a month and then I had to run a repair request to capture some changes and then when I ran the delta from then onwards I am getting this message.
    I started by deleting all the records and running this inti packet.
    I have tried the error handling and also I do not see any option for "ignore duplicate records " in the packet.
    I cannot see any error (red) records also in the PSA enough though the message says there are errors
    Please advice
    Thanks

    Hi,
    The duplicate record check is in the extraction program. I would suggest you do not deactivate/comment it out.
    What you should do is to go back to your material master records from the source system and sort out the materials not having unique identifier. Once this is sorted out, you can then re-run your delta. You shouldn't have the problem again. I once had the same problem from an HR extraction and i had to go back to the source data and ask the business to correct the duplication. A record for an employee was changed and there was overlap of dates in the employees record. The BW extraction program saw this as a duplicate record.
    I hope this help.
    Do not forget to award the points please.
    Regards,
    Jacob

  • Duplicate material master records ?

    There are duplicate material master for the same material. In some cases there are more than two master data for the same material.?

    Hi,
    They material are internal number or external number.
    If internal number then only the discription might be the same with 2 or more material number.
    If external numbet then check the 2 same material how the difference in material number.
    If you want to delete or block then check the inventory status in the material.
    then do the further action.
    SAM

  • Multiple Plant Material Master

    Hi,
    Following is the business scenario:
    The client has two plants: one is excise exempt and other is not. Same material is manufactured in both plants. They also have a registered sales office which is created as a depot in SAP. Profit centers are created plant wise. Hence, there will be three profit centers (Excise exempt plant, excise chargeable plant and depot location).
    The Material Master for material is extended to all three plants having respective profit centers.
    Now, when material gets manufactured from both plants and lands at Depot for sale, no differentiation could be made so as to know which material (Point of Manufacture) was sold.
    The requirement is to get a Revenue Minus COGS report for Materials manufactured from Excise-exempt plant but sold from the depot.
    One of the options is to create different material master for such material at Manufacturing Plants.
    I am looking for options where separate material master need not be created.
    Thanks & Regards.

    Hi Vinay
    The only option I can think of is to use Split Valuation in the Depot Plant..
    Create 2 Val Types as EXCISE and EXCEMP for Excise and Excise Exempt Plant.. WHen you receive Goods in the Depot, you need to receive them against these 2 Val Types
    Ofcourse, it should be identifiable by looking at the Label from which Plant the product is manufactured... May be you need to think of introducing Batch Management in the 2 Mfg Plants wherein the Batch for Plant 1 starts with A and for Plant 2 starts with B
    Obviously, the cost of Product from Excise Exempt plant will be more because you dont get duty set off there.. So, this is the only option i can think of
    I would be firmly NO for Duplicate material codes
    Br. Ajay M

  • Material master upload -lsmw

    Hai guys,
               I want to upload material using lsmw for material master.i am following all the steps in the lsmw. i am using the batch input method for uploading.If the sales unit is different from the unit of measure..i will be getting the conversions data like numerator and denominator fields.
    i am getting the same fields if the issue unit is also different.so i couldnt able to map it correctly with the conversion fields..this repeating fields are not captured in the recording for the target fields.
    so i couldnt able to map it.please help me to solve this problem..
    with regards,
    sathish..

    Hi,
    Please close this duplicate thread..
    Thanks,
    Naren

  • IDOC: Material master (Extend Plants)

    I used LSMW IDOC option to migrate material master data (MATMAS):
    - Basic views
    - Description
    - Costing
    - Plant Stock
    I want to extend the plant view (Plant Stock). What change do I do to original LSMW to extend plant?
    How do I specify that I am extending?
    Is it that function code at the beginning of IDOC?

    You can do this by writing a program:
    REPORT  zdmmm_mm_multiplant NO STANDARD PAGE HEADING
            MESSAGE-ID zdmmm
            LINE-SIZE 255.
                    TABLE DECLARATION                                   *
    TABLES: mara,          "General Material Data
            mard,          "Storage location data
            mdma,          "MRP data for material
            marc.          "Plant Data for Material
    include zdmmmr_dev00160_mm_multi_top.
    include zdmmmr_dev00160_mm_multi_f00.
                   AT SELECTION-SCREEN                                  *
    AT SELECTION-SCREEN.
      IF NOT s_matnr[] IS INITIAL.
    *Subroutine to perform the Material Number validation
        PERFORM sub_validate_matnr.
      ELSEIF p_ersda IS INITIAL.
        MESSAGE e003   .
      ENDIF.
      IF NOT s_werks[] IS INITIAL.
    Subroutine to perform the plant validation
        PERFORM sub_validate_plant.
      ENDIF.
                    START-OF-SELECTION
    START-OF-SELECTION.
    *To retrive all possible material numbers that have to be
    *extended.
      PERFORM sub_get_mara.
    *To retrieve all possible plants to which the material needs
    *to be extended.
      IF s_werks IS INITIAL.
        PERFORM sub_get_werks.
      ENDIF.
    *For retrieving Procurement status data from T134.
      PERFORM sub_get_pstat.
    *To determine the plants to which the Materials have
    *already been extended.
      PERFORM sub_get_marc.
    *To determine all Storage Locations for individual Plants.
      PERFORM sub_get_t001l.
    *To retrieve company code
      PERFORM sub_get_t001k.
    *To determine the storage locations and plants to which the Material
    *has already extended.
      PERFORM sub_get_mard.
    *To determine the MRP Areas to which the materials need to be extended.
      PERFORM sub_get_mdlv.
    *To determine the MRP Areas to which the materials already been extended.
      PERFORM sub_get_mdma.
    *To retrieve the MRP Area related data from customized table.
      PERFORM sub_get_zdmmm_mrp_area.
    *TO retrieve the Scalabilty info
      PERFORM sub_get_scalability.
    *For extending Material to Plant, all possible Storage Location and corresponding MRP Area .
      PERFORM sub_mat_extn.
    *For creating success and error log.
      PERFORM sub_create_log.
    *Text elements
    001 Material/Plant Selection
    002 No data found for given Selection.
    003 Reference material is not maintained
    004 Material is already extended to the plant
    006 Material extended for MRP Area
    007 Successfully extended
    008 Already extended
    009 Not a seviceable storage location,cannot be extended to MRP Area
    *Selection texts
    P_ERSDA         Date
    S_MATNR         Material Number
    S_WERKS         Extend to Plant
    *Messages
    Message class: ZDMMM
    *000   & & & &
    *001   The material no. does not exist
    *002   The plant does not exists.
    *003   Enter either material no. or Creation date
    *&  Include           ZDMMMR_MM_MULTI_TOP                     *
                              Types
    *Type declaration to hold material no.
    TYPES: BEGIN OF ty_matnr,
             matnr      TYPE matnr,                  "Material Number
             mtart      TYPE mtart,                  "Material Type
             ersda      TYPE ersda,                  "Creation date
             mbrsh      TYPE mbrsh,                  "Industry Sector
             vkorg      TYPE vkorg,                  "Sales Organization
             vtweg      TYPE vtweg,                  "Distribution Channel
             mtartz     TYPE zmtart,                 "Material Type (Customized)
            END OF ty_matnr.
    *Type declaration to hold plant.
    TYPES: BEGIN OF ty_plant,
             werks      TYPE werks_d,                 "Plant
             bwkey      TYPE bwkey,                   "Valuation area
           END OF ty_plant.
    *Type declaration to hold data from marc.
    TYPES: BEGIN OF ty_marc,
             matnr      TYPE matnr,                   "Material Number
             werks      TYPE werks_d,                 "Plant
             bwkey      TYPE bwkey,
           END OF ty_marc.
    *Type declaration to hold data from mard.
    TYPES: BEGIN OF ty_mard,
             matnr      TYPE matnr,                   "Material Number
             werks      TYPE werks_d,                 "Plant
             lgort      TYPE lgort_d,                 "Storage Location
             mtart      TYPE mtart,                   "Material Type
           END OF ty_mard.
    *Type declaration to hold data from t001l.
    TYPES: BEGIN OF ty_sloc,
              werks     TYPE werks_d,                 "Plant
              lgort     TYPE lgort_d,                 "Storage Location
           END OF ty_sloc.
    *Type declaration to hold data from mdlv.
    TYPES: BEGIN OF ty_mdlv,
              berid     TYPE berid,                   "MRP Area
              werzg     TYPE werks_d,                 "Plant
              ortzg     TYPE lgort_d,                 "Storage Location
           END OF ty_mdlv.
    *Type declaration to hold data from custom table ZDMMM_MRP_AREA.
    TYPES: BEGIN OF ty_refmdma,
               zmtart    TYPE zdmmm_mrp_area-zmtart,   "Material Type (Customized)
               zwerks    TYPE zdmmm_mrp_area-zwerks,   "Plant
               zberid    TYPE zdmmm_mrp_area-zberid,   "MRP Area
               zdismm    TYPE zdmmm_mrp_area-zdismm,   "MRP Type
               zeisbe    TYPE zdmmm_mrp_area-zeisbe,   "Safety Stock
               zdisls    TYPE zdmmm_mrp_area-zdisls,   "Lot Size
               zdispo    TYPE zdmmm_mrp_area-zdispo,   "MRP Controller
               zfxhor    TYPE zdmmm_mrp_area-zfxhor,   "Plant Delivery Time (In days)
           END OF ty_refmdma.
    *Type declaration to hold data for success log.
    TYPES: BEGIN OF ty_succ,
               mat(18)   TYPE c,                        "Material
               plant(8) TYPE c,                        "Plant
               sloc(15)  TYPE c,                        "Storage Location
               comm(150) TYPE c,                        "Comments
            END OF ty_succ.
    *Type declaration to hold data for error log.
    TYPES: BEGIN OF ty_error,
              mat(18)   TYPE c,                         "Material
              plant(8) TYPE c,                         "Plant
              sloc(15)  TYPE c,                         "Storage Location
              comm(150) TYPE c,                         "Comments
            END OF ty_error.
    *Type declaration for holding data from mvke
    TYPES: BEGIN OF ty_mvke,
             matnr      TYPE matnr,                       "Material Number
             vkorg      TYPE vkorg,                       "Sales Org
             vtweg      TYPE vtweg,                       "Distribution Channel
           END OF ty_mvke.
    *Type declaration for holding data from qmat
    TYPES: BEGIN OF ty_qmat,
                   matnr type matnr,
                   werks type werks_d,
                   art TYPE qmat-art,
                   ppl TYPE qmat-ppl,
                   spezueber TYPE qmat-spezueber,
                   conf TYPE qmat-conf,
                   tls TYPE qmat-tls,
                   app TYPE qmat-app,
                   mer TYPE qmat-mer,
                   insmk TYPE qmat-insmk,
                   ave TYPE qmat-ave,
                   stichprver TYPE qmat-stichprver,
                   dynregel TYPE qmat-dynregel,
                   sproz TYPE qmat-sproz,
                   hpz TYPE qmat-hpz,
                   dyn TYPE qmat-dyn,
                   mpb TYPE qmat-mpb,
                   mst TYPE qmat-mst,
                   ein TYPE qmat-ein,
                   mpdau TYPE qmat-mpdau,
                   chg TYPE qmat-chg,
                   qkzverf TYPE qmat-qkzverf,
                   qpmat TYPE qmat-qpmat,
                   kzprfkost TYPE qmat-kzprfkost,
                   aufnr_co TYPE qmat-aufnr_co,
                   aktiv TYPE qmat-aktiv,
                   apa TYPE qmat-apa,
                   afr TYPE qmat-afr,
                   mma TYPE qmat-mma,
                   feh TYPE qmat-feh,
                   prfrq TYPE qmat-prfrq,
                   nkmpr TYPE qmat-nkmpr,
         END OF ty_qmat.
    *Type declaration for MARA and MARC data for reference material
    TYPES: BEGIN OF ty_ref_data,
             matnr      TYPE matnr,                       "Material Number
             ladgr      TYPE ladgr,                       "Loading Group
             bklas      TYPE bklas,                       "Valuation class
             peinh      TYPE peinh,                       "Price unit
             losgr      TYPE losgr,                       "Costing Lot Size
             hkmat      TYPE hkmat,                       "Material Origin
             herkl      TYPE herkl,                       "Country Of Origin
             dismm      TYPE dismm,                       "MRP Type
             dispo      TYPE dispo,                       "MRP Controller
             fxhor      TYPE fxhor,                       "Planned delivery time (In days)
             disls      TYPE disls,                       "Lot size
             fhori      TYPE fhori,                       "Scheduling Margin Key for Floats
             magrv      TYPE magrv,
             vhart      TYPE vhart,
             ergew      TYPE ergew,
             ervol      TYPE ervol,
             fuelg      TYPE fuelg,
             stfak      TYPE stfak,
             gewto      TYPE gewto,
             volto      TYPE volto,
             prctr      TYPE prctr,
             kzgvh      TYPE kzgvh,
             stawn      TYPE stawn,
             mtver      TYPE mtver,
             casnr      TYPE casnr,
             gpnum      TYPE gpnum,
             steuc      TYPE steuc,
             herkr      TYPE herkr,
             mownr      TYPE mownr,
             mogru      TYPE mogru,
             prenc      TYPE prenc,
             preno      TYPE preno,
             prend      TYPE prend,
             itark      TYPE itark,
             bstme      TYPE bstme,
             vabme      TYPE vabme,
             nrfhg      TYPE nrfhg,
             mfrgr      TYPE mfrgr,
             ekwsl      TYPE ekwsl,
             webaz      TYPE webaz,
             insmk      TYPE insmk,
             kzkri      TYPE kzkri,
             usequ      TYPE usequ,
             kordb      TYPE kordb,
             mprof      TYPE mprof,
             ekgrp      TYPE ekgrp,
             disgr      TYPE disgr,
             maabc      TYPE maabc,
             minbe      TYPE minbe,
             lfrhy      TYPE lfrhy,
             bstmi      TYPE bstmi,
             bstma      TYPE bstma,
             bstfe      TYPE bstfe,
             mabst      TYPE mabst,
             losfx      TYPE losfx,
             lagpr      TYPE lagpr,
             ausss      TYPE ausss,
             takzt      TYPE takzt,
             rdprf      TYPE rdprf,
             bstrf      TYPE bstrf,
             megru      TYPE megru,
             sobsl      TYPE sobsl,
             kzech      TYPE kzech,
             lgpro      TYPE lgpro,
             vspvb      TYPE vspvb,
             rgekz      TYPE rgekz,
             lgfsb      TYPE lgfsb,
             fabkz      TYPE fabkz,
             eprio      TYPE eprio,
             schgt      TYPE schgt,
             plifz      TYPE plifz,
             mrppp      TYPE mrppp,
             eisbe      TYPE eisbe,
             lgrad      TYPE lgrad,
             eislo      TYPE eislo,
             rwpro      TYPE rwpro,
             shflg      TYPE shflg,
             shzet      TYPE shzet,
             shpro      TYPE shpro,
             periv      TYPE periv,
             auftl      TYPE auftl,
             strgr      TYPE strgr,
             vrmod      TYPE vrmod,
             vint2      TYPE vint2,
             umref      TYPE umref,
             prgrp      TYPE prgrp,
             vint1      TYPE vint1,
             miskz      TYPE miskz,
             prwrk      TYPE prwrk,
             mtvfp      TYPE mtvfp,
             wzeit      TYPE wzeit,
             kzpsp      TYPE kzpsp,
             stdpd      TYPE stdpd,
             perkz      TYPE perkz,
             altsl      TYPE altsl,
             kausf      TYPE kausf,
             sbdkz      TYPE sbdkz,
             kzbed      TYPE kzbed,
             ahdis      TYPE ahdis,
             kzaus      TYPE kzaus,
             ausdt      TYPE ausdt,
             nfmat      TYPE nfmat,
             sauft      TYPE sauft,
             sfepr      TYPE sfepr,
             mdach      TYPE mdach,
             dplfs      TYPE dplfs,
             dplpu      TYPE dplpu,
             dplho      TYPE dplho,
             tempb      TYPE tempb,
             raube      TYPE raube,
             behvo      TYPE behvo,
             stoff      TYPE stoff,
             abcin      TYPE abcin,
             ccfix      TYPE ccfix,
             wesch      TYPE wesch,
             etiar      TYPE etiar,
             etifo      TYPE etifo,
             xgchp      TYPE xgchp,
             maxlz      TYPE maxlz,
             lzeih      TYPE lzeih,
             mhdrz      TYPE mhdrz,
             mhdhb      TYPE mhdhb,
             iprkz      TYPE dattp,
             rdmhd      TYPE rdmhd,
             mhdlp      TYPE mhdlp,
             brgew      TYPE brgew,
             ntgew      TYPE ntgew,
             volum      TYPE volum,
             voleh      TYPE voleh,
             groes      TYPE groes,
             xmcng      TYPE xmcng,
             loggr      TYPE loggr,
             sernp      TYPE serail,
             serlv      TYPE serlv,
             fprfm      TYPE fprfm,
             ausme      TYPE ausme,
             qmata      TYPE qmatauth,
             kzdkz      TYPE kzdkz,
             prfrq      TYPE prfrq,
             rbnrm      TYPE rbnr,
             qmpur      TYPE qmpur,
             ssqss      TYPE ssqss,
             qzgtp      TYPE qzgtyp,
             qssys      TYPE qssys,
             bwtty      TYPE bwtty,
             eklas      TYPE eklas,
             qklas      TYPE qklas,
             verpr      TYPE verpr,
             stprs      TYPE stprs,
             zkprs      TYPE dzkprs,
             zkdat      TYPE dzkdat,
             bwprs      TYPE bwprs,
             bwprh      TYPE bwprh,
             bwps1      TYPE bwps1,
             bwph1      TYPE bwph1,
             vjbws      TYPE vjbws,
             vjbwh      TYPE vjbwh,
             abwkz      TYPE abwkz,
             bwpei      TYPE bwpei,
             xlifo      TYPE xlifo,
             mypol      TYPE mypool,
             ncost      TYPE ck_no_costing,
             ekalr      TYPE ck_ekalrel,
             hrkft      TYPE hrkft,
             kosgr      TYPE ck_kosgr,
             awsls      TYPE awsls,
             mmsta      TYPE mmsta,
             mmstd      TYPE mmstd,
             stlal      TYPE stlal,
             stlan      TYPE stlan,
             plnnr      TYPE plnnr,
             aplal      TYPE plnal,
             plnty      TYPE plnty,
             sobsk      TYPE ck_sobsl,
             zplpr      TYPE dzplpr,
             zplp1      TYPE dzplp1,
             zpld1      TYPE dzpld1,
             zplp2      TYPE dzplp2,
             zpld2      TYPE dzpld2,
             zplp3      TYPE dzplp3,
             zpld3      TYPE dzpld3,
             lvolg      TYPE lvolg,
             diskz      TYPE diskz,
             lsobs      TYPE lsobs,
             lminb      TYPE lminb,
             lbstf      TYPE lbstf,
             lgpbe      TYPE lgpbe,
          END OF ty_ref_data.
    *Type declaration for holding data from mdma
    TYPES: BEGIN OF ty_mdma,
            matnr       TYPE mdma-matnr,                   "Material Number
            berid       TYPE mdma-berid,                   "MRP Area
            werks       TYPE mdma-werks,                   "Plant
          END OF ty_mdma.
    *Type declaration for holding Company code data
    TYPES: BEGIN OF ty_bukrs,
            bwkey       TYPE bwkey,                         "Valuation Area
            bukrs       TYPE bukrs,                         "Company code
          END OF ty_bukrs.
    *Type declaration for holding T001w Data
    TYPES: BEGIN OF ty_t001w,
            werks       TYPE werks_d,                       "Plant
            bwkey       TYPE bwkey,                         "Valuation Area
          END OF ty_t001w.
    *Type declaration for holding T134 Data
    TYPES: BEGIN OF ty_t134,
            mtart       TYPE mtart,                         " Material type
            pstat       TYPE pstat,                         "Condensed status display
          END OF ty_t134.
    Type declaration for Holding TWLAD data
    TYPES: BEGIN OF ty_twlad,
             werks    TYPE werks_d,
             lgort    TYPE lgort_d,
             adrnr    TYPE adrnr,
            END OF ty_twlad.
    *Type declaration for holding ADRC data
    TYPES: BEGIN OF ty_adrc,
             adrnr    TYPE adrnr,   "Address number
             sort2    TYPE ad_sort2,   "Search Term
           END OF ty_adrc.
    TYPES: BEGIN OF ty_dev00160,
             pkey    TYPE zkey,    "parameter key
             item    TYPE zitem,   "Item No
             value   TYPE zvalue,
           END OF ty_dev00160.
                             Constants
    CONSTANTS: c_header(1) TYPE c  VALUE 'H',     "Header
               c_true(1)   TYPE c  VALUE 'X',     "value = x
               c_v(1)      TYPE c  VALUE 'V',     "Sales View
               c_e(1)      TYPE c  VALUE 'E',     "Purchasing View
               c_d(1)      TYPE c  VALUE 'D',     "MRP View
               c_p(1)      TYPE c  VALUE 'P',     "Forecasting View
               c_a(1)      TYPE c  VALUE 'A',     "Work Scheduling view
               c_l(1)      TYPE c  VALUE 'L',     "Storage View
               c_q(1)      TYPE c  VALUE 'Q',     "Quality View
               c_b(1)      TYPE c  VALUE 'B',     "Accounting
               c_g(1)      TYPE c  VALUE 'G',     "Costing View
               c_f(1)      TYPE c  VALUE 'F',     "PRT View
               c_k(1)      TYPE c  VALUE 'K'.     "Basic View
                              Internal tables
    *Internal table to hold material no and material type
    DATA: i_matnr  TYPE STANDARD TABLE OF ty_matnr INITIAL SIZE 0.
    *Internal table to hold plant
    DATA: i_plant   TYPE STANDARD TABLE OF ty_plant INITIAL SIZE 0.
    *Internal table to hold marc data
    DATA: i_marc   TYPE STANDARD TABLE OF ty_marc INITIAL SIZE 0.
    *Internal table to hold marc data
    DATA: i_tmarc   TYPE STANDARD TABLE OF ty_marc INITIAL SIZE 0.
    *Internal table to hold mard data
    DATA: i_mard   TYPE STANDARD TABLE OF ty_mard INITIAL SIZE 0.
    *Internal table to hold t001l data
    DATA: i_sloc TYPE STANDARD TABLE OF ty_sloc INITIAL SIZE 0.
    *Internal table to hold MRP Area
    DATA: i_mdlv  TYPE STANDARD TABLE OF ty_mdlv INITIAL SIZE 0.
    *Internal table to hold already extended MRP Area
    DATA: i_mdma  TYPE STANDARD TABLE OF ty_mdma INITIAL SIZE 0.
    *Internal table to hold MRP Area data from customized table
    DATA: i_refmdma TYPE STANDARD TABLE OF ty_refmdma INITIAL SIZE 0.
    *Internal table to hold success messages
    DATA: i_succ TYPE STANDARD TABLE OF ty_succ INITIAL SIZE 0.
    *Internal table to hold error messages
    DATA: i_error TYPE STANDARD TABLE OF ty_error INITIAL SIZE 0.
    *Internal table to hold mvke data
    DATA: i_mvke   TYPE STANDARD TABLE OF ty_mvke INITIAL SIZE 0.
    *Internal table for company code data
    DATA: i_bukrs TYPE STANDARD TABLE OF ty_bukrs INITIAL SIZE 0.
    *Internal table for T001W data
    DATA: i_t001w TYPE STANDARD TABLE OF ty_t001w INITIAL SIZE 0.
    *Internal table for T134 data
    DATA: i_t134 TYPE STANDARD TABLE OF ty_t134 INITIAL SIZE 0.
    *Internal table for TWLAD data
    DATA: i_twlad  TYPE STANDARD TABLE OF ty_twlad INITIAL SIZE 0.
    *Internal table for ADRC data
    DATA: i_adrc  TYPE STANDARD TABLE OF ty_adrc INITIAL SIZE 0.
    *Internal table for dev00160 data
    DATA: i_dev00160  TYPE STANDARD TABLE OF ty_dev00160 INITIAL SIZE 0.
    *Internal table for qmat data
    DATA: i_qmat  TYPE STANDARD TABLE OF ty_qmat INITIAL SIZE 0.
                              Work areas
    *Work Area for Internal table i_mara
    DATA: wa_matnr     TYPE ty_matnr.
    *Work Area for Internal table i_werks
    DATA: wa_plant     TYPE ty_plant.
    *Work Area for Internal table i_marc
    DATA: wa_marc      TYPE ty_marc.
    *Work Area for Internal table i_t001l
    DATA: wa_sloc      TYPE ty_sloc.
    *Work Area for Internal table i_mdlv
    DATA: wa_mdlv      TYPE ty_mdlv.
    *Work Area for Internal table i_bukrs
    DATA: wa_bukrs     TYPE ty_bukrs.
    *Work Area for Internal table i_refmdma.
    DATA: wa_refmdma   TYPE ty_refmdma.
    *Work Area for Internal table i_succ
    DATA: wa_succ      TYPE ty_succ.
    *Work Area for Internal table i_error
    DATA: wa_error     TYPE ty_error.
    *Work Area for Internal table i_selfields
    DATA: wa_selfields TYPE sdibe_massfields.
    *Work Area for Internal table i_mvke
    DATA: wa_mvke      TYPE ty_mvke.
    *Work Area for Internal table i_ref_data
    DATA: wa_ref_data  TYPE ty_ref_data.
    *Work Area for internal table I_t001w
    DATA: wa_t001w    TYPE ty_t001w.
    *Work Area for internal table I_t001w
    DATA: wa_twlad    TYPE ty_twlad.
    *Work Area for internal table I_t134
    DATA: wa_t134    TYPE ty_t134.
    WOrk Area for ADRC Table
    DATA: wa_adrc    TYPE ty_adrc.
    WOrk Area for MARD Table
    DATA: wa_mard    TYPE ty_mard.
    *Work Area for Internal table i_mvke
    DATA: wa_dev00160      TYPE ty_dev00160.
    *Work Area for Internal table i_mvke
    DATA: wa_qmat      TYPE ty_qmat.
                    SELECTION SCREEN                                    *
    SELECTION-SCREEN : BEGIN OF BLOCK b_001
                       WITH FRAME
                       TITLE text-001 .         "Start of selection-screen
    SELECT-OPTIONS:     s_matnr FOR mara-matnr.            "Material Number
    PARAMETERS :        p_ersda LIKE mara-ersda.           "Creation Data
    SELECT-OPTIONS:     s_werks FOR marc-werks NO INTERVALS.       "Plant
    SELECTION-SCREEN : END OF BLOCK b_001 .   "End of Selection-screen
    *&  Include           ZDMMMR_MM_MULTI_F00                     *
    *&      Form  sub_validate_matnr
          Subroutine for validating material number
    FORM sub_validate_matnr .
      SELECT matnr            "Material Number
             mtart            "Material Type
             ersda            "Creation date
             mbrsh            "Industry Sector
      FROM mara               "Table for General Material Data
      INTO TABLE i_matnr
      WHERE matnr IN s_matnr.
    *If no material is found an error message is given
      IF sy-subrc <> 0.
        MESSAGE e001.
      ENDIF.
    ENDFORM.                    " sub_validate_matnr
    *&      Form  sub_validate_plant
          Subroutine to validate Plant
    FORM sub_validate_plant .
      SELECT werks            "Plant
             bwkey            "Valuation area
      FROM t001w              "Table for Plants/Branches
      INTO TABLE i_plant
      WHERE werks IN s_werks.
    *If no plant is found an error message is given
      IF sy-subrc NE 0.
        MESSAGE e002.
      ENDIF.
    ENDFORM.                    " sub_validate_plant
    *&      Form  sub_get_mara
    *Determine all the materials that need to be extended to new plants,
    *storage locations and MRP areas
    FORM sub_get_mara .
      IF NOT s_matnr[] IS INITIAL.
        SORT i_matnr BY matnr.
        IF p_ersda IS NOT INITIAL.
          DELETE i_matnr WHERE ersda NE p_ersda.
        ENDIF.
      ELSE.
    *If only Creation Date is given
        SELECT    matnr              "Material No.
                  mtart              "Material Type
                  ersda              "Creation date
                  mbrsh              "Industry Sector
        FROM mara                    "Table for General Material Data
        INTO  TABLE i_matnr
        WHERE ersda EQ p_ersda.
        IF sy-subrc EQ 0.
          SORT i_matnr BY matnr.
        ELSE.
          MESSAGE i000 WITH 'No data found for given Selection.'(002).
          LEAVE LIST-PROCESSING.
        ENDIF.
      ENDIF.
    Subroutine to get data from mvke.
      PERFORM sub_get_mvke.
      LOOP AT i_matnr INTO wa_matnr.
        CLEAR wa_mvke.
        READ TABLE i_mvke INTO wa_mvke WITH KEY matnr = wa_matnr-matnr
    BINARY SEARCH.
        IF sy-subrc EQ 0.
          wa_matnr-vkorg = wa_mvke-vkorg.
          wa_matnr-vtweg = wa_mvke-vtweg.
        ENDIF.
        IF wa_matnr-mtart = 'AD01'.
          wa_matnr-mtartz = 'AD01'.
        ELSE.
          wa_matnr-mtartz = 'NAD01'.
        ENDIF.
        MODIFY i_matnr FROM wa_matnr TRANSPORTING vkorg vtweg mtartz.
      ENDLOOP.
    ENDFORM.                    " sub_get_mara
    *&      Form  sub_get_werks
    *Determine all the plants to which the Materials need to be extended
    FORM sub_get_werks .
      SELECT   werks            "Plant
               bwkey            "Valuation Area
      FROM t001w                "Check table for Plants/Branches
      INTO  TABLE i_plant.
      IF sy-subrc EQ 0.
        SORT i_plant BY werks.
      ENDIF.
    ENDFORM.                    " sub_get_werks
    *&      Form  sub_get_marc
    *Determine the status of the materials with respect to which plants
    *they have already been extended to
    FORM sub_get_marc .
      CHECK i_matnr[] IS NOT INITIAL.
      SELECT     m~matnr        "Material Number
                 m~werks        "Plant
                 t~bwkey
      INTO TABLE i_marc
      FROM marc AS m               "Table for Plant Data for Material
      INNER JOIN t001w AS t
      ON mwerks = twerks
      FOR ALL ENTRIES IN i_matnr
      WHERE matnr EQ i_matnr-matnr.
      IF sy-subrc EQ 0.
    *Append the plants that have been extended to
    to the list of plants to which they have to be extended
    only when no plants are given in the selection screen
        IF s_werks IS INITIAL.
          LOOP AT i_marc INTO wa_marc.
            wa_plant-werks = wa_marc-werks.
            wa_plant-bwkey = wa_marc-bwkey.
            APPEND wa_plant TO i_plant.
            CLEAR wa_plant.
          ENDLOOP.
          SORT i_plant BY werks bwkey.
          DELETE ADJACENT DUPLICATES FROM i_plant
          COMPARING werks bwkey.
        ENDIF.
        SORT i_marc BY matnr werks.
    *Retrieve the Valutaion Area for the plants to which the material
    *has already been extended.
        SELECT werks          "Plant
               bwkey          "Valuation area
        INTO TABLE i_t001w
        FROM t001w            "Table for Plants/Branches
        FOR ALL ENTRIES IN i_marc
        WHERE  werks = i_marc-werks.
    *If selection succeed.
        IF sy-subrc EQ 0.
    Sort by Plant
          SORT i_t001w BY werks.
        ENDIF.
      ENDIF.
    *Copy the content of MARC into a temporary internal table
      i_tmarc[] = i_marc[].
      DELETE ADJACENT DUPLICATES FROM i_tmarc
             COMPARING matnr.
    *Retrieving Inspection type - material parameters (QMAT)
    *data
      SELECT       matnr          "Material Number
                   werks          "Plant
                   art            "Inspection Type
                   ppl            "Inspection with Task List
                   spezueber      "Inspect with Material Specification
                   conf           "Inspection Specifications from
                                  " Configuration
                   tls            "Inspection Specifications from Batch
                                  " Determination
                   app            "Automatic Specification Assignment
                   mer            "nspect by Characteristics
                   insmk          "Post to Inspection Stock
                   ave            "Automatic Usage Decision Planned
                   stichprver     "Sampling Procedure
                   dynregel       "Dynamic Modification Rule
                   sproz          "Inspection Percentage
                   hpz            "100% Inspection
                   dyn            "Skips Allowed
                   mpb            "Enter the Sample Manually
                   mst            "Trigger Sample Calculation Manually
                   ein            "Serial Number Management Possible
                   mpdau          "Average Inspection Duration
                   chg            "Control of Inspection Lot Creation (Lot
                                  "Summary)
                   qkzverf        "Procedure for Calculating Quality Score
                   qpmat          "Allowed Share of Scrap (Percent) in
                                   "Inspection Lot
                   kzprfkost      "Record Appraisal Costs in Individual QM
                                  "Order
                   aufnr_co       "Order Number for Recording Appraisal
                                   "Costs
                   aktiv          "Inspection Type - Material Combination is
                                   "Active
                   apa            "Preferred Inspection Type
                   afr            "Inspection for Handling Unit
                   mma            "Field Not Used as of 3.0       Field
                                   "Reserved for SAP
                   feh            "Field Not Used as of 3.0       Field
                                  "Reserved for SAP
                   prfrq          "Field Not Used as of 3.0       Field
                                   "Reserved for SAP
                   nkmpr          "Field Not Used as of 3.0       Field
                                  "Reserved for SAP
          INTO TABLE i_qmat
          FROM qmat               "Table of "Inspection type - material
                                  "parameters"
          FOR ALL ENTRIES IN i_tmarc
          WHERE matnr = i_tmarc-matnr "Material no. of temporary internal
                                       "table
          AND   werks = i_tmarc-werks. "Plant of temporary internal table
    *If selection succeed
      IF sy-subrc EQ 0.
        SORT i_qmat BY matnr.
      ENDIF.
    ENDFORM.                    " sub_get_marc
    *&      Form  sub_get_mard
    Determine the storage locations for the Plants i_plant.
    FORM sub_get_mard .
      CHECK i_marc[] IS NOT INITIAL.
      SELECT matnr           "Material Number
             werks           "Plant
             lgort           "Storage Location
      FROM mard              "Table for Storage Location Data for Material
      INTO TABLE i_mard
      FOR ALL ENTRIES IN i_marc
      WHERE matnr EQ i_marc-matnr
      AND werks EQ i_marc-werks.
    *If selection succeed
      IF sy-subrc EQ 0.
    *Sort internal table by Material no , Plant and Storage Location
        SORT i_mard BY matnr werks lgort .
      ENDIF.
    ENDFORM.                    " sub_get_mard
    *&      Form  sub_get_t001l
    Determine the storage locations for the Plants i_plant.
    FORM sub_get_t001l .
      CHECK i_plant[] IS NOT INITIAL.
      SELECT     werks               "Plant
                 lgort               "Storage Location
      FROM t001l                     "Check table for Storage Location
      INTO TABLE i_sloc
      FOR ALL ENTRIES IN i_plant
      WHERE werks EQ i_plant-werks.
    *If selection succeed
      IF sy-subrc EQ 0.
    *Sort by Plant and Storage Location
        SORT i_sloc BY werks lgort.
       For all the storage location get the Storage Location Address
    *Number
        SELECT werks   "Plant
               lgort   "Storage Location
               adrnr   "Address Number
         FROM twlad    "Table of 'Determination of Address from Plant and
                       "Storage Location'
         INTO TABLE i_twlad
         FOR ALL ENTRIES IN i_sloc
         WHERE werks = i_sloc-werks
         AND   lgort = i_sloc-lgort.
    *If selection succeed
        IF sy-subrc EQ 0.
    *Sort by Plant, Storage Location and Address number
          SORT i_twlad BY werks lgort adrnr.
    For all address numbers retrieved get the search term
          SELECT addrnumber  "Address number
                 sort2       "Search Term 2
          INTO TABLE i_adrc
          FROM adrc          "Table of 'Addresses (Business Address
                             "Services)'
          FOR ALL ENTRIES IN i_twlad
          WHERE addrnumber = i_twlad-adrnr.
          IF sy-subrc EQ 0.
            SORT i_adrc BY adrnr.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDFORM.                    " sub_get_t001l
    *&      Form  sub_get_mdlv
    Determine the MRP Areas to which the materials need to be extended.
    FORM sub_get_mdlv .
      CHECK i_sloc[] IS NOT INITIAL.
      SELECT     berid                "MRP Area
                 werzg                "Plant
                 ortzg                "Receiving Storage Location
      FROM mdlv                       "Table for Customizing MRP Area
      INTO TABLE i_mdlv
      FOR ALL ENTRIES IN i_sloc
      WHERE werzg EQ i_sloc-werks
      AND   ortzg EQ i_sloc-lgort.
    *If selection succeed.
      IF sy-subrc EQ 0.
    *Sort by Plant and Storage Location
        SORT i_mard BY werks lgort.
      ENDIF.
    ENDFORM.                    " sub_get_mdlv
    *&      Form  sub_get_zdmmm_mrp_area
    Determine required fields w.r.t Plant and MRP Area from customized
    *table
    FORM sub_get_zdmmm_mrp_area .
      CHECK i_mdlv[] IS NOT INITIAL.
    *Retrieving MRP data from Customized table
      SELECT    zmtart                "Material Type
                zwerks                "Plant
                zberid                "MRP Area
                zdismm                "MRP Type
                zeisbe                "Safety Stock
                zdisls                "Lot Size
                zdispo                "Mrp Controller
                zfxhor                "Planned Delivery Time (In Days)
      FROM zdmmm_mrp_area             "Customized table for MRP Area wrt
                                       "plant and mat type.
      INTO TABLE i_refmdma
      FOR ALL ENTRIES IN i_mdlv
      WHERE zberid = i_mdlv-berid
      AND zwerks = i_mdlv-werzg.
    *If selection succeed
      IF sy-subrc <> 0.
    *Sort by MRP Area and Plant
        SORT i_refmdma BY zberid zwerks.
      ENDIF.
    ENDFORM.                    " sub_get_zdmmm_mrp_area
    *&      Form  sub_mat_extn
    For extending Material to Plant, all possible Storage Location and
    corresponding MRP Area .
    FORM sub_mat_extn .
    *Local variable declaration
      DATA: l_index TYPE sytabix.       "For storing sy-tabix
      DATA: l_counter TYPE i VALUE 0.   "For formatting Error log.
      DATA: l_sloc_extend TYPE c.       "Flag for Extending the material
      DATA: wa_dpop LIKE dpop.          "For sending as a exporting
      "parameter
      DATA: wa_mdma LIKE mdma.          "For sending as a exporting
      "parameter
      DATA: l_stat  TYPE c.             "For checking the Storage Location
      "is Seviceable or not.
      DATA: wa_bapireturn1 TYPE bapiret1. "Return Work area of
      "'MD_MRP_LEVEL_CREATE_DATA'
    *No material is selected.
      CHECK i_matnr[] IS NOT INITIAL.
      SORT i_plant BY werks.
      SORT i_marc BY matnr werks.
      SORT i_mard BY matnr werks lgort.
    *For extending the material to Plant Storage Location and possible MRP
    *Area
      LOOP AT i_matnr INTO wa_matnr.
        CLEAR wa_marc.
      Checking whether Reference Material  Exists or not
        READ TABLE i_marc INTO wa_marc WITH KEY matnr = wa_matnr-matnr
       BINARY SEARCH.
      If no reference material exists..populate data for error log.
        IF sy-subrc NE 0.
          CLEAR wa_error.
          PERFORM material_convert USING wa_matnr-matnr
                                   CHANGING wa_error-mat.
          wa_error-comm = 'Reference material is not maintained'(003).
          APPEND wa_error TO i_error.
          CLEAR wa_error.
          CONTINUE.
        ENDIF.
      For retrieving the reference data
        PERFORM sub_retrieve_refdata.
        LOOP AT i_plant INTO wa_plant.
          READ TABLE i_marc INTO wa_marc WITH KEY matnr = wa_matnr-matnr
                                                  werks = wa_plant-werks
                                                  BINARY SEARCH.
          IF sy-subrc EQ 0.
        

  • Duplicate in material no

    Dear Experts,
    We have taken restart of MDM server. Now when we are trying to upload the repository for material it is giving error u201Ccannot set unique constrain on material no because duplicate record existu201D. We remove this condition from console temporarily to find out duplicate record in MDM. We checked duplicate by matching record u2018All vs Allu2019, it has not given any duplicate but still error remains the same.
    We only want to UP the repository with unique constrain on material no. Kindly help to find out duplicate in material no in  master data manager.
    Regards,
    Gaurang

    Hi Gaurang,
    I am detailing the steps from note below and also including my comments in bold:
    As the report mentions, Verify->Repair will automatically perform the following:
    1. Remove the Unique field so that repository can be loaded.
    2. Add a new integer field and populate numbers for the duplicate records only. All records with same number are duplicates for the same value.
    The addition of a integer field is automatic and it creates a duplicate label for duplicate records,it is populated for duplicated records,only for helping you delete those records with problem
    The user should perform the following:
    These are the steps you have to do:
    1. Load the repository (Update indices option).
    2. Inspect the duplicate values in the table with Data Manager with the help of new field
    3. Fix the duplicate problem by removing the duplicated records.
    4. Unload the repository
    5. Remove the new field and add back the unique constraint.This new field is the duplicate label field created automatically,delete that.
    6. Load the repository with Update Indices option.
    This sums it up,dont forget to take backup before you do a repair.
    Hope it helps.
    Thanks,
    Ravi

  • Checking duplicate description material

    Hi,
    Please help me to do checking duplicate description material when create material in MM01. It is possible or not. What setting i can do in the system.
    Thank you.

    Hi,
    Check with Enhancement: MGA00001, User exit: EXIT_SAPLMGMU_001 for control.
    Also can be checked BADI_MATERIAL_CHECK
    Have concept of  new material creation with  validation & do  ABAP works necessary.
    More check link:
    Material Master
    Regards,
    Biju K

  • What are the mandatory fields while creation of material master in differen

    what are the mandatory fields while creation of material master in different views?

    Hi Gopi,
      This is purely depends on the function configuration, which would be done MM consultants.  Kindly check with them.
    thanks & regards
    Kishore Kumar Maram

  • Copy of Material Master charac. values to the batch classif. in GR for PO

    Dear gurus,
    Could you please help me with the following issue. I have a material managed in batches, and it has a classification type 023 in material master. I fill one chaacteristic of this classification with some value. Now I want this value to be copied to the batch classification during the creation of new batch while making GR to production order.
    Is it possible?

    Hi Nikolaj,
    What I am understand your requirement is like,
    You want to fetch the value of Characteristic maintain in Batch class in Material master to the Batches, correct?
    But my Friend if you maintain value of characteristic in Batch Class in material master then it will works as a validation.
    For Example,
    Suppose your Characteristic is Colour and in Material Master Batch classification view you have maintain value as Red.Then system will not allow you any other colour in Batches.You will find that value in Drop Down list.
    Regards,
    Dhaval

  • Automatic creation of Material Master at the time raising the PO !!!

    Hello All,
    I am stuck in a scenario of our client which should be implemented (or mapped) in SAP.
    Scenario: At the time of creating the PO (in there legacy system -in house developed) they can choose the items from the existing master data or/and they can also add a new item (which is not present in the master data records at the time of creating the PO).
    Now as soon as the system realise that a new item is inserted into the PO, it will create that item record automatically in the backend (database) and the master data will be present from there on.
    The items they are dealing with are all fashion accessories and they generate order on the following basis:
    1. Demand of particular item in market.
    2. List of items provided by the vendor.
    3. Based on the requirement in there outlets.
    So for them its very difficult to fix there master data records, as it can be changed daily or monthly as per the market conditions. At the same time every time they order, its almost around 100 different items (some time 80 of them are new) in a single PO so they cannot create 80 records manually each time.
    These items are not consumable material so obviously they are maintaining the stock for them. They are also not going to use IS Retail.
    I am not at all sure how can we map this particular practice in SAP, it would be really appreciated if any one could help me on this problem.
    Please let me know if you need any other details from my side.

    Hi,
      As you have two different systems one in house developed and another SAP, and the PO creation part starts from Legasy system which creats the PO in SAP, you can do some development as per below
    1:  While Passing the details from legasy to SAP, use two columns in legasy one will contain the Material Code of ECC (for laready exist material ) and another for deescription of material.
    2: In case material is new for which there is no material master in ECC pass only description from legasy systems.
    3:While getting triggred from Legasy to ECC to create the PO, first check whehter all the material code exists or not in ECC.
    4:If some material are not created (only description present) for those material first create the Material Code using BAPI 'BAPI_MATERIAL_SAVEDATA'.
    5: Aftre creation of Material code create the PO using BAPI ' BAPI_PO_CREATE1'.
    6:For the new created material , trnasfre the master record from ECC to Legasy systemso that next time user can see that material in your legasy system.
    Regards,
    Zafar

  • Creation of material master

    Dear all,
    While entering of MM01, MM02, MM03 T codes, The system showing the error message - "Record Y1 01 does not exist in Table T133A" - for this what do I do, Plz suggest.
    reg
    Vishnu.Ch

    Hi Madhu,
        Thanks for your reply. But, I have one more doubt. For non stock materials, we
    will specify the cost centre and G/L account at the time of creation of Purchase order. Then, do we have to specify the valuation class at the time of creation of
    Material Master since there is no automatic account determination?
    Regards
    Yoga

  • In creation of material master

    hi to all,
    I have one issue regarding material master creation in in intial screen.
    when i enter the material number, industry sector and material type it gives one error  message as "record Z2 01  is not exist in table T133A"  and message number as "M3748".
    Regards
    Raju.

    Hi
    Are you experiencing this after upgrade?
    This is something relevant to IS-oil.
    However please go through OSS notes 918298 and 868771, you may get a clue.
    warm regards
    sairam

  • 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.

Maybe you are looking for