Automatic material master creation

Using BAPI_MATERIAL_GET_ALL I transfer the data of a template material to a new material and create it using BAPI_MATERIAL_SAVEDATA.
all works great EXCEPT...
The Inspection Setup Data is not transferred from the template material.
This Inspection Setup Data is entered in under the QM tab but can anybody suggest a solution as to how this data can be transferred automatically?
Thanks for your help, Mark

Hi Mark,
Use BAPI 'BAPI_MATINSPCTRL_SAVEREPLICA' to achieve this. I have attached a little program I have whipped up to modify the Average Inspection Duration field. It's pretty straight forward.
Hope this helps.
Cheers,
Pat.
PS. Kindly assign Points to the posts you find helpful.
*& Report  YPAT_QM_LOAD                                                *
REPORT  ypat_qm_load.
DATA: tbl_inspection TYPE TABLE OF bapi1001004_qmat WITH HEADER LINE,
      return         TYPE TABLE OF bapiret2         WITH HEADER LINE,
      st_qmat        TYPE qmat,
      st_inspection  TYPE bapi1001004_qmat.
DATA: BEGIN OF tbl_data OCCURS 0,
        art    TYPE qpart,
        matnr  TYPE matnr,
        werks  TYPE werks_d,
        mpdau  TYPE qmpdau,
      END OF tbl_data.
PARAMETERS: p_infile LIKE ibipparms-path OBLIGATORY
            DEFAULT 'C:'.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_infile.
  CALL FUNCTION 'F4_FILENAME'
    IMPORTING
      file_name = p_infile.
START-OF-SELECTION.
  PERFORM get_file.
  PERFORM build_bapi_table.
END-OF-SELECTION.
  PERFORM call_bapi.
*&      Form  get_file
FORM get_file .
  DATA: l_filename TYPE string.
  l_filename = p_infile.
  CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      filename                = l_filename
      filetype                = 'ASC'
      has_field_separator     = 'X'
    TABLES
      data_tab                = tbl_data
    EXCEPTIONS
      file_open_error         = 1
      file_read_error         = 2
      no_batch                = 3
      gui_refuse_filetransfer = 4
      invalid_type            = 5
      no_authority            = 6
      unknown_error           = 7
      bad_data_format         = 8
      header_not_allowed      = 9
      separator_not_allowed   = 10
      header_too_long         = 11
      unknown_dp_error        = 12
      access_denied           = 13
      dp_out_of_memory        = 14
      disk_full               = 15
      dp_timeout              = 16
      OTHERS                  = 17.
ENDFORM.                    " get_file
*&      Form  build_bapi_table
FORM build_bapi_table .
  REFRESH tbl_inspection.
  LOOP AT tbl_data.
    CLEAR: st_qmat,
           st_inspection.
    SELECT SINGLE *
           INTO st_qmat
           FROM qmat
           WHERE art   = tbl_data-art   AND
                 matnr = tbl_data-matnr AND
                 werks = tbl_data-werks.
    CALL FUNCTION 'MAP2E_QMAT_TO_BAPI1001004_QMAT'
      EXPORTING
        qmat             = st_qmat
      CHANGING
        bapi1001004_qmat = st_inspection.
    CLEAR tbl_inspection.
    tbl_inspection = st_inspection.
    tbl_inspection-function          = '004'.          "Change
    tbl_inspection-ave_insp_duration = tbl_data-mpdau. "New Ave Insp Dur
    APPEND tbl_inspection.
  ENDLOOP.
ENDFORM.                    " build_bapi_table
*&      Form  call_bapi
FORM call_bapi .
  CALL FUNCTION 'BAPI_MATINSPCTRL_SAVEREPLICA'
    TABLES
      return         = return[]
      inspectionctrl = tbl_inspection[].
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ENDFORM.                    " call_bapi

