Update MRP group for a material and MRP area

Hi,
My requirement is to mass update the MRP group for certain number of materials depending upon the MRP area.
Is there any standard BAPI or the LSMW program which would help me in this.
Regards,
Shahu

Hi,
Hope this program can give you some lead.
REPORT  ZMRPAREA002                           .
*Tables.
tables : mara,                          "General Material Data
         marc,                          "Plant Data for Material
         mvke,
         mdlv.                          "Customizing MRP Area
Internal Table
types : begin of bdc_tab,
             matnr like MARA-matnr,    "Material Number
             werks like MARC-werks,    "Plant
             berid like mdlv-berid,    "MRP area
             dismm like marc-dismm,    "MRP Type
             minbe(16),                "Reorder Point
             disgr like marc-disgr,    "MRP Group
             dispo like marc-dispo,    "MRP Controller
             disls like marc-disls,    "Lot size (materials planning)
             bstfe(16),                "Fixed lot size
             mtart like mara-mtart,    "Material Type
             bstmi like marc-bstmi,    "Minimum lot size
        end of bdc_tab.
data : i_bdc_DATA type bdc_tab occurs 0 with header line.
data : it_bdc_data type MDMA. " occurs 0 with header line.
data : i_struc type SDIBE_MASSFIELDS. " occurs 0 with header line.
data : s_dpop type dpop.
data : var type BAPIRETURN1.
data : var1(50).
*Selection-Screeen
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-010.
  PARAMETERS  :  P_FNAME LIKE RLGRAp-FILENAME.
SELECTION-SCREEN END OF BLOCK b1.
*AT_SELECTION_SCREEN
Call the function module to display the dialog to select input file
at selection-screen on value-request for p_fname.
  call function 'WS_FILENAME_GET'
       exporting
            def_filename     = p_fname
            mode             = 'O'
            title            = 'Select the file to Upload'
       importing
            filename         = p_fname
       exceptions
            inv_winsys       = 01
            no_batch         = 02
            selection_cancel = 03
            selection_error  = 04.
  if sy-subrc <> 0.
  endif.
*Start-Of-Selection
Start-Of-Selection.
perform get_data.            "DATA UPLOAD TO INTERNAL TABLE
*perform open_group.                "open BDC-GROUP
*Selecting values for a particular material type
loop at i_bdc_DATA.
  select single mtart from mara
         into i_bdc_DATA-mtart
         where matnr = i_bdc_DATA-matnr.
  modify i_bdc_DATA.
  select single * from mvke
         where matnr = i_bdc_DATA-matnr.
endloop.
*Form Get_Data .
form get_data .
    data : v_fname type string.
    v_fname = p_fname.
  CALL FUNCTION 'WS_UPLOAD'
   EXPORTING
     filename                      = P_FNAME
     filetype                      = 'DAT'
    TABLES
      data_tab                      = i_bdc_DATA
EXCEPTIONS
   conversion_error              = 1
   file_open_error               = 2
   file_read_error               = 3
   invalid_type                  = 4
   no_batch                      = 5
   unknown_error                 = 6
   invalid_table_width           = 7
   gui_refuse_filetransfer       = 8
   customer_error                = 9
   OTHERS                        = 10
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
loop at i_bdc_data.
      i_struc-xdismm = 'X'.
      i_struc-xminbe = 'X'.
      i_struc-xdisgr = 'X'.
      i_struc-xdispo = 'X'.
      i_struc-xdisls = 'X'.
      i_struc-xbstfe = 'X'.
      i_struc-xbstmi = 'X'.
      it_bdc_data-matnr = i_bdc_data-matnr.
      it_bdc_data-werks = i_bdc_data-werks.
      it_bdc_data-berid = i_bdc_data-berid.
      it_bdc_data-dismm = i_bdc_data-dismm.
      it_bdc_data-minbe = i_bdc_data-minbe.
      it_bdc_data-disgr = i_bdc_data-disgr.
      it_bdc_data-dispo = i_bdc_data-dispo.
      it_bdc_data-disls = i_bdc_data-disls.
      it_bdc_data-bstfe = i_bdc_data-bstfe.
      it_bdc_data-bstmi = i_bdc_data-bstmi.
      call function 'MD_MRP_LEVEL_CREATE_DATA'
        exporting
          i_matnr                 = it_bdc_data-matnr
          i_werk                  = it_bdc_data-werks
          i_mrp_area              = it_bdc_data-berid
          i_selfields             = i_struc
          i_mdma                  = it_bdc_data
          i_dpop                  = s_dpop
        I_QUEUE_FLAG            = 'X'
         I_SAVE_FLAG             = 'X'
        I_EXTERNAL_COMMIT       = ' '
       IMPORTING
         E_ERROR_RETURN          = var.
        var1 = var.
        write :/ var1.
