Extending the material of an existing plant in a company code to new plant.

Hi,
I am trying to Extend the Material from Plant 1000 to 2000 Using BAPI : MATERIAL_MAINTAIN_DARK .
But it is not extended to Plant 2000.Please check the following code and correct me.
REPORT  ZEXTEND_MATERIAL1.
TABLES: MARA,MARC,MARD.
DATA: AMARA_UEB     TYPE TABLE OF     MARA_UEB,
           WA_MARA TYPE MARA_UEB,
      AMARC_UEB     TYPE TABLE OF     MARC_UEB,
      WA_MARC TYPE MARC_UEB,
      AMARD_UEB     TYPE TABLE OF     MARD_UEB,
      WA_MARD TYPE MARD_UEB.
DATA: MATNR_LAST  LIKE  MARA-MATNR,
      NUMBER_ERRORS_TRANSACTION LIKE  TBIST-NUMERROR.
DATA: idx TYPE sy-tabix.
DATA: P_KZ_NO_WARN  LIKE  RMMG08_012-MSGTYP,
      KZ_PRF  LIKE  RMMG08_012-MSGTYP.
PARAMETERS: P_MATNR TYPE MATNR.   "Material Number
PARAMETERS: P_WERKS TYPE WERKS_D. " Existing Plant
PARAMETERS: P_NWERKS TYPE WERKS_D. " New Plant
PARAMETERS: P_LGORT TYPE LGORT_D. " Storage Location
START-OF-SELECTION.
* Clear the Workarea
  CLEAR : WA_MARA,WA_MARC,WA_MARD.
* Refresh the Internal Tables
  REFRESH: AMARA_UEB,AMARC_UEB,AMARD_UEB.
* MARA Table
  SELECT SINGLE * FROM MARA INTO CORRESPONDING FIELDS OF WA_MARA WHERE MATNR = P_MATNR.
  IF SY-SUBRC = 0.
  WA_MARA-TCODE = 'MM01'.
  WA_MARA-TRANC = '0000000001'.
  APPEND WA_MARA TO AMARA_UEB.
  ENDIF.
* MARC Table
  SELECT SINGLE * FROM MARC INTO CORRESPONDING FIELDS OF WA_MARC WHERE MATNR = P_MATNR AND WERKS = P_WERKS.
  IF SY-SUBRC = 0.
    WA_MARC-WERKS = P_NWERKS.
    WA_MARC-TRANC = '0000000001'.
    WA_MARC-PSTAT = SPACE.
    APPEND WA_MARC TO AMARC_UEB.
  ENDIF.
* MARD Table
    SELECT SINGLE * FROM MARD INTO CORRESPONDING FIELDS OF WA_MARD WHERE MATNR = P_MATNR AND WERKS = P_WERKS AND LGORT = P_LGORT.
   IF sy-subrc = 0.
    WA_MARD-WERKS = P_NWERKS.
    WA_MARD-TRANC = '0000000001'.
    APPEND WA_MARD TO AMARD_UEB.
   ENDIF.
* Call the Function Module MATERIAL_MAINTAIN_DARK.
      CALL FUNCTION 'MATERIAL_MAINTAIN_DARK'
        EXPORTING
          P_KZ_NO_WARN                    = 'I'
          KZ_PRF                          = 'W'
        IMPORTING
          MATNR_LAST                      = P_MATNR
          NUMBER_ERRORS_TRANSACTION       = NUMBER_ERRORS_TRANSACTION
        TABLES
          AMARA_UEB                       = AMARA_UEB
          AMARC_UEB                       = AMARC_UEB
          AMARD_UEB                       = AMARD_UEB
       EXCEPTIONS
         KSTATUS_EMPTY                   = 1
         TKSTATUS_EMPTY                  = 2
         T130M_ERROR                     = 3
         INTERNAL_ERROR                  = 4
         TOO_MANY_ERRORS                 = 5
         UPDATE_ERROR                    = 6
         ERROR_PROPAGATE_HEADER          = 7
         OTHERS                          = 8.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ELSE.
      COMMIT WORK.
      ENDIF.
Thanks
Bhuvana
Edited by: Matt on Nov 26, 2010 10:04 AM - added  tags

Hi,
This function module used in many standard reports.We can see goto sm37->give the function module name->then click on the
where used list button on application toolbar u can get the more information regarding that function module.
RMMM000,L1001UEBU01
I thing we can get some information.
regards,
muralii

