Create Material Master using workflow (urgent)

Hello all,
We have an urgent client requirement to create material master using workflow.
Different views for the material master will be created by the relevant departments.
ex: Accouting 1, 2 will go to accounts deptt.
I have studied the workflow tutorial  (20 units) on <b>SAP help</b> for leave of absence and have some understanding of objects, methods, bindings etc
I am however finding it very difficult to define the steps to create a workflow for material master. Are there any standard steps already defined that i can use.
Any help/inputs will be greatly appreciated.
Regards
S. Datar

Hi,
You need to speak to a workflow consultant.
You can get workflow to do many things (including creating a material master) but it takes a lot of coding and design.
For those of you who think that workflow is just used for the standard SAP workflow tasks, you have to realise that workflow is far more powerful and far more useful than many people think.
It is always referred to as "Event triggered messaging" but it is more accurate to call it "Event triggered events".
Within workflow you can chain together many different transactions and or ABAPS and so you can get it to do virtually anything you want (as long as you know how).
In this case you need the workflow to trigger an ABAP or BTCI session etc. that works through the MM01 transaction. It is relatively easy to get it to do this, but I am not technical enough to be able to help with the steps involved (sorry)
Steve B

Similar Messages

  • CREATING MATERIAL MASTER USING BAPI-GROSS_WT VALUE IS NOT SEEN

    HI GUYS,
    I AM  CREATING MATERIAL MASTER USING BAPI_MATERIAL_SAVEDATA.I AM LOADING THE  VALUES FROM A FLAT FILE .
    THE VALUE FOR  GROSS_WT IS NOT SEEN WHEN THE MATERIAL IS CREATED.
    THE BAPI_MARM STRUCTURE HAD THE FILED BRGEW(GROSS_WT).
    I AM ABLE TO LOAD NET WT CORRECTLY BUT AM NOT ABLE TO LOAD GROSS WT.
    ANY SUGGESTIONS AS TO WHY THIS IS HAPPENING AND PROVIDE ME WITH A  SOLUTION.
    THANKS.

    Error: The numeric material number 1000000 was transferred without leading zeros for material: 1000000
    From next timepost only related code to make it look better.
    Use conversion exit for MATNR field.

  • Create Material Master using BAPI_MATERIAL_SAVEDATA - just the basic view

    Hi,
    I want to create new material master ( just the basic view ) using BAPI_MATERIAL_SAVEDATA.
    No error found in the return parameter, but the material was not created.
    Here is my code :
    DATA : ld_headdata LIKE bapimathead,
           lt_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE,
           lt_return_comit LIKE bapiret2 OCCURS 0 WITH HEADER LINE,
           lt_return_cl LIKE bapiret2 OCCURS 0 WITH HEADER LINE,
           ld_datum(10),
           ld_uzeit(10).
    DATA: ld_matdesc LIKE bapi_makt OCCURS 0 WITH HEADER LINE,
          ld_clientdata  LIKE bapi_mara.
    Regards,
    Hary
    ld_headdata-material = 'MATERIAL-01'.
    ld_headdata-ind_sector  = 'M'.
    ld_headdata-matl_type = 'ERSA'.
    ld_headdata-basic_view = 'X'.
    ld_matdesc-matl_desc = 'TEST MATERIAL'.
    ld_matdesc-langu = sy-langu.
    APPEND ld_matdesc.
    ld_clientdata-base_uom = 'PC'.
    CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
      EXPORTING
        headdata                    = ld_headdata
        clientdata                  = ld_clientdata
       clientdatax                 =
      PLANTDATA                   =
      PLANTDATAX                  =
      FORECASTPARAMETERS          =
      FORECASTPARAMETERSX         =
      PLANNINGDATA                =
      PLANNINGDATAX               =
      STORAGELOCATIONDATA         =
      STORAGELOCATIONDATAX        =
      VALUATIONDATA               =
      VALUATIONDATAX              =
      WAREHOUSENUMBERDATA         =
      WAREHOUSENUMBERDATAX        =
      SALESDATA                   =
      SALESDATAX                  =
      STORAGETYPEDATA             =
      STORAGETYPEDATAX            =
      FLAG_ONLINE                 = ' '
      FLAG_CAD_CALL               = ' '
      NO_DEQUEUE                  = ' '
      NO_ROLLBACK_WORK            = ' '
    IMPORTING
       return                      = lt_return
    TABLES
       materialdescription         = ld_matdesc
      UNITSOFMEASURE              =
      UNITSOFMEASUREX             =
      INTERNATIONALARTNOS         =
      MATERIALLONGTEXT            =
      TAXCLASSIFICATIONS          =
      RETURNMESSAGES              =
      PRTDATA                     =
      PRTDATAX                    =
      EXTENSIONIN                 =
      EXTENSIONINX                =
      NFMCHARGEWEIGHTS            =
      NFMCHARGEWEIGHTSX           =
      NFMSTRUCTURALWEIGHTS        =
      NFMSTRUCTURALWEIGHTSX       =
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      WAIT          =
    IMPORTING
       return        = lt_return_comit

    hi
    Hope it will help you.
    <REMOVED BY MODERATOR>
    REPORT z34332_bdc_create_material .
    data: la_headdata type BAPIMATHEAD,
    la_clientdata type BAPI_MARA,
    la_CLIENTDATAX type BAPI_MARAX,
    la_return type BAPIRET2.
    data: i_materialdescription type table of BAPI_MAKT,
    wa_materialdescription like line of i_materialdescription.
    la_headdata-MATERIAL = '000000000000000004'.
    la_headdata-IND_SECTOR = 'M'.
    la_headdata-MATL_TYPE = 'FERT'.
    la_clientdata-BASE_UOM = 'FT3'.
    la_CLIENTDATAX-BASE_UOM = 'X'.
    la_clientdata-MATL_GROUP = '01'.
    la_CLIENTDATAX-MATL_GROUP = 'X'.
    wa_materialdescription = 'TEST'.
    append wa_materialdescription to i_materialdescription.
    clear: wa_materialdescription.
    CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
    EXPORTING
    headdata = la_headdata
    CLIENTDATA = la_clientdata
    CLIENTDATAX = la_CLIENTDATAX
    * PLANTDATA =
    * PLANTDATAX =
    * FORECASTPARAMETERS =
    * FORECASTPARAMETERSX =
    * PLANNINGDATA =
    * PLANNINGDATAX =
    * STORAGELOCATIONDATA =
    * STORAGELOCATIONDATAX =
    * VALUATIONDATA =
    * VALUATIONDATAX =
    * WAREHOUSENUMBERDATA =
    * WAREHOUSENUMBERDATAX =
    * SALESDATA =
    * SALESDATAX =
    * STORAGETYPEDATA =
    * STORAGETYPEDATAX =
    * FLAG_ONLINE = ' '
    * FLAG_CAD_CALL = ' '
    IMPORTING
    RETURN = la_return
    TABLES
    MATERIALDESCRIPTION = i_materialdescription
    * UNITSOFMEASURE =
    * UNITSOFMEASUREX =
    * INTERNATIONALARTNOS =
    * MATERIALLONGTEXT =
    * TAXCLASSIFICATIONS =
    * RETURNMESSAGES =
    * PRTDATA =
    * PRTDATAX =
    * EXTENSIONIN =
    * EXTENSIONINX =
    write: la_return-TYPE, ',', la_return-MESSAGE.
    clear: la_headdata, la_return, la_clientdata, la_clientdatax.
    Edited by: Alvaro Tejada Galindo on Feb 19, 2008 3:23 PM

  • Create material master using BAPI .(Mat. internal number range)

    I would like to create the material using BAPI. (Material is internal number range).
    I am trying to create the material using BAPI  BAPI_MATERIAL_SAVEDATA, but material number is required field as per BAPI documentation .
    Can you please suggest me the function modules or BAPI to load materials which are in internal number range.
    Regards
    Badari

    Hi ,
    Use FM 'MATERIAL_NUMBER_GET_NEXT' to get next available material #.
    You can use that material # in BAPI 'BAPI_MATERIAL_SAVEDATA'.
    Cheers,
    Vikram

  • Unable to create material master

    Hi
    I tried creating material master using tcode MM01. I have done the basic config to start using MM (i am a FICO guy).
    When i create the material master, and try to save, it opens another window of "ABAP Debugger Controls Session" and I am not sure what to do there...when i exit from the debugger screen, it takes me back to SAP Easy Access Menu...
    any idea guys why this error is coming.
    thanks
    Vikash

    Hi,
    You should get your ABAPer to sit down with you while you are maintaining material master creation and once the same error was encountered, you shall ask them to turn off the 'debugging mode' of the related program.
    Cheers,
    HT

  • Idoc - Create material master

    Hi All,
      I'm trying to create material master using idoc basic type /AFS/MATMAS04, message type J3AMAT.
    Processing the idoc i get the error "The function module IDOC_INPUT_MATMAS01 and the application object type BUS1001006 which were determined are not valid for this IDoc".
    It's true that in table EDIFCT there is not this record. but i would like to use the object type BUS1001. How the object type is determined?
    Regards
       Federico

    I found the solution bymyself
    check  Note 624163 - MATMAS-IDoc not linked to the material
    Regrds

  • How to Create material master workflow

    Hi All,
    Can anybody tell me how to create material master workflow?
    i need to customize the workitem  for creating data in different views in MM01 transaction with restriction to particular user.
    Regards,
    Priti

    Hi,
    This link is to  display a material.My requirement is to create a workflow which will allow a responsible person to enter data for specific department data e.g Purchase,Accounting etc.Initially anyone can create data using basic data1 and basic data2 views.After this my workflow will be triggered and it will go to next person who is responsible to enter Purchase data and then Accounting data.
    Plz help me to create different views with respect to person.
    Thanks in advance.

  • URGENT:Creating customer master using Sd_Customer_Maintain_all

    hello all ,
    I am creating customer master using SD_Customer_Maintain_All.I will be thankful if somebody Can  tell me how to pass data to this function module.Better if somebody can provide code.
    Thanks.
    Sandeep.

    hello all ,
    I am creating customer master using SD_Customer_Maintain_All.I will be thankful if somebody Can  tell me how to pass data to this function module.Better if somebody can provide code.
    Thanks.
    Sandeep.

  • ISR For Approve Create Material Master

    I have requirement apply ISR for Control Create Master.Example User1 input information about purchasing group and send to User2. And then User2 input information about Plant and send to next user for approve.If already send to last user and submit,ISR will be create material master.
    But i don't know could be apply ISR for this case, Because i find for Costing and Banking.
    Please help me. Thank you very much

    Hi,
    You need to speak to a workflow consultant.
    You can get workflow to do many things (including creating a material master) but it takes a lot of coding and design.
    For those of you who think that workflow is just used for the standard SAP workflow tasks, you have to realise that workflow is far more powerful and far more useful than many people think.
    It is always referred to as "Event triggered messaging" but it is more accurate to call it "Event triggered events".
    Within workflow you can chain together many different transactions and or ABAPS and so you can get it to do virtually anything you want (as long as you know how).
    In this case you need the workflow to trigger an ABAP or BTCI session etc. that works through the MM01 transaction. It is relatively easy to get it to do this, but I am not technical enough to be able to help with the steps involved (sorry)
    Steve B

  • Create Material Master Record with Text

    Hi, I am looking to create material Master Data via ABAP.  I currently have some code that creates the Master Data Characteristic value I want, but I need the text as well.  Can someone tell me what I need to do to add the text for the Master Data Characteristic value?
    Here's what I have using CL_RSDMD_UPDATE_MASTER_DATA=>UPDATE_ATTRIBUTES_STATIC
    TYPE-POOLS: RS, RSSM.
      DATA: T_ZFREETEXT   LIKE STANDARD TABLE OF ZFREETEXT.
      DATA: T_INFO        TYPE RSSM_S_MINFO.
      DATA: RETURN_STATUS TYPE RSARR_T_IDOCSTATE.
      DATA: RETURN_SUBRC  LIKE SY-SUBRC.
      DATA: MSG TYPE RS_T_MSG.
      DATA: L_R_ACTIVATE_MASTER_DATA TYPE REF TO CL_RSDMD_ACTIVATE_MASTER_DATA.
      INSERT ZFREETEXT INTO TABLE T_ZFREETEXT.
      CALL METHOD CL_RSDMD_UPDATE_MASTER_DATA=>UPDATE_ATTRIBUTES_STATIC
        EXPORTING
          I_IOBJNM        = '0MATERIAL'     " Technical name of InfoObject
          I_CHAVL_ENQUEUE = RS_C_FALSE
          I_T_DATA        = T_ZFREETEXT
          I_S_MINFO       = T_INFO
          I_MONITORING    = RS_C_FALSE
        CHANGING
          C_T_IDOCSTATE   = RETURN_STATUS.
      IF SY-SUBRC <> 0.
        RETURN_SUBRC = 'Error happened'.
      ELSE.
        RETURN_MSG = 'Process Completed Successfully'.
        CREATE OBJECT L_R_ACTIVATE_MASTER_DATA
          EXPORTING
            I_IOBJNM            = '0MATERIAL'
            I_P_Q_HAVE_TO_EXIST = RS_C_FALSE.
        IF SY-SUBRC = 0.
          L_R_ACTIVATE_MASTER_DATA->ACTIVATE(
          IMPORTING
          E_SUBRC = RETURN_SUBRC
          CHANGING
          C_T_MSG = MSG ).
        ENDIF.
      ENDIF.

    Dear Kenneth,
    do you need to add master data during load of transaction data in planning scenario? If yes, you can do this with a planning function of type exit in the INIT function module.
    I think you've to use the table ETO_CHAS (table for char. combinations) and all kind of char. combinations has to be transfered.
    data:
    l_s_chas type /1SEM/_YS_CHAS_"YOURCLIENT"YOURPLANNINGAREA",
    l_r_co_area type range of /bi0/oico_area,
    l_s_costcenter type /bi0/pcostcenter.
    field-symbols:
    <f_coar> type /bi0/oico_area,
    <f_cctr> type /bi0/oicostcenter.
    select * from /bi0/pcostcenter into l_s_costcenter
                 where co_area IN l_r_co_area
                 and objvers = 'A'.
    <f_coar> = l_s_costcenter-co_area.
    <f_cctr> = l_s_costcenter-costcenter.
    INSERT l_s_chas INTO TABLE eto_chas.
    endselect.
    Regards, Clemens

  • LSMW--Create Material master data

    Hi,
    When I use LSMW to create material master data, I set up all step, but when I go to last step "13 Run Batch Input Session", there is error message like "Select at least one view" in moudle SAPLMGMM, screen 0070, anybody can tell me what is problem, thanks a lot.

    Hi,
    This is due to error while recording for MM01,
    Please do a Repeat recording and ensure that once the material number, industry sector and material type is entered, on the next screen you need to select all or at least a single view to create the MMR.
    Regards
    Merwyn

  • BAPI or FM Required to create Material Master

    IS there any BAPI or Function module avaiable in SAP to create Material Master.
    The following Two BAPIs uses Call transaction, which I dont want.
    BAPI_RETAILMATERIAL_CREATE 
    BAPI_STANDARDMATERIAL_CREATE
    Please let me know if any other Function module or BAPI Avaiable in the system.
    Thanks
    Aman

    Yep,  this one works pretty good.
    call function 'MATERIAL_MAINTAIN_DARK'
             exporting
                  sperrmodus                = ' '
                  kz_prf                    = 'W'
                  max_errors                = ' '
                  p_kz_no_warn              = 'X'
                  kz_verw                   = 'X'
                  kz_aend                   = 'X'
                  kz_dispo                  = 'X'
                  kz_test                   = ' '
                  flag_muss_pruefen         = ' '
                  call_mode                 = 'ACT'
             importing
                  number_errors_transaction = numerror
                  matnr_last     = last_matnr
             tables
                 amara_ueb      = i_mara    "Basic Data
    *             amakt_ueb      = i_makt    "Descriptions
                 amarc_ueb      = i_marc    "Plant
    *             amard_ueb      = i_mard    "Storage Location
    *            AMFHM_UEB      = I_MFHM    "Production Tools
    *             amarm_ueb      = i_marm    "Units of Measure
    *            AMEA1_UEB      = I_MEA1    "Internal Mangagement -  EANs
    *             ambew_ueb      = i_mbew    "Accounting/Costing
    *             asteu_ueb      = i_steu    "Tax Data
    *             astmm_ueb      = i_steumm  "Tax Data
    *            AMLGN_UEB      = I_MLGN    "Warehouse Data
    *            AMLGT_UEB      = I_MLGT    "Storage Type Data
    *            AMPGD_UEB      = I_MPGD    "Change Documents
    *            AMPOP_UEB      = I_MPOP    "Forcast Parameters
    *            AMVEG_UEB      = I_MVEG    "Total Consumption Data
    *            AMVEU_UEB      = I_MVEU    "Unplanned Consumption Data
    *             amvke_ueb      = i_mvke    "Sales Data
    *             altx1_ueb      = i_ltx1    "Sales Text
    *            AMPRW_UEB      = I_MPRW    "Forcast Values
                 amfieldres     = i_delfields
                 amerrdat       = i_errors
             exceptions
                  kstatus_empty             = 01
                  tkstatus_empty            = 02
                  t130m_error               = 03
                  internal_error            = 04
                  update_error              = 05
                  too_many_errors           = 06.
    Regards,
    Rich Heilman

  • How to upload material master using BAPI

    I have a flat file with 3 fields MATNR,MAKTX,MEINS and I want to create material master with 2 views basic data1 & basic data2 with three fields using BAPI
    Can anyone tell me how to do this only using three fields and 2 views
    and also i want to know what is the exact difference between session call transaction BAPI and LSWM methods.
    Thank you,
    Pradeep Reddy M.

    Hi Pradeep Reddy Miriyala,
    This a example you can use, the views are related with each table only have to adapt to your case.
    Best regards
    Jaime Cordeiro
    *& Report  ZMM01_BAPI_01                                               *
    REPORT  ZMM01_BAPI_01                           .
                   STRUCTURE  DECLARATIONS                             *
    TABLES: BAPIMATHEAD,  "Headerdata
            BAPI_MARA,    "Clientdata
            BAPI_MARAX,   "Clientdatax
            BAPI_MVKE,    "SalesData
            BAPI_MVKEX,   "SalesDatax
            BAPI_MARC,    "Plantdata
            BAPI_MARCX,   "Plantdatax
            BAPI_MBEW,    "ValuationData
            BAPI_MBEWX,    "ValuationData
            BAPI_MLGN,    "Storage
            BAPI_MLGNX,   "StorageX
            BAPI_MAKT,    "Material description
            BAPI_MARM,
            BAPI_MARMX,
            bapi_mean,
            BAPI_MLAN,
            BAPIRET2.     "Return messages
    DATA: BEGIN OF LSMW_MATERIAL_MASTER,
    > Initial Data
         matnr(18),
         mtart(4),
         WERKS(4),
         VKORG(4),
         VTWEG(2),
         LGNUM(3),"retirar
    > Basic Data 1
         MAKTX(40),
         MEINS(3),
         MATKL(9),
         BISMT(18),
         SPART(2),
         PRDHA(18),
         BRGEW(17),
         NTGEW(17),
         GEWEI(3),
         VOLUM(13),
         VOLEH(3),
         EAN11(18),
         NUMTP(2),
    > Sales 1
         DWERK(4),
         TAXKM(1),
    > Sales 2
         KTGRM(2),
         PRODH(18),
         MTPOS(4),
    > Sales: General/Plant
         MTVFP(2),
         TRAGR(4),
         LADGR(4),
         PRCTR(10),
    > Purchasing
    Novas entradas
         EKGRP(3),
         KAUTB(1),
         XCHPF1(1),
         EKWSL(4),
         WEBAZ(3),
         INSMK1(1),
         KORDB(1),
    > Foreign Trade
         STAWN(17),
         MTVER(4),
         HERKL(3),
         HERKR(3),
    > Purchase Order Text View
    Identificar Campos
         TextoEN(100),
         TextoPT(100),
         TextoPL(100),
         TextoES(100),
    > MRP1
         DISGR(4),
         DISMM(2),
         DISPO(3),
         DISLS(2),
         BSTMI(18),
         BSTRF(13),
    > MRP2
         BESKZ(1),
         RGEKZ(1),
         LGPRO(4),
         LGFSB(4),
         EPRIO(4),
         WEBAZ1(3),
         PLIFZ(3),
         FHORI(3),
    > MRP3
         PERKZ(1),
         STRGR(2),
         VRMOD(1),
         VINT1(3),
         VINT2(3),
    > MRP4
         ALTSL(1),
         FEVOR(3),
    > Work Sch
         INSMK(1),
         XCHPF(1),
         UEETO(3),
    > Plant Storage 1
         MHDRZ(4),
         MHDHB(4),
    > Plant Storage 2
         PRCTR1(10),
         EPRIO1(4),
    > WM 1 S01 comum a todos
         LTKZA_S01(3),
         LTKZE_S01(3),
         LGBKZ_S01(3),
    > WM 1 SHV
         LTKZA_SHV(3),
         LTKZE_SHV(3),
         LGBKZ_SHV(3),
    > WM 1 SQW
         LTKZA_SQW(3),
         LTKZE_SQW(3),
         LGBKZ_SQW(3),
    > WM 2
         LHMG1(13),
         LHME1(3),
         LETY1(3),
         LHMG2(13),
         LHME2(3),
         LETY2(3),
         LHMG3(13),
         LHME3(3),
         LETY3(3),
    > Accounting 1
         BKLAS(4),
         VPRSV(1),
         VERPR(23),
         PEINH(5),
       END OF LSMW_MATERIAL_MASTER.
    DATA:V_FILE TYPE STRING.
    DATA:VolumUnitConv(3).
    DATA:UnitConv(3).
                   INTERNAL TABLE DECLARATIONS                         *
    *to store the input data
    DATA:
      BEGIN OF  it_matmaster OCCURS 0.
            INCLUDE STRUCTURE LSMW_MATERIAL_MASTER.
    DATA:
      END OF it_matmaster.
    *for material description
    DATA:BEGIN OF IT_MATERIALDESC OCCURS 0.
            INCLUDE STRUCTURE BAPI_MAKT .
    DATA:END OF IT_MATERIALDESC.
    *FOR gross wt
    data: begin of it_uom occurs 0.
            include structure BAPI_MARM.
    data:end of it_uom.
    DATA: BEGIN OF IT_UOMX OCCURS 0.
            INCLUDE STRUCTURE BAPI_MARMX.
    DATA:END OF IT_UOMX.
    data:begin of it_mean occurs 0.
            include structure bapi_mean.
    data:end of it_mean.
    DATA: BEGIN OF it_MLAN OCCURS 0.
            include STRUCTURE BAPI_MLAN.
    DATA: END OF it_MLAN.
    DATA:BEGIN OF IT_MLTX OCCURS 0.
            INCLUDE STRUCTURE BAPI_MLTX.
    DATA:END OF IT_MLTX.
    *to return messages
    DATA:BEGIN OF IT_RETURN OCCURS 0.
            INCLUDE STRUCTURE BAPIRET2.
    DATA:END OF IT_RETURN.
    DATA : imat TYPE TABLE OF bapimatinr WITH HEADER LINE.
    DATA: text LIKE bapi_mltx OCCURS 0 WITH HEADER LINE.
    DATA: matnrAct(18),oldMart(4).
    SELECTION SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-002.
    PARAMETERS:P_FILE LIKE RLGRAP-FILENAME OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B1 .
    AT SELECTION SCREEN
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          PROGRAM_NAME  = SYST-CPROG
          DYNPRO_NUMBER = SYST-DYNNR
          FIELD_NAME    = 'P_FILE'
        IMPORTING
          FILE_NAME     = P_FILE.
                   TO UPLOAD THE DATA                                  *
    START-OF-SELECTION.
      V_FILE = P_FILE.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                      = V_FILE
         FILETYPE                      = 'ASC'
         HAS_FIELD_SEPARATOR           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
        tables
          data_tab                      =  IT_MATMASTER
       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
      IF sy-subrc <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      check sy-subrc eq 0.
                   DATA POPULATIONS                                    *
      LOOP AT  IT_MATMASTER.
        IF IT_MATMASTER-MATNR EQ '' .
          oldMart = IT_MATMASTER-Mtart.
          CALL FUNCTION 'MATERIAL_NUMBER_GET_NEXT'
            EXPORTING
              MATERIALART                = IT_MATMASTER-Mtart
           IMPORTING
             MATERIALNR                 = matnrAct
      RETURNCODE                 =
    EXCEPTIONS
      NO_INTERNAL_INTERVAL       = 1
      TYPE_NOT_FOUND             = 2
      OTHERS                     = 3
          if sy-subrc = 0.
            BAPIMATHEAD-MATERIAL = matnrAct.
          endif.
        ELSE.
          BAPIMATHEAD-MATERIAL = it_matmaster-matnr.
        ENDIF.
    Preenchimento dos dados do ecrã inicial
       BAPIMATHEAD-MATERIAL = IT_MATMASTER-MATNR.
        BAPIMATHEAD-IND_SECTOR = 'M'.
        BAPIMATHEAD-MATL_TYPE = IT_MATMASTER-Mtart.
        "declaration of views
        BAPIMATHEAD-BASIC_VIEW = 'X'.
        BAPIMATHEAD-MRP_VIEW = 'X'.
        BAPIMATHEAD-STORAGE_VIEW = 'X'.
        BAPIMATHEAD-WAREHOUSE_VIEW = 'X'.
        BAPIMATHEAD-ACCOUNT_VIEW = 'X'.
        If IT_MATMASTER-Mtart EQ '31'.
          BAPIMATHEAD-SALES_VIEW = 'X'.
          BAPIMATHEAD-WORK_SCHED_VIEW = 'X'.
        ENDIF.
        If IT_MATMASTER-Mtart EQ '51'.
          BAPIMATHEAD-SALES_VIEW = 'X'.
          BAPIMATHEAD-WORK_SCHED_VIEW = 'X'.
        ENDIF.
        If IT_MATMASTER-Mtart EQ '65'.
          BAPIMATHEAD-PURCHASE_VIEW = 'X'.
        ENDIF.
    Preenchimento de dados relativos a MARA
        BAPI_MARA-BASE_UOM = IT_MATMASTER-MEINS.
        BAPI_MARA-MATL_GROUP = IT_MATMASTER-MATKL.
        BAPI_MARA-OLD_MAT_NO = IT_MATMASTER-BISMT.
        BAPI_MARA-DIVISION = IT_MATMASTER-SPART.
        BAPI_MARA-PROD_HIER = IT_MATMASTER-PRDHA.
        BAPI_MARA-NET_WEIGHT = IT_MATMASTER-ntgew.
        BAPI_MARA-UNIT_OF_WT = IT_MATMASTER-GEWEI.
        BAPI_MARA-TRANS_GRP = IT_MATMASTER-tragr.
    > Novas Entradas
        IF IT_MATMASTER-Mtart EQ '65'.
          BAPI_MARA-BATCH_MGMT = IT_MATMASTER-XCHPF1.
          BAPI_MARA-PUR_VALKEY = IT_MATMASTER-EKWSL.     
          BAPI_MARAX-PUR_VALKEY = 'X'.
        ELSE.
                   BAPI_MARA-BATCH_MGMT = IT_MATMASTER-XCHPF.
    ENDIF.
    > Novas Entradas
          BAPI_MARA-MINREMLIFE = IT_MATMASTER-MHDRZ.
          BAPI_MARA-SHELF_LIFE = IT_MATMASTER-MHDHB.
          BAPI_MARAX-MATL_GROUP = 'X'.
          BAPI_MARAX-OLD_MAT_NO = 'X'.
          BAPI_MARAX-BASE_UOM = 'X'.
          BAPI_MARAX-DIVISION = 'X'.
          BAPI_MARAX-PROD_HIER = 'X'.
          BAPI_MARAX-NET_WEIGHT = 'X'.
          BAPI_MARAX-UNIT_OF_WT = 'X'.
          BAPI_MARAX-TRANS_GRP = 'X'.
          BAPI_MARAX-BATCH_MGMT = 'X'.
          BAPI_MARAX-MINREMLIFE = 'X'.
          BAPI_MARAX-SHELF_LIFE = 'X'.
    Preencimento de dados Relativos a MKVE
          BAPI_MVKE-DELYG_PLNT = IT_MATMASTER-DWERK.
          BAPI_MVKE-SALES_ORG = IT_MATMASTER-VKORG.
          BAPI_MVKE-DISTR_CHAN = IT_MATMASTER-VTWEG.
          BAPI_MVKE-PROD_HIER = IT_MATMASTER-PRODH.
          BAPI_MVKE-ITEM_CAT = IT_MATMASTER-MTPOS.
          BAPI_MVKE-ACCT_ASSGT = IT_MATMASTER-KTGRM.
          BAPI_MVKEX-SALES_ORG = IT_MATMASTER-VKORG.
          BAPI_MVKEX-DISTR_CHAN = IT_MATMASTER-VTWEG.
          BAPI_MVKEX-PROD_HIER = 'X'.
          BAPI_MVKEX-ITEM_CAT = 'X'.
          BAPI_MVKEX-DELYG_PLNT = 'X'.
          BAPI_MVKEX-ACCT_ASSGT = 'X'.
    Preencimento de dados Relativos a MARC
          BAPI_MARC-PLANT = IT_MATMASTER-WERKS.
          BAPI_MARC-AVAILCHECK = IT_MATMASTER-MTVFP.
          BAPI_MARC-LOADINGGRP = IT_MATMASTER-LADGR.
          BAPI_MARC-PROFIT_CTR = IT_MATMASTER-PRCTR.
          IF NOT IT_MATMASTER-Mtart EQ '51'.
            BAPI_MARC-COMM_CODE = IT_MATMASTER-STAWN.
            BAPI_MARC-COUNTRYORI = IT_MATMASTER-HERKL.
            BAPI_MARC-REGIONORIG = IT_MATMASTER-HERKR.
            BAPI_MARCX-COMM_CODE = 'X'.
            BAPI_MARCX-COUNTRYORI = 'X'.
            BAPI_MARCX-REGIONORIG = 'X'.
          ENDIF.
          BAPI_MARC-MRP_GROUP = IT_MATMASTER-DISGR.
          BAPI_MARC-MRP_TYPE = IT_MATMASTER-DISMM.
          BAPI_MARC-MRP_CTRLER = IT_MATMASTER-DISPO.
          BAPI_MARC-LOTSIZEKEY = IT_MATMASTER-DISLS.
          BAPI_MARC-MINLOTSIZE = IT_MATMASTER-BSTMI.
          BAPI_MARC-ROUND_VAL = IT_MATMASTER-BSTRF.
          BAPI_MARC-PROC_TYPE = IT_MATMASTER-BESKZ.
          BAPI_MARC-BACKFLUSH = IT_MATMASTER-RGEKZ .
          BAPI_MARC-ISS_ST_LOC = IT_MATMASTER-LGPRO.
          BAPI_MARC-DETERM_GRP = IT_MATMASTER-EPRIO.
          BAPI_MARC-SM_KEY = IT_MATMASTER-FHORI.
          BAPI_MARC-PERIOD_IND = IT_MATMASTER-PERKZ.
          BAPI_MARC-PLAN_STRGP = IT_MATMASTER-STRGR.
          BAPI_MARC-CONSUMMODE = IT_MATMASTER-VRMOD.
          BAPI_MARC-BWD_CONS = IT_MATMASTER-VINT1.
          BAPI_MARC-FWD_CONS = IT_MATMASTER-VINT2.
          BAPI_MARC-ALT_BOM_ID = IT_MATMASTER-ALTSL.
          BAPI_MARC-PRODUCTION_SCHEDULER = IT_MATMASTER-FEVOR.
          IF NOT IT_MATMASTER-Mtart EQ '65'.
            BAPI_MARC-IND_POST_TO_INSP_STOCK = IT_MATMASTER-INSMK.
            BAPI_MARC-OVER_TOL = IT_MATMASTER-UEETO.
            BAPI_MARCX-IND_POST_TO_INSP_STOCK = 'X'.
            BAPI_MARCX-OVER_TOL = 'X'.
          ENDIF.
    > Novas Entradas
          IF IT_MATMASTER-Mtart EQ '65'.
                 BAPI_MARC-PUR_GROUP = IT_MATMASTER-EKGRP .
                 BAPI_MARC-AUTO_P_ORD = IT_MATMASTER-KAUTB .
                 BAPI_MARC-GR_PR_TIME = IT_MATMASTER-WEBAZ .
                 BAPI_MARC-IND_POST_TO_INSP_STOCK = IT_MATMASTER-INSMK1 .
                 BAPI_MARC-SOURCELIST = IT_MATMASTER-KORDB .
                 BAPI_MARC-EXPIMPGRP = IT_MATMASTER-MTVER .
                 BAPI_MARCX-PUR_GROUP = 'X'.
                 BAPI_MARCX-AUTO_P_ORD = 'X'.
            BAPI_MARCX-GR_PR_TIME = 'X'.
            BAPI_MARCX-IND_POST_TO_INSP_STOCK = 'X'.
            BAPI_MARCX-SOURCELIST = 'X'.
            BAPI_MARCX-EXPIMPGRP = 'X'.
          ENDIF.
    > Novas Entradas
          BAPI_MARCX-PLANT = IT_MATMASTER-WERKS.
          BAPI_MARCX-AVAILCHECK = 'X'.
          BAPI_MARCX-LOADINGGRP = 'X'.
          BAPI_MARCX-PROFIT_CTR = 'X'.
          BAPI_MARCX-MRP_GROUP = 'X'.
          BAPI_MARCX-MRP_TYPE = 'X'.
          BAPI_MARCX-MRP_CTRLER = 'X'.
          BAPI_MARCX-LOTSIZEKEY = 'X'.
          BAPI_MARCX-MINLOTSIZE = 'X'.
          BAPI_MARCX-ROUND_VAL = 'X'.
          BAPI_MARCX-PROC_TYPE = 'X'.
          BAPI_MARCX-BACKFLUSH = 'X'.
          BAPI_MARCX-ISS_ST_LOC = 'X'.
          BAPI_MARCX-DETERM_GRP = 'X'.
          BAPI_MARCX-SM_KEY = 'X'.
          BAPI_MARCX-PERIOD_IND = 'X'.
          BAPI_MARCX-PLAN_STRGP = 'X'.
          BAPI_MARCX-CONSUMMODE = 'X'.
          BAPI_MARCX-BWD_CONS = 'X'.
          BAPI_MARCX-FWD_CONS = 'X'.
          BAPI_MARCX-ALT_BOM_ID = 'X'.
          BAPI_MARCX-PRODUCTION_SCHEDULER = 'X'.
    Preencimento de dados Relativos a MLGN
          BAPI_MLGN-WHSE_NO = 'S01'.
          BAPI_MLGN-WITHDRAWAL = IT_MATMASTER-LTKZA_S01.
          BAPI_MLGN-PLACEMENT = IT_MATMASTER-LTKZE_S01.
          BAPI_MLGN-STGESECTOR = IT_MATMASTER-LGBKZ_S01.
          BAPI_MLGN-L_EQUIP_1 = IT_MATMASTER-LHMG1.
          BAPI_MLGN-L_EQUIP_2 = IT_MATMASTER-LHMG2.
          BAPI_MLGN-L_EQUIP_3 = IT_MATMASTER-LHMG3.
          BAPI_MLGN-LEQ_UNIT_1 = IT_MATMASTER-LHME1.
          BAPI_MLGN-LEQ_UNIT_2 = IT_MATMASTER-LHME2.
          BAPI_MLGN-LEQ_UNIT_3 = IT_MATMASTER-LHME3.
          BAPI_MLGN-UNITTYPE_1 = IT_MATMASTER-LETY1.
          BAPI_MLGN-UNITTYPE_2 = IT_MATMASTER-LETY2.
          BAPI_MLGN-UNITTYPE_3 = IT_MATMASTER-LETY3.
          BAPI_MLGNX-WHSE_NO = 'S01'.
          BAPI_MLGNX-WITHDRAWAL = 'X'.
          BAPI_MLGNX-PLACEMENT = 'X'.
          BAPI_MLGNX-STGESECTOR = 'X'.
          BAPI_MLGNX-L_EQUIP_1 = 'X'.
          BAPI_MLGNX-L_EQUIP_2 = 'X'.
          BAPI_MLGNX-L_EQUIP_3 = 'X'.
          BAPI_MLGNX-LEQ_UNIT_1 = 'X'.
          BAPI_MLGNX-LEQ_UNIT_2 = 'X'.
          BAPI_MLGNX-LEQ_UNIT_3 = 'X'.
          BAPI_MLGNX-UNITTYPE_1 = 'X'.
          BAPI_MLGNX-UNITTYPE_2 = 'X'.
          BAPI_MLGNX-UNITTYPE_3 = 'X'.
    Preencimento de dados Relativos a MBEW
    BAPI_MBEW,
    BAPI_MBEWX,
          BAPI_MBEW-VAL_CLASS = IT_MATMASTER-BKLAS.
          BAPI_MBEW-PRICE_CTRL = IT_MATMASTER-VPRSV.
          BAPI_MBEW-STD_PRICE = IT_MATMASTER-VERPR.
          BAPI_MBEW-PRICE_UNIT = IT_MATMASTER-PEINH.
          BAPI_MBEW-VAL_AREA = 'CLPS'."IT_MATMASTER-BWKEY.
          BAPI_MBEWX-VAL_AREA = 'CLPS'."IT_MATMASTER-BWKEY.
          BAPI_MBEWX-VAL_CLASS = 'X'.
          BAPI_MBEWX-PRICE_CTRL = 'X'.
          BAPI_MBEWX-STD_PRICE = 'X'.
          BAPI_MBEWX-PRICE_UNIT = 'X'.
    ---------------------------------------------------> Material Descrition
          IT_MATERIALDESC-LANGU = sy-langu. "'EN'.
          IT_MATERIALDESC-MATL_DESC = IT_MATMASTER-MAKTX.
          APPEND IT_materialdesc.
    Gross Weight, Volume and EAN
    *Volume é preciso uma rotina de conversão
          CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
            EXPORTING
              INPUT                = IT_MATMASTER-VOLEH
      LANGUAGE             = SY-LANGU
           IMPORTING
             OUTPUT               = VolumUnitConv
           EXCEPTIONS
             UNIT_NOT_FOUND       = 1
             OTHERS               = 2
          IF SY-SUBRC <> 0.
            MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
            EXPORTING
              INPUT                = IT_MATMASTER-MEINS
      LANGUAGE             = SY-LANGU
           IMPORTING
             OUTPUT               = UnitConv
           EXCEPTIONS
             UNIT_NOT_FOUND       = 1
             OTHERS               = 2
          IF SY-SUBRC <> 0.
            MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          IT_UOM-GROSS_WT = IT_MATMASTER-BRGEW.
          IT_UOM-ALT_UNIT = UnitConv.
         IT_UOM-ALT_UNIT_ISO = IT_MATMASTER-GEWEI.
          IT_UOM-UNIT_OF_WT = IT_MATMASTER-GEWEI.
          IT_UOM-EAN_UPC = IT_MATMASTER-EAN11.
          IT_UOM-EAN_CAT = IT_MATMASTER-NUMTP.
          IT_UOM-VOLUME = IT_MATMASTER-VOLUM.
          IT_UOM-VOLUMEUNIT = VolumUnitConv.
         IT_UOM-VOLUMEUNIT_ISO = IT_MATMASTER-VOLEH.
          APPEND IT_UOM.
          IT_UOMX-ALT_UNIT = IT_MATMASTER-MEINS.
         IT_UOMX-ALT_UNIT_ISO = IT_MATMASTER-GEWEI.
          IT_UOMX-GROSS_WT = 'X'.
          IT_UOMX-UNIT_OF_WT = 'X'.
          IT_UOMX-EAN_UPC = 'X'.
          IT_UOMX-EAN_CAT = 'X'.
    *Volume
          IT_UOMX-VOLUME = 'X'.
          IT_UOMX-VOLUMEUNIT = 'X'.
         IT_UOMX-VOLUMEUNIT_ISO = 'X'.
          APPEND IT_UOMX.
          CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
            EXPORTING
              headdata             = BAPIMATHEAD
              CLIENTDATA           = BAPI_MARA
              CLIENTDATAX          = BAPI_MARAx
              PLANTDATA            = BAPI_MARc
              PLANTDATAX           = BAPI_MARcx
              VALUATIONDATA        = BAPI_MBEW
              VALUATIONDATAX       = BAPI_MBEWX
              WAREHOUSENUMBERDATA  = BAPI_MLGN
              WAREHOUSENUMBERDATAX = BAPI_MLGNX
              SALESDATA            = BAPI_MVKE
              SALESDATAX           = BAPI_MVKEX
            IMPORTING
              RETURN               = IT_RETURN
            TABLES
              MATERIALDESCRIPTION  = IT_MATERIALDESC
              UNITSOFMEASURE       = IT_UOM
              UNITSOFMEASUREX      = IT_UOMX
              MATERIALLONGTEXT     = text
              TAXCLASSIFICATIONS   = it_MLAN.
          if it_return-type eq 'S'.
            CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
         endif.
         WAIT UP TO 10 SECONDS.
          WRITE : / IT_RETURN-MESSAGE.
          CLEAR: IT_MATERIALDESC[],
                 IT_UOM[],
                 IT_UOMX[],
                 it_MLAN[],
                 IT_RETURN,
                 text,
                 BAPIMATHEAD,
                 BAPI_MARA,
                 BAPI_MARAx,
                 BAPI_MARc,
                 BAPI_MARcx,
                 BAPI_MBEW,
    BAPI_MBEWX,
    BAPI_MLGN,
    BAPI_MLGNX,
    BAPI_MVKE,
    BAPI_MVKEX
        ENDLOOP.

  • 10 digit code need to be created while creating material master

    Hi, Please advise how to create a 10 digit code automatically when we create material master in SAP? Please note that this code is required as one of the basic data view fields, not as material code. Is there any enhancements available for the same.

    Dear
    Try  to use  Product Hierarchy field MARA-PRDHA in the Material Master for this purpose
    Regards
    JH

  • Set default value for price unit when creating material master data

    HI: Every
    could you tell me how to use user-exit or else ways to set default value(such as 1000) for field "Price unit" (MBEW-PEINH) when creating material master data(MM01)?
    I have try to use Exit:EXIT_SAPLMGMU_001. However, this way cannot respones it.
    thanks
    Henry

    Hi: Ihave find out a solution
    Use BADI: BADI_MATERIAL_REF
    SPROlogistics general enhancement supplement or change default data (industry)
    And then creating a Implementation Name
    Double click method: CREATE_MATERIAL
    And then write code as below:
    method IF_EX_MATERIAL_REFERENCE~CREATE_MATERIAL.
              c_mbew-peinh = '1000' .
    endmethod.
    However, SAP still store '1000' in database evenif we change the default value such as 100 when we use TCode MM01.
    in additional, we still use MM02 to change the default value such as '100'
    can anybody tell me how to do?
    thanks
    Henry

Maybe you are looking for

  • Mouse Path Not Visible - Why?

    Hi, all. I'm editing a Captivate demo using Captivate 3 and for some reason the paths for the mouse movement aren't visible. I can't select or move the mouse and when I right-click on it I'm not offered an option to align it's movement to the previou

  • Does anyone know of a reputable repair center  for the Touch in Ohio or elsewhere?

    We are interested in finding a reputable repair center that works on replacing antennas in the ipod touch? Any suggestions?

  • Tap to click setting in system preferences not persisting after reboot!

    Hi, This is the 2nd time this has happened.. I shut down my system, and boot it up later, and when I go to tap, nothing happens. I go into to system prefs > trackpad, and see that my tap to click & dragging options are unchecked...... Why is it not r

  • Regarding IMEI lock applet

    Hi all, I have a query to ask. If any body can help it would be great. I have to develop an application such that to check the IMEI of the mobile and if it is not the same IMEI stored in the SIM it should lock the SIM Any body knows how to lock the S

  • Acrobt pro xi problem

    Hi! I need help with my pdf pro xi... in pdf pro 8 I had de document examination function to eliminate all the foodnotes, watermarks, notes, etc, but i can't find it. Can you help me? <moved from downloading,installing,setting up - kglad>