endloop.
endform.                    " get_data
K.Kiran.

Similar Messages

  • BAPI or function module to add/update MRP Area (MDMA table precisely)

    Hi All,
    can any one suggest me the BAPI to add/update MRP Area. I need to update the fields in MDMA table.
    Thanks in Advance,
    KG

    Dear Brahmankar,
    My actual requirement is that I will get an excel sheet with data to be added to MARC and MDMA table. I guess the report you suggest is good for manually updating/creating/deleting MRP area. It will as good as using BDC in MM02 transaction programatically. Doing BDC will be the last option. If I am able to use any function module then it will good I guess. Please correct me, if I am wrong and suggest me how to proceed.
    Thanks and Regards,
    KG

  • Basic parameters to define the grouping for the Items and the BPs in SAPB1

    Dear Friends,
    What should be the basic parameters to define the grouping for the Items and the Business partners in SAP B1?
    What will be the case when the client wants to classify the sales revenues various categories?

    Hi
    What should be the basic parameters to define the grouping for the Items and the Business partners in SAP B1?
    For items:
    Raw Material.
    Capital Goods
    Finished Item
    Semi Finished Item.
    Conusmables
    Stationary .........etc
    or .
    Metal.
    Rubber
    Wooden.....etc
    Bsuiness Partner
    Foreign or domestic.
    Region wise e.g South,North,East,West.
    State wise  e.g MH,KT,DELHI,GOA....ETC
    What will be the case when the client wants to classify the sales revenues various categories?
    SIMILARLY
    Foreign Revenue, Doomestic Revenue, Region Wise Revenue, State wise, Or Territory wise.......etc
    I hope this clarifies you
    Ashish Gupte

  • No inspection lot can be opened for this material and vendor -QA228

    Hi every one !
    Iam  getting  Error while doing Migo -"No inspection lot can be opened for this material and vendor-QA228"
    we analyze the issue asfollow -
    1.checked Quality Lot-Available
    2.Quality info record- Availble
    3. Quality plan is exist.
    But stil throwing  above Error.

    Hi,
    Check the below threads,
    [No inspection lot can be opened for this material and vendor;
    [No inspection lot can be opened for this material and vendor;

  • Auto To working for one material and not working for other material

    Hi,
    Hope everybody is doing fine.
    I have configured the auto TO. Its working fine for one material and not working for the other material. I checked the material master and wm 1,2 views have the same fileds / values. What could be wrong?
    I didn't setup the back ground processing job. Is that is affecting it?
    thanks for any help.
    regrads,
    KHAN

    Thnaks,
    You are right but then what could be wrong? Its working for one material and not working for otehr material? Any clue?
    Appreciate your time charlie

  • Trying to update the software for my iphone and it keeps saying download has been corrupted. an same for imac update. help?

    trying to update the software for my iphone and it keeps saying download has been corrupted. an same for imac update. help?

    Hi NWL1,
    Thanks for the question. If I understand correctly, the iPhone won't update and is stuck. I would recommend that you read this article, it may be able to help you resolve or isolate the issue.
    If you can't update or restore your iPhone, iPad, or iPod touch - Apple Support
    Thanks for using Apple Support Communities.
    Have a great day,
    Mario

  • I updated my software for my Iphone and my maps disapperead. New maps provided by Apple or of significantly worse quality than my previous Googke maps. How can I get my Google maps back?

    I updated my software for my Iphone and my maps disapperead. New maps provided by Apple or of significantly worse quality than my previous Googke maps. How can I get my Google maps back?

    This app does it well, including StreetView
    http://itunes.apple.com/gb/app/ifindview-connect-to-facebook/id480510706?mt=8

  • Muliple inspection plan for same material and same usage

    Hi,
    I need to create multiple inspection plans for same material with same usage.during the inspection lot creation i need to select any one inspection plan.
    In standard SAP its not possible.Any user exits available for this..
    Regards,
    S.P.Selvathangam

    Dear Selvathangam Palanisamy ,
                                                       My Dear Shayamal is absolutely correct and we are corrently using this SAP facility. You can create 'N' number of inspectio plans for a material and then whenever the inspection lot will created ( Thru a process order or Manual) then you will get the Inspection Lot Status 'CRTD' (Created mode) then you have to select your Inspection Task list manually by two way...
    Either go to QA02 and then select it from the list of multiple plans.
    Or you can directly go from QA32 ...select your inspection lot row and directly click on the Inspection Lot icon to go directly to the inspection lot window to slect the Task list.
    Further there is no need to remove the Automatic Assignment from the QM View of the Material Master as if there is only one task List then system will automatically assign the TASK LIST, if you deselect it then you have to select in every case.
    Thanks

  • No inspection lot can be opened for this material and vendor

    dear sir
    i m facing this error while  doing gr. also how to confirm certificate
    plz guide me
    No inspection lot can be opened for this material and vendor

    Sujit/Raj
    I got th similar error. I closed the issue as Raj said because there was an open inspection lot. Im still nto able to figure out the background or root cause for thi.
    The QIno record doe not have release Qty active and release date is 12/31/9999. Then why we have to close the previous inspection lot before recieving another. It seems like there is a condition or something that tells Inspection are to be done in stages and hence previous or pending inspection lot needs to be closed. But where i this condition coming from, where should i check.
    I created PO and performed GR. I noticed if i perform GR and if the Inpection lot has status REL SPCO SPRQ IRCH then this happens. If the status is just REL SPCO SPRQ  then I'm able to do multiple reciepts and this error does not show up.
    Any idea or suggestions?

  • I am not able to update any apps, when I tap on update, installing, appears for a second and 'update' appears again.

    On my iphone5 , When I tap on update, installing, appears for a second and update appears
    Again and it does not updates, this happens on my ipad2 and iPhone 3 also.

    Settings>General>Software Update is currently only available for IOS 5 and above.
    If your are using IOS 4, you need to connect to iTune (computer) to update software
    http://support.apple.com/kb/HT4972

  • Have an ipod and then got the wife an iphone4. all passwords are screwed up. she can not access playstore cuz she doesn't have password. i can not get find any help on how to get or update a password for the ipod. and then get her a separate password for

    have an ipod and then got the wife an iphone4. all passwords are screwed up. she can not access playstore cuz she doesn't have password. i can not get find any help on how to get or update a password for the ipod. and then get her a separate password for her iphone. we need to save her photos, music, etc to ? icloud and the phone stuff to verizon cloud? so when she gets her new Iphone6 she can have all her "stuff" back on the new phone. hope this makes sense. please offer suggestions here or at [email protected] thanks for your help!

    Oh no! I'm sorry to see there's a lot of confusion here and data shared, x-rayDon. We can definitely work to fix. This happens when two devices share the same Apple ID, so she will need to reset hers. She can do so by assessing this link Apple - My Apple ID. You will need to decide who will keep the account if want separate Apple IDs since purchases cannot be shared unless you do Family Sharing.
    RobinD_VZW
    Follow us on twitter @VZWSupport

  • MacBook Pro 2011- Allowed updates to install for iTunes software and Microsoft office (I think).  After rebooting, computer wouldn't progress past grey apple screen with loading circle.

    I have a MacBook Pro 2011.  I allowed updates to install for iTunes software and Microsoft office (I think).  After rebooting, computer wouldn't progress past grey apple screen with loading circle.  No progression bar ever appeared.  It just sits and spins.  I tried rebooting with Command + Option + R + P and hearing the chime twice....this did not work.
    I also tried Command +Option+R which took me to internet recovery.  From there, I chose reinstall Mac OS X Lion 10.7 but it says my hard drive is locked so I wasnt able to select it.  What do I do???? Help!  I don't want to lose my files and it doesnt appear that I've used Time Machine Back Up.

    macbookpro2011ISU wrote:
    I also tried Command +Option+R which took me to internet recovery.  From there, I chose reinstall Mac OS X Lion 10.7 but it says my hard drive is locked so I wasnt able to select it.
    I you upgraded to OS X 10.8, then use RecoveryHD by holding Command R at boot time (no option) and reinstall OS X over itself that way so your installing  Mountain Lion.
    Also Disk Uility can be used to Repair the Macintosh HD parttion.
    Also you can use that RecoveryHD to format and install OS X onto a external drive, then option/alt key boot from it and access your files on the non-booting internal drive before erasing, reformatting and reinstalling OS X fresh.
    Create a data recovery/undelete external boot drive
    Most commonly used backup methods
    ..Step by Step to fix your Mac

  • BAPI/Fm to Update MRP Area

    Please reply , if you know any BAPI or Function Module to Update MRP area along with Planned Delivery time.
    Thanks,
    Kiran

    Hi Mikesh.
    You can use BAPI  BAPI_OBJCL_CHANGE to chang the charecteristic value in IQ02.  Please try the following code.
    data : lt_val_num  type TABLE OF BAPI1003_ALLOC_VALUES_NUM,
            lt_val_char type TABLE OF BAPI1003_ALLOC_VALUES_CHAR,
            lt_val_curr type TABLE OF BAPI1003_ALLOC_VALUES_CURR,
            lt_return   type TABLE OF BAPIRET2,
            ls_val_char type          BAPIRET2.
    ls_val_char-CHARACT = 'KONDM'.
    ls_val_char-VALUE_CHAR = '01'.
    APPEND ls_val_char to lt_val_char.
    ls_val_char-CHARACT = 'EXTWG'.
    ls_val_char-VALUE_CHAR = '1001 COLORS'.
    APPEND ls_val_char to lt_val_char.
    CALL FUNCTION 'BAPI_OBJCL_CHANGE'
       EXPORTING
         objectkey                = '000000000011049924'
         objecttable              = 'EQUI'
         classnum                 =  'ZCOUP'
         classtype                =  '002'
    *   STATUS                   = '1'
    *   STANDARDCLASS            =
    *   CHANGENUMBER             =
    *   KEYDATE                  = SY-DATUM
    *   NO_DEFAULT_VALUES        = ' '
    * IMPORTING
    *   CLASSIF_STATUS           =
       TABLES
         allocvaluesnumnew        = lt_val_num
         allocvaluescharnew       = lt_val_char
         allocvaluescurrnew       = lt_val_Curr
         RETURN                   = lt_ret.
    read table lt_ret into ls_ret with key type = 'E'.
    if sy-subrc ne 0.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    *    EXPORTING
    *      WAIT          =
    *    IMPORTING
    *      RETURN        =
      endif.

  • My iPad is trying to install an update of Pages for one week and doens't get it. Every time it begins a message " it was not possible do update now" show's up. What should I do?

    My iPad is trying to install an update of Pages for one week and doens't get it. Every time it begins a message " it was not possible do update now" shows up. What should I do? I can't lauch Pages till now.

    The best discussion of resolving the issues is found in the user tip: https://discussions.apple.com/docs/DOC-6562

  • Update Batch Classification for a Material

    Hello friends,
    I'm facing the following problem : A specific BTCI wich simulates MB01 was calling another program called SAPLCTMS to update Batch classification for a Material, this program (SAPLCTMS ) seems to be not necessary after the support package Level 57 (we just installed SAP4.6C). I didn't find any note on OSS for this...
    Now i'm trying to use this BAPI instead of BTCI for the Material batch classification  :
    CALL FUNCTION 'BAPI_OBJCL_CHANGE'
             EXPORTING
                  objectkey          = l_objnum
                  objecttable        = 'MCH1'
                  classnum           = 'ZGB_TIDCLASS'
                  classtype          = '022'
                  status             = '1'
                  keydate            = sy-datum
             TABLES
                  allocvaluesnumnew  = t_valuesnum
                  allocvaluescharnew = t_valueschar
                  allocvaluescurrnew = t_valuescurr
                  return             = t_return.
    But its not working, it keeps asking for a batch number. I guess i'm not using the right FM ?
    Any ideas about this ?
    Thank you in advance for your help !
    Best Regards.
    Edited by: Soufiane FAYSSAL on Jun 18, 2009 11:42 AM

    Hello,
    I am Ashok Chelikani. I am working on the same Issue.
    i am getting following message:
    TYPE ID    NUMBER  MESSAGE
    E       |C1   |003          |Characteristic DIMENSIONSCOLOR not found or not valid
    I        |CL   |736          |Assignment was not created 
    my procedure as follows:
    CLEAR: lv_objnum.
    lv_objnum = I_MSEG-MATNR.
    **Get Object Details
    CALL FUNCTION 'BAPI_OBJCL_GETDETAIL'
    EXPORTING
    objectkey = lv_objnum
    objecttable = 'MARA'
    classnum = 'Z_RMBCH1'
    classtype = '001' 
    TABLES
    allocvaluesnum = lt_alloc_num
    allocvalueschar = lt_alloc_char
    allocvaluescurr = lt_alloc_curr
    return = lt_return.
    IF NOT lt_return IS INITIAL.
    CLEAR: lv_objnum.
    lv_objnum(18) = I_MSEG-MATNR.
    lv_objnum+18(10) = I_MSEG-CHARG.
    CALL FUNCTION 'BAPI_OBJCL_CHANGE'
    EXPORTING
    objectkey = lV_objnum
    objecttable = 'MCH1'
    classnum = 'Z_RMBCH1'
    classtype = '023' 
    tables
    allocvaluesnumnew = lt_alloc_num
    allocvaluescharnew = lt_alloc_char
    allocvaluescurrnew = lt_alloc_curr
    return = lt_return.
    lt_return returing error message. Kindly help me.

Maybe you are looking for

  • I can no longer print to my MX870 from my desktop. The MX870 is on my network, not connected direct

    I can still print from my laptop and my wife's computer. The MX870 is not showing as a printer on my desktop, and when I try to add it, it doesn't show.   Even though it shows as a scanner and fax.   It works as a scanner, but not as a printer. I tri

  • ISA user admin in CRM Productivity BP

    Hello, We have deployed the Business Productivity Package for CRM on EP 6.0 S09 and am having some trouble connecting some of the iViews to our backend SAP CRM 4.0 instance.  ISA is also installed on the same J2EE as the Portal as per an SAP note. I

  • Printing a selected area in PSE8

    I used to print a selected area in an older version (I think it was 4.0) I do this so that I can create large versions of reference photo's what I can paint watercolors from. Does anyone know if this is supported? It may have been the print driver th

  • Middleware issue

    Hi all, Pls guide me on below mention issue.............. Issue Details In our scenario we have SAP CRM 5.0 and ECC 6.0 (IS-U), basically it is an utliity implementation project. Where there is SAP CRM front end and ISU backend. We have done all the

  • IPhoto Starts up when External Drive is Hooked up

    Just as it says on the subject header...........the iphoto program starts up as soon as i have my external drive hooked up. How do i get rid of it? It gets annoying.... thanks in advanced......