SAP Program RMMMMPOI - Material Master Generation Program (Retail Material Maintenance)

Description
This generation program is used to extend tables and create new oneswhen converting material master data from industry functionality toretail functionality. You also use it to enhance functionality incertain areas. This ensures that missing data is supplemented andfunctionality made consistent.

Precondition
Before running this program, be sure that you have carried out thefollowing actions in Customizing:

  • Table T130S (General Control Indicators in Master Data Maintenance)

  • You have maintained field LAND1 correctly.
    When extending material master table MARA, field LAND1 is used todetermine the tax classification of the material.
    • Table TWPA (General Parameters for Retail Control (Master Data))

    • You have maintained the following fields in Customizing for BasicData Retail in the IMG activity General control, retail masterdata:
      Retail industry sector
      Reference plant for DCs
      Reference plant for stores
      • Table TVKOV (Org. Unit: Distribution Channels for Each Sales
      • Organization)
        You have maintained the Distribution chain category field (fieldVLTYP).
        Field VLTYP is required for maintaining table MAW1.
        Note
        In Customizing for Basic Data Retail, you can also createreference plants for distribution chains (store distribution chains) inthe IMG activity Distribution chain control.
        Also ensure that you have carried out the following actions in generalmaintenance:
        • Material groups

        • You have finished maintaining your material groups.
          This is because they are required in classification (for assigning thematerial to the material group).
          • Plant master

          • You have finished maintaining the reference plants.
            If you have not finished maintaining all the other plants, the resultsin the exception check (entry in table MPOI) may be incorrect. It isparticularly important to maintain the plant category.
            • Material master MARA

            • You have converted the industry sector of the materials to be processedto the industry sector in table TWPA.
              Only the following materials are processed:
              Materials of industry sectors W and H
              Materials whose industry sector in MARA is identical to that in tableTWPA
              Materials that are not flagged for deletion

              Program Actions
              When you run the generation program, the system performs the followingactions:

              • Storage of differently maintained data in management table MABW

              • Subsequent listing

              • Classification

              • Extension of existing tables and filling of new ones
              • Storage of Differently Maintained Data in Management Table MABW
                For plants, the maintenance of material master data can be based on areference plant. This means that the master data of a plant isidentical to that of the reference plant. If you change master data forthe reference plant, the changes are also made for all dependent plantsat the same time.
                By changing the master data of a plant, you can maintain datadifferently from the reference plant. These differences can be at thefollowing levels:

                • Plant level

                • Storage location level

                • Warehouse number level

                • Storage type level

                • The generation program records these differences by making an entry intable MABW. This table has the following key fields and attributes:
                  • Key fields:

                  • Material number
                    Internal counter
                    • Attributes:

                    • Plant number
                      Storage location
                      Warehouse number
                      Storage type
                      Subsequent changes to the material master data of a reference planthave no effect on differently maintained plants (that is, plants with arecord in table MABW).
                      Since table MABW is still empty at this point in time, the programfirst has to check for all material/plant assignments whether themaster data of the plant differs from that of the reference plant. Itdoes this for a material as follows:
                      RESET N1
                      It determines all plants of the MARC segment (only records without adeletion flag).
                      It compares the fields with the data of the reference plant at thislevel and at lower levels.
                      If the data differs from that of the reference plant, it creates anentry in table MABW with material/distribution chain/plant.
                      The program checks the following tables and structures:
                      • MARC,,Material Master: C Segment

                      • MBEW,,Material Valuation

                      • MARD,,Material Master: Storage Location/Batch Segment

                      • The program checks only the storage location specified in fieldMARC-LGFSB.
                        If data has been maintained differently from that of the referenceplant, the program writes a record with material, plant, and storagelocation in table MABW.
                        • MPOP,,Forecast Parameters

                        • MPGD,,Change Document Structure for Material Master/Product Group

                        • MFHM,,Production Resource/Tool Fields in the Material Master

                        • If data has been maintained differently from that of the referenceplant, the program writes a record with material and plant in tableMABW.
                          • MLGN,,Material Data for Each Warehouse Number

                          • MLGT,,Material Data for Each Storage Type

                          • If data has been maintained differently from that of the referenceplant, the program writes a record with material and warehouse number(and optionally storage type) in table MABW.
                            The program carries out additional existence checks for all MARCsegments that exist for a material and that do not have a deletionflag:
                            • Is the MARC record required?

                            • For example, if MARC records are required only forvalue-only materials in a plant wherevaluation is on a material group basis, industry material maintenance(as opposed to retail material maintenance) creates MARC records foreach plant. The program flags the MARC record and all records dependenton it (like MARD) for deletion.
                              • Is the MBEW record required?

                              • If, where inventory management is on a material group basis, an MBEWsegment exists for the material/plant, the program states in the logthat this record is not required.
                                • Are listing conditions (WLK1) required?

                                • If so, but none exist, they are created by the program.
                                  • Are selling periods (WLK2) required?

                                  • If so, but no record exists, they are created by the program atdistribution chain level.

                                    Subsequent Listing
                                    Materials not previously listed in a plant arelisted there by the generation program.

                                    Classification
                                    In the new material group maintenance, material groups are created asclasses. Materials assigned to a material group inherit all thecharacteristics of the material group.
                                    Since this assignment is not yet considered in classification, thegeneration program assigns all materials to their material group.

                                    Extension of Existing Tables and Filling of New Ones
                                    The generation program extends the master data segments for allprocessed materials. This affects the following tables:

                                    • MARA

                                    • MAW1 (retail-specific)
                                    • Table MARA
                                      Table MARA already exists and is extended to include only a few newfields. These fields are default fields for other material mastertables. The values of these fields are determined using the procedurebelow:
                                      Field,,Description ,, Ref. field ,, Determination procedure
                                      PRDHA,,Product hierarchy,, MVKE-PRODH ,, Determination of first
                                      ,, ,, ,, MVKE record
                                      PMATA,,Pr. ref. material,, MVKE-PMATN ,, Determination of first
                                      ,, ,, ,, MVKE record
                                      TAKLV,,Tax class. ,, MLAN-TAXM1 ,, Reading of table T130S
                                      ,, ,, ,, (country) and determination
                                      ,, ,, ,, of first record from MLAN
                                      ,, ,, ,, for the first tax category
                                      XCHPF,,Batch management ,, MARC-XCHPF ,, Reading of record from
                                      ,, ,, ,, table MARC for the MARC
                                      ,, ,, ,, for the reference plant
                                      BWSCL,,Source of supply ,, - ,, Blank or 0
                                      DATAB,,Valid-from date ,, MARA-ERSDA ,, Date the material was
                                      ,, ,, ,, created
                                      LIQDT,,Valid-to date ,, MAX-DATUM ,, Determination of the
                                      ,, ,, ,, maximum date in the system
                                      ,, ,, ,, (December 31, 9999)
                                      CUOBF,,Internal obj. no.,, Int. number,, Filled only for variants
                                      ,, ,, ,, in classification

                                      Table MAW1
                                      Table MAW1 is a retail-specific table required for using materialmaintenance functionality in retail. It is re-created by the generationprogram. These fields are likewise default fields for other materialmaster tables. The values of these fields are determined using theprocedure below.
                                      Field,,Description ,, Ref. field ,, Determination procedure
                                      WPSTA,,Maint. status ,, - ,, (See under "Determination of
                                      ,, ,, Field WPSTA" below)
                                      LDVFL,,Listing period ,, - ,, Blank or 0
                                      LDBFL,,for stores ,, - ,, Blank or 0
                                      LDVZL,,Listing period ,, - ,, Blank or 0
                                      LDBZL,,for DCs ,, - ,, Blank or 0
                                      WMAAB,,ABC indicator ,, MARC-MAABC ,, Reading of record from the
                                      ,, ,, ,, first reference plant
                                      WEKGR,,Purchasing group ,, MARC-EKGRP ,, Reading of record from the
                                      ,, ,, ,, first reference plant
                                      WHERL,,Country of origin,, MARC-HERKL ,, Reading of record from the
                                      ,, ,, ,, first reference plant
                                      WHERR,,Region of origin ,, MVKE-HERKR ,, Reading of record from the
                                      ,, ,, ,, first reference plant
                                      WVRKM,,Sales unit ,, MVKE-VRKME ,, Reading of the record in
                                      ,, ,, ,, table MVKE that is specified
                                      ,, ,, ,, in table TVKOV as the
                                      ,, ,, ,, consumer (VLTYP).
                                      ,, ,, ,, If no record is determined,
                                      ,, ,, ,, the field is blank or 0.
                                      WAUSM,,Unit of issue ,, MARC-AUSME ,, Reading of reference DC,
                                      ,, ,, ,, otherwise blank or 0
                                      WLADG,,Loading group ,, MARC-LADGR ,, Reading of record from the
                                      ,, ,, ,, first reference plant
                                      SSTUF,,Range grade ,, MARC-SSTUF ,, Blank or 0
                                      PFLKS,,Range priority ,, MARC-PFLKS ,, Blank or 0
                                      LSTAK,,Activation indi- ,, MARC-LSTAK ,, Blank or 0
                                      ,,cator for listing,, ,,
                                      LSTFL,,Listing procedure,, MARC-LSTFL ,, Blank or 0
                                      ,,for stores ,, ,,
                                      LSTVZ,,Listing procedure,, MARC-LSTVZ ,, Blank or 0
                                      ,,for DCs ,,
                                      WBKLA,,Valuation class ,, MBEW-BKLAS ,, Reading of record from first
                                      ,, ,, ,, reference plant
                                      WSTAW,,Commodity code ,, MARC-STAWN ,, Reading of record from first
                                      ,, ,, ,, reference plant, but only if
                                      ,, ,, ,, the country in table T130S
                                      ,, ,, ,, is the same as the country
                                      ,, ,, ,, of the reference plant
                                      WBWSP,,Valuation margin ,, MBEW-BWSPA ,, Reading of record from
                                      ,, ,, first reference plant
                                      WEXPM,,Unit of measure ,, T604-BEMEH ,, Reading of record from table
                                      ,,for commodity ,, ,, T604 for the first reference
                                      ,,code (foreign ,, ,, plant, but only if the
                                      ,,trade) ,, ,, country in table T130S is
                                      ,, ,, ,, the same as the country of
                                      ,, ,, ,, the reference plant

                                      Note
                                      The generation program determines the MARC segment for the firstreference plant as follows:
                                      RESET N1
                                      It checks whether a MARC exists for a reference distribution center.
                                      If no MARC exists, it checks whether a MARC segment exists for theglobal reference store (from table TWPA).
                                      If no MARC segment exists for the global reference store, it determinesan arbitrary MARC segment from a reference store (from TVKOV).
                                      If plant data has not been maintained for any reference plant, it usesthe data of an arbitrary plant as a reference.

                                      • Basic data ,,Always exists

                                      • Listing ,,At least 1 MVKE record (sales data) exists

                                      • Classification ,,Always exists

                                      • Purchasing ,,At least 1 info record exists

                                      • Sales ,,At least 1 MVKE record (sales data) exists

                                      • Logistics: DC ,,At least 1 MARC record for a DC (T001W)

                                      • Logistics: store,,At least 1 MARC record for a store (T001W)

                                      • POS ,,At least 1 MVKE record (sales data) exists

                                      • Allocation table,, -

                                      • If the generation program is unable to fill MARA or MAW1 fieldscorrectly (for example, if required fields are blank or 0), it tellsyou so accordingly.

                                        Technical Implementation
                                        The generation program is made up of the following function module andprogram:

                                        • Function module MATERIAL_COMPLETE_RT

                                        • This function module contains all actions to be performed.
                                          Import parameters
                                          KZRFB ,,Indicator: Refresh complete buffer
                                          SPERRMODUS,,Lock mode (none, exclusive)
                                          LEVEL ,,Output level for messages
                                          Export parameters
                                          None
                                          Table parameters
                                          PT_MARA ,,Materials that are processed (complete MARA structure)
                                          Note
                                          If table PT_MARA is empty, all materials are processed whose industrysector is identical to that in table TWPA and that are not flagged fordeletion at MARA level.
                                          Criterion for processing a material
                                          A material is only processed if no entry exists in table MAW1 or if themaintenance status is blank. Otherwise, the program assumes that thematerial has already been processed.
                                          • Program RMMMMPOI

                                          • This program starts the function module.
                                            Executing the program
                                            You can run the program online or in the background. If all materialsare processed the first time you run the program, we recommend that yourun it in the background due to the extended runtime and since a verylarge number of records may be changed or inserted.
                                            If you first want to process all materials, you do not need to enter amaterial on the initial screen. When subsequently running the program,you can enter a material here if you want to reprocess materials thatwere processed incorrectly.
                                            As with the function module, the program determines only materialswhose industry sector is identical to that in table TWPA and that arenot flagged for deletion at MARA level.
                                            The Display level field indicates the type of messages you wantto be displayed as a result in a job log or on the screen. You canchoose from the following levels:
                                            Level 1 (abends only)
                                            Only abends preventing the program from being processed correctly aredisplayed (for example, if entries have not been maintained inCustomizing).
                                            Level 2 (abends and errors)
                                            Besides abends (see level 1), errors are also displayed if a materialcannot be processed correctly (for example, if the material has notbeen assigned to a material group).
                                            Level 3 (abends, errors, and warnings)
                                            Besides abends and errors (see levels 1 and 2), warnings are alsodisplayed (for example, if a material has already been processed).
                                            Level 4 (all messages)
                                            All messages are displayed, including success messages.
                                            You use the Lock material indicator to determine whether thematerials to be processed are locked.
                                            Program Results
                                            After the program has finished running, the system outputs a runtimelog as follows:
                                            On-screen (if you have run the program online)
                                            Job log (if you have run the program in the background)
                                            • Prices

                                            • Prices are not currently affected by the generation program.
                                              • Table MAMT

                                              • This table is not currently filled or supplemented.
                                                • Table MALG

                                                • This table is not currently filled or supplemented.
                                                  • Industry sector

                                                  • The generation program has to read the industry sector in table TWPAand compare it with the industry sector in the material master record.It is planned for the program to change the industry sector in thematerial master record to that in table TWPA. However, since theeffects of changing the industry sector have not yet been fullyinvestigated, the industry sector in the material master record ispresently left unchanged.