Similar Messages

  • The material does not exist in plant or flagged for deletion

    Hi All,
    I have done the integration of R3 back end with SRM system (SRM 5.0) Classic scenario is working fine.
    In the direct Material Procurement I get an error message that "the material does not exist in plant or flagged for deletion".
    I checked R/3 side material is active only and I have assigned plant in extend attributes.
    Can you please help me to resolve this problem..
    Thanks
    Ravi

    Hi Ravi
    check you validit date from and to for that material in comm_product table.* if it is valid you can do shopping or else you cant.
    regards
    Muthu

  • Extending the material to multiple plants

    Hello Experts,
    I am trying to extend the material to multiple plants and storage locations based on the source material storage locations.
    I am retrieving the data from mard and marc table to check whether that material is already got extended to the given plant.
    I am putting one check in the program to check the material is extended to given plant or not? If the material is already extended then i need to check whether it got extend to the given plant and storage location combinations.
    Can anyone give me some idea how to go with it...
    Here I am giving piece code where I got stuck.....
      READ TABLE RT_MARC
                   TRANSPORTING NO FIELDS
                   WITH KEY MATNR = LW_DATA-MATNR
                            WERKS = LW_DATA-IBL
                                     BINARY SEARCH.
        IF SY-SUBRC = 0.
          MESSAGE I468 WITH LW_DATA-MATNR LW_DATA-IBL.
          CLEAR : LW_DATA.
          CONTINUE.
        ENDIF.
    In IT_MARC I am getting the storage locations related to the source material for the given plants. How to verify this to check of the target plants with the combination of storage locations.
    In the above code after sy-subrc = 0 I need to check for the storage location combination also. I can't retrive the storage locations related to the target plants intially into IT_MARC.
    Waiting for your response.

    Hi , Thanks for the reply.
    But the plants for which data is automatically getting populated , I am selecting only the Foreign Trade view and not all the views.
    Regards

  • Extend the material in all plants

    hi experts,
    can u explain, how to extend the material number in all plants at a time..

    Hi,
    You can use the LSMW for extend the material to all the plants at a time. We have more than 10 plant, we have to extend the one material to 10 plants, 6 sales organization and 4 distribution channels. Through LSMW we will upload at a time.
    Reg/ Shankar G.

  • Extend the material for the storage location in mass.

    Hi,
    Can any genius let me know how can I extend the material for the storage location in mass.
    Currently our support team doing it by trx MMSC, but now we required to extend the materials for storage location in mass for which MMSC is to lengthily
    Is there any other way apart LSMW for MMSC.
    Regards,
    Shyamal.

    hi
    did u tried mass
    try this
    go to MASS
    then select BUS1001
    go to plant data for material  execute
    click on data records to be creatd
    then add material in field
    then select  select field button and add storage for extrenal procurement then there u will find on filed for external proc
    now do mass change
    reward if helpful
    regards
    kunal

  • Extend the Material Code from One Business Area to other Business Area.

    Dear All,
    I have create some material codes in a business area XYZ with Storage Location AA11 in Company code ABC. There is another business area PQR with Storage Location BB22 in Company code ABC. How can I extend the Material Codes of the Business Area XYZ with Storage Location AA11 to Business Area PQR with Storage Location BB22 through LSMW.
    I am waiting your reply.
    Regards,
    Hemang

    To extend material masters you can use anyone of the  SAP given import methods in LSMW.
    But I am a bit confused with the terms you are using, what do you mean by business area? and a material master is not created per company, the company is not among the organisation levels.
    Are you talking about plant and sales area?

  • How do I setup my Airport Extreme so that I can extend the coverage of my existing AT&T wifi network?

    How do I setup my Airport Extreme so that I can extend the coverage of my existing AT&T wifi network?

    Start by establishing a permanent fixed Ethernet cable connection from one of the available LAN <-> ports on the ATT modem/router to the WAN "O" port on the AirPort Extreme.
    Ethernet cabling can be run up to 300+ feet or 100 meters, so you should be able to locate the AirPort Extreme exactly where it will be needed to provide more wireless signal coverage.
    Configure the AirPort Extreme to "create" a wireless network using exactly the same wireless network name, same wireless security setting, and same wireless network password that the ATT wireless is using.
    The final step is to insure that the AirPort Extreme is configured to operate in Bridge Mode, so it will work correctly with the ATT modem/router.
    If you need more specific steps, we need to know what operating system you are using on your Mac or PC. If you have a Mac and do not know which operating system it is using.....click the Apple icon in the upper left corner of the screen and then click About This Mac, and post back with the OS X version number that you see there.

  • Extending the Material Master

    Hi all,
    I've extended the material master for mara with 3 ZZ fields. I've added these fields to BAPI_TE_MARA/X and am using EXTENSIONIN/X with BAPI_MATERIAL_SAVEREPLICA to create the material.
    This has  been unit tested and until recently this was working OK, the MM was created  along with the mara being popluated with the ZZ fileds and these were showing on the basic data 1 tab of the material master.
    Nothing has changed. I can see the data in extension/x for the ZZ fields being passed to BAPI_MATERIAL_SAVEREPLICA, the MM is created OK still but no ZZ fields are populated in mara and no data displayed in MM03.
    A bit vague I know but has anyone any suggestions?
    Thanks, Mark

    Hi Mark,
    You need to modify internal table TMARA_UEB. When you enhance MARA table with Zfields, you can't use standard SAP BAPI. I copied Bapi_material_save data and modified internal table TMARA_UEB. this internal table will have all zfields, you added in MARA. but not BAPI_MARA. you have import MARA append structure to the BAPI.
    At the end it calls SAP standard function "Material_maintain_dark".
    I enhanced Material master extensively and it worked for me. give a try.
    Thanks
    Hari

  • Extending the material

    Hi All
    If I have to extend a material to a view I think tcode mmo1(create/extend a material) is used then what about tcode mm50? what is the main difference between those?

    Sam,
    You can use either MM01 or MM50 to extend the material to a particular view that has not been maintained provided that view is allowed for the material type of the material in config (OMS2).
    The difference between the two transactions is that MM50 is a report that is normally used for 'mass' extension of materials based on the criteria you enter on the selection screen. In MM01, you can obviously extend the view only for a single material. It must also be noted that the MM50 program internally makes a call to the MM01 transaction. So in terms of the mechanism of extension, there is not much of a difference.
    Hope this helps.
    H Narayan

  • Extend the material

    Hello Experts,
    I m totally new for BAPI.
    My req is to extend the material of type "Raw Material",in which I have to select view Basic Data1,
    Basic Data1,Purchasing, Purchase Order Tex,MRP1,MRP2,MRP3,MRP4,Forecast.
    I search sdn, I got to know this can b achieved using BAPI_MATERIAL_SAVEDATA,
    Can anybody provide some hint or code for the same.
    Ravi

    hi,
    Refer to the link.
    http://abaplovers.blogspot.com/2008/06/sap-abap-creating-material-using-bapi_02.html
    Re: BAPI Material Creation
    Regards
    Sumit Agarwal

  • Can an Airport Express be used to extend the range of an existing Airport  Extreme?

    I would like to extend the range of my existing Airport Extreme.   If I connect an Airport express to my existing network will it rebroadcast the WiFi signal and therefore exrtend the overall range?

    If I connect an Airport express to my existing network will it rebroadcast the WiFi signal and therefore exrtend the overall range?
    The AirPort Express 802.11n can do this if it is located where it can receive a strong signal from the AirPort Extreme in order to "extend" it.

  • Material Ledger activation (COML) - multiple plants in single company code.

    Hi -
    Material Ledger activation (COML)- multiple plants in single company code.
    In large mfg plant - process industry (proposed to dived into number of production plants), Matrial 'a'  is produced in plant 'a'.Material 'a' is input to procude matl 'B' in plant 'B"..so on and so forth.
    We are activating Material Ledger (COML) for actual costing purpose. Question -During multi level price determination, will the variance of lower level materials ( produced in lowerlevel /other plants in our case) be rolled up to higher level materials (in a different plant). please let me know if it really works, if yes what are the guidelines (if any) .
    Please advise ASAP.
    Thanks
    Chris
    Edited by: Chris Farr on Oct 23, 2008 11:12 AM

    Hi Chris,
    from a business point of view there is a  difference that you might take into consideration: The valauation level will always be on material and plant combination. That means, the division into several virtual plants will usually lead to different actual prices for the same material in each plant. That might happen for example when you carry over stocks from last month into the current month in one plant, while the other plant has only receipts from the current month.
    That might me desired, but often it is not. If the mutiple plants are in reality only one location it might be hard to explain why the prices differ between plants.
    best regards,  Udo

  • What is the configuration step assigen 2 plant to one company code

    hi all,
    i want assigen one code to 2 plants, what is configuration  step
    what is the special roll in chart of a/c, document number range,
    thanks in advance
    milind

    hi
    Milind Patil         
    You can assign no of plants to one company code .you can follow below navigation path
    --Enterprise Structure
    --Assignment
    --Logistics - General
    --Assign plant to company code
    Doubble click on assign plant to company code
    Enter following entries
    CO-CODE     -     PLANT
    1000             -     1000
    1000             -     1100
    AND SO ON----
    there is no extra settings in chart of accouts and document number ranges for assign morethan on plant to co code
    REGARDS
    TRINADHNAIDU.A

  • How identify the data is client level,plant level or company code level

    Dear sirs,
    GM
    How identify the data is client level,plant level or company code level?
    If there is any T.code for same in SAP plz send me otherwise any procedure?
    Hopeeeeeeeeee....

    Hi,
    Once you gain experience, you will not look at any table any field or any view...You will do it just like how you use keyboard once you pass type writing....
    That is why every area of work, including master data is handed over to specialized teams...that will be their work day in and out....for some one newly entering, it will be little bit tough...once you practice, you will not be worried any more.  Of course, basic data at client level, purchasing data plant level etc...some thumb rules are there...still, you will take big blow by following such thumb rules because if you verify storage condition assigned in the storage location is not storage location level!!!!!!!!!!!!!!!
    that is experience!!  In this forum, it is good to practice rewarding...else, there may not be any more replies
    Good Luck
    Message was edited by:
            Gopala Turaga

  • How to reset the existing data in a company code?

    Hi All,
    Can any one help me how to reset the existing data in a company code? when we want to change one Chart of Accounts to another Chart of Accounts in OB62 scree.
    Thanks
    Chandra

    Hi
    If asset accounting is active also use OABL tcode.
    As mentioned above, please be cautious when using these transactions.
    Do award points if found useful.
    Regards,
    Karthik

Maybe you are looking for