Similar Messages

  • Approval for Material Master Creation !

    Dear All ,
    My requirement is to have approval process for Material master. is it possible.?
    My Client is expecting approval process same like PO ( release strategy )
    Is there any standard approval  process for every masters which are  created as part of MM transactions.
    Can it  be achieved by means of any workflow.?
    Thanks
    Jinoy

    Hi,
    Yes it can be achieved by Work flow & also through the Enterprise Portal development.
    If you have Workflow consultant you can take a help in setting up the approval for Material master creation.
    If you want high fund & centralization of Material master you can go for EP development but Cost & effort will be on higher side.
    Discuss with your Workflow consultant he will help you.
    rgds
    gsc

  • Material Master creation workflow

    Hi everyone....
    Last week I went on the BIT601 training course and I'm now tryinig to create my first workflow for material master creation, so please forgive my rather noobish questions. I think this must be a common workflow but I'm sure every company has a different process.
    My process is as follows:
    - User creates basic data view for material master in MM01.
    - Workflow is triggered when material is saved.
    - Work item arrives in inbox of master data enigneer who completes all material master views.
    - Mail is sent to workflow initiator to inform that material is complete.
    - End of workflow
    I have defined the start event CREATED from business object BUS1001006 in my workflow definition. I have defined a standard task for the first step in my workflow using bus object BUS1001006 with method Create. The workflow starts correctly however ...
    My question is how do I get the material number to pull through to my first step? I am assuming I need to setup some binding to pull the material number into the workflow container? 
    Can someone please point in the right direction.
    Many thanks,
    Neil

    wow, thanks for the super quick reply Rob!
    I figured it must be some binding I had not done.
    So ... I go to my Start events in my workflow header, I see I have only the "auto-generated" binding i.e. EVTCREATOR > WFINITIAOR ....
    now, I see EVTOBJECT as a possible container object from the event side of the window (left hand side) but what do I link it too? I was kinda expecting to see my business object as a possible container object in the workflow side of the screen (right hand side).
    I really hope that makes sense... If I understand correctly, the idea is to link the event object to the business object container element ... but if thats the case why can't I see my business object in the workflow side of the binding window?
    Many thanks for taking the time to help a noob
    [edit] ... I may have partially answered my own question ... I think I need to define the properties of my business object in my workflow container element such that its is an input field? ...
    I'm going home now... will carry on with this in the morning.
    Edited by: Neil Ward on Oct 4, 2010 6:17 PM

  • Workflow to approve Material Master creation

    Dear all,
    I would like to create workflow to approve Material Master creation as below:
    When Material is created -> Check & Approval (Yes) -> Material is active
                           -> Check & Approval (No)   -> Material is inactive
    How can I do that?
    Could you pls help me to solve this?
    Thanks,
    CH

    Hi,
    Before designing the workflow, you need to find what is the business object and what is the event which gets triggered when material master is created... you can do that using event trace....
    1. SWELS - switch on trace
    2. Create material
    3. SWEL - check trace to find which event is fired
    This will give you business object name..
    Now start building workflow using SWDD... Go thru basic steps for designing workflow...

  • Standard Adobe Form for SAP Material Master Creation

    Hi,
    Did SAP develop standard adobe interactive form for Material Master Creation?
    I heard SAP delivered standard forms for Customer Master and Vendor Master. I am not sure about Material Master Form. If any one knows about Adobe Forms for Material Master... please rerply.
    Thanks in advance.

    Check yourself here:
    List of SAP standard Adobe forms: Go to http://service.sap.com/erp  (SAP ERP) -> Media Library - SAP ERP Overview -> Detailed information cross ERP -> Adobe Forms for SAP ERP
    Standard programs: Standard program for Adobe forms
    Regards Otto

  • Automatic activation of batch during material master creation

    Dear All
    Is it possible to activate batch management in material master while creation. This is required for specific material type and field MARA-XCHPF should be set automatically.
    Thanks in advance
    Regards
    Yogesh

    Dear,
    In OMS9 field for batch management MARC-XCHPF
    first check which field selection key is assigned to your material type in the filed slection group 212 (OMSR) there is field called MARA-XCHPF, and MARC-XCHPF.
    couble click on these fields and there is an indicator " prapose field content" , you need to select that indicator.
    Regards,
    R.Brahmankar

  • Default material code during material master creation

    Dear All,
               While I am trying to create any material in MM01 screen , system automatically takes a material code .So I have to remove that code from there then put my desired material code and then proceed .
                I want to know why system takes that perticular  code during material code creation .I want to remove it permanently .
                Please suggest what I have to do ?
    Regards
    Abhijit Das

    Dear Abhijit,
    Material Number range & Internal or external number range setting is done in SPRO under
    Logistic General>material master>basic setting>material type>Define number range for a perticular material type.
    Now if u want to have your own desired code go on above path,Select your material type & tick for external number range & give range of external number( interval).
    This will solve your problem,
    Vivek

  • Defaulting values in material master creation

    Hi,
    I want to have some filed values to be appeared as default in all the views while creation of material master.
    By user settings, I can restrict Org level values such as C Code,S Org Distribution Channel etc etc.
    But how to make field values such as account assignment grop,division,valuation class,price control,transport grp,loading grp etc appearing default so that user does not have to think.
    Regards,
    manOO

    Hi,
    You can set values for Parameter IDs of the fields that you want to default.
    Set values in system -> user profile -> own data under parameters tab.
    For example Disision's parameter id is 'SPA'. You can set a default value for division by giving proper value for SPA under parameters data in own data.
    Hope this will help.
    Regards,
    Naveen.

  • Bydefault selection of profit centers during material master creation.

    Dear SAP Experts,
    My business wants that when ever they want to create a new material the profit center field should come bydefault after the selection of the plant.
    Each plant has been associated with a profit center.
    Is it possible , If yes then How.
    Please guide me.
    Regards
    Debjeet Banerjee

    There is no direct link of profit center and plant , the profit center is linked with plant via material master.So you cannot default the profit center when you select the plant while creating the MMR.
    Better try with any custom table were you can make this link and default it while creation of material master.

  • Material master creation error through LSMW

    Hi,
    I have a problem with creation material master through LSMW with object type BAPI.  I use below import methods
    Business Object BUS1001006 
    Method                SAVEDATA
    Message Type    MATMAS_BAPI
    Basic Type          MATMAS_BAPI03
    Material number is configured length of 12 with leading zeros.
    In my text file material number is given as XXXXXXXXXXX which is 11 digits. When I start IDoc processing it issues an error message u201CMG019 the numeric material number & was transferred without leading zerosu201D.
    Then I add 0 to material number in the file (it becomes 0XXXXXXXXXXX) and run IDOC processing it issues same error message again.  
    How I can resolve this issue?
    Thanks

    Hi,
    Please check the below link...
    Re: Creating new material using i/b MATMAS IDOC
    and also check the OSS note 707602.
    Hope it may help you.
    Kuber
    Edited by: kuberk on Aug 14, 2011 4:00 AM

  • Material Master Creation Using BAPI

    Hi,
    I m using BAPI_MATERIAL_SAVEDATA for Material creation using BAPI.
    Now the problem is , i have created a Screen exit long back in Purchasing view.. the corresponding Z field is created in table MARC..
    How can i pass value to this Z field using BAPI.
    i tried with BAPI_MARC.. my Z field is not coming in that structure.
    Can anyone guide me how can this be achieved.
    Thanks in Advance
    Aravindh Mani

    Hi,
    The Function Module BAPI_MATERIAL_SAVEDATA has the options to pass the Z fields. There exits a structure parameters
    EXTENSIONIN
    EXTENSIONINX
    in BPAI. In EXTENSIONIN pass the data and value part you can pass  in EXTENSIONINX. So this will update the Z fileds in material
    master .

  • Error-Material Ledger currency were changed in material master creation

    Hi all,
    Iam trying to create a material master record in IDES database.
    When iam entering into accounting 1 tab system is throwing the following error "Material Ledger currency were changed".
    Without entering necessary information in the accounting tab i cannot proceed further , so kindly suggest me what is the necessary  setup that i need to do to avoid this error.
    Expecting a reply from you all.
    Thanking You
    Gopala

    Hi,
    In the configuration the material ledger might be active in the valuation area.If it is active in the valuation area then the check box in the material master is automatically checked.
    If the material ledger is active for a particular valuation area, all materials in the valuation area are valuated using the material ledger.
    If you activate the material ledger for a plant, you should also activate it for all the other plants in the company code. This ensures that the accounts in Financial Accounting and Materials Management are reconciled.
    You can deactivate this in SPRO-Controlling -General controlling--Multiple valuation approaches-Basic settings-Check material ledger settings.
    But be careful about the controlling settings while changing this.

  • During Material master creation

    hi friends,
    in my system during material creation  system will through the material number,
    my doubt is, i entered into material master and system thrown the number too but half way i exit that transaction with out saving the material,  for my next transaction of material master system through the next number why
    and whenever i entered into mmo1 view screen system counted and throw a material number why and how can i delete the numbers
    thanks
    ganesh

    hi,
    >
    Can flag for deletion from
    Logistics --> Materials management --> Material master -->Other --> Archiving --> Material.
    >
    Can see these Deleted numbers in SARA tables or DB15..
    >
    You can see all normal material numbers in MARA...IN SE16 Tcode...
    Regards
    Priyanka.P
    AWARD IF HELPFULL

  • Problem with BAPI of Material Master creation

    Hi,
    I am creating material master(mm01) through BAPI_MATERIAL_SAVEDATA.
    Program is working fine but when i m checking in MM03 to display uploaded data through BAPI, i cant able to see material which i created to through BAPI but i can see in MARA table.
    i dont know wht is the problem ?
    can anybody let me know abt this ?

    then u are not committing the work.
    flow will be like this
    call ' BAPI'
    if return[] is initial.
    commit work.
    else.
    endif.
    Regards
    peram

  • Issue In Material Master Creation.

    Hi All,
    We are migrating from ECC 5.0 to ECC 6.0.
    We have created a Test system  in 6.0 which is replica of our existing Production system in 5.0. I have checked relevant config settings everything is ok.
    While doing testing we observed following issues:
    1.) We are not able to Create Master Data which is Material Master, after entering all relevant information we are getting error: erro Log for the same says:                                                                               
    1.) E MG 144 : The field 'Care Code' is defined as a required field; it does not contain an entry MARA-CARE_CODE
    2.) The field 'GI Proc. Time' is defined as a required field; it does not contain an entry MARC-GI_PR_TIME
    3.) E MG 144 : The field 'Purchasing Across Purchasing Group' is defined as a required field; it does not contain an entry MARC-MULTIPLE
    Please sugest if there is any SAP Note we need to implement for this.
    thanks & regards,
    Prashant Rathore.

    Hi Prashant,
    the 'required'-state as well as the occurance of a field on a screen        
    can be customized. You should proceed as follows to resolve the issue:                                                                               
    1. Call transaction OMSR                                                                               
    2. Press the 'Field Name'-Button, enter a field there, for instance         
        MARA-CARE_CODE, and press enter. This will lead you to the           
       settings for that field.                                                                               
    3. Now press the button with the green arrow on the right to the field.     
       By this, yopu reached the screen where field selection can be            
       maintained, the decision whether the field should be required            
       is customized.                                                                               
    4. The above list is the list of fields which are customized together,      
       as a field selection group. The below list defines whether the field     
       is required. If you dont use that field at all, it should be             
       sufficient to take care that for no field reference, 'entry required'    
       is switched on.                                                                               
    5. Now proceed the same for the other fields, which have not been in        
       the same field selection group.                                          
    Regards,
    Mauro
    Edited by: Mauro Bianchi on Jul 23, 2010 3:44 PM

Maybe you are looking for

  • Does anyone know how to play Mobile Youtube videos in Windows 7?

    http://m.youtube.com/ I am currently trying to make it work in Firefox 3.6 without success.

  • Safari in Leopard NOT WORKING PLEASE HELP

    I just installed Leopard on my iBook G4 and for some reason I cannot get safari to work at all. When I try to open safari I get a notification saying it unexpectedly quit before the GUI even loads. I tried to reinstall the Safari 3 beta and when I tr

  • How to add page count of PDF to the file name?

    I need help with an applescript that can look at a pdf, determine the page count in file and then add that value to the end of the file name in front of the .pdf ex. original name "map with pages4c.pdf" renamed "map with pages4c_48.pdf" Any help woul

  • Customer created in multiple credit control areas.

    Dear  friends, In our current system, whenever a business partner is created, the business partner is being created in all the credit control areas that are permitted for that company code, despithe business partner having only one credit control are

  • Setting alert rule in RWB

    Hi Experts, i am working on ccms alerts. am done with the alert configurations now. Am at the final stage -ALERT RULE. now i want to receive alerts for all channels except for one particular sender and receiver service. please let me know how do i ex