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 .

Similar Messages

  • Material Master Upload using Bapi getting error "****** not a valid unit of

    Hi Gurus,
    i am uploading material master using BAPI Material_master_save_data , where the volume and Unit of Volume is Blank, Still i am getting error as "****** not a valid unit of volume ".kindly help me to resolve the issue.Many Thanks In advance.

    Jurgen,
    I could able to solve the issue for invalid unit Error ....Now i am getting **** unit of measure is not defined , pls check your entry or else i am getting alternate unit of mesure is same as base unit of measure .
    I have used below logic for Purchase Order Unit and Base Unit of measure .
          if wa_upload-unmsr EQ wa_upload-ord_uom .
            bapi_mara1-base_uom = wa_upload-unmsr.
            bapi_mara1-po_unit = wa_upload-ord_uom .
          elseif wa_upload-unmsr NE wa_upload-ord_uom.
            wa_upload-ord_uom = wa_upload-alt_uom.
            bapi_mara1-po_unit = wa_upload-ord_uom.
          endif.
    Many Thanks for your help.

  • Material master upload using BAPI...

    Helo SDNers,
    I am trying to upload material master using BAPI.
    data :  begin of t_mat occurs 0,
            material type matnr,             " Material - MATNR
            ind_sec type mbrsh,              " Industry sector  - MBRSH
            mat_typ type mtart,              " Material type - MTART
            plant type werks_d,              " plant - WERKS_D
            stge_loc type lgort_d,           " Storage location - LGORT_D
            sales_org type vkorg,            " Sales org - VKORG
            distr_chan type vtweg,           " Distribution channel - VTWEG
            mat_desc type maktx,             " Material description - MAKTX
            base_uom type meins,             " Base unit of measurement- MEINS
            mat_grp type matkl,              " material group - MATKL
            division type spart,             " Division - SPART
            gen_itmcatmgrp type MTPOS,       " General item category group -MTPOS_MARA
            gros_weight type BRGEW,          " Gross weight - BRGEW
            net_weight type NTGEW,          " Net weight - NTGEW
            mat_grppack type MAGRV,          " Material group pack - MAGRV
            delv_plant type DWERK_EXT,       " Delivery plant
            tax_clasif type TAXKM,           " Tax classification
            item_catgrp type MTPOS,          " Item category group
            aval_check type MTVFP,           " Availability check
            trans_grp type TRAGR,            " Transportation group
            load_grp type LADGR,             " Loading group
            pur_grp type EKGRP,              " Purchasing grp,
            mrp_type type DISMM,             " MRP type
            mrp_contr type DISPO,            " MRP Controller
            lot_size type DISLS,             " Lot size,
            gr_processing type WEBAZ,        " GR Processing time
            schdmargin_key type FHORI,       " Schedule margin key
            batch_mangment type XCHPF,       " Batch management
            strog_cond type RAUBE,           " Storage condition
            source_list type KORDB,          " Source list
            mrp_grp type DISGR,              " MRP group
            reorder_point type MINBE,        " Reorder point
            procurement_type type BESKZ,     " Procurement type
            sp_procurement_type type SOBSL,  " Special  Procurement type
            inhouse_prod type DZEIT,                    " Inhouse production
            safety_stock type EISBE,         " Safety stock
            strategy_group type STRGR,       " Strategy group
            availabilty_grp type MTVFP,      " Availability group
            batch_entry type KZECH ,         " Batch entry
            valuation_class type BKLAS,      " Valuation class
            price_control type VPRSV,        " Price control
            moving_price type VERPR,         " Moving price
            standard_price type STPRS,       " Standard price - STPRS
            langu(2),                        " Language
    end of t_mat.
    this is my internal table i have these many content in my excel file
    please explain me what the following code does .....
    move-corresponding wa to bapi_head.
    bapi_head-basic_view = 'X'.
    bapi_head-sales_view = 'X'.
    bapi_head-purchase_view = 'X'.
    bapi_head-mrp_view = 'X'.
    bapi_head-forecast_view = 'X'.
    bapi_head-work_sched_view = 'X'.
    bapi_head-prt_view = 'X'.
    bapi_head-storage_view = 'X'.
    bapi_head-warehouse_view = 'X'.
    bapi_head-quality_view = 'X'.
    bapi_head-account_view = 'X'.
    bapi_head-cost_view = 'X'.
    and also please help with an example how do i upload data from IT (my internal table) using BAPI.
    Regards,
    Ranjith N

    Hi ,
    First you upload your Excel data into Internal Table.
    Move all data to Respected BAPI Structures.
    and then call 'BAPI_MATERIAL_SAVEDATA' and pass all structures.
    Sample Code:
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                = p_fname
          i_begin_col             = v_c1
          i_begin_row             = l_v_r
          i_end_col               = v_cl
          i_end_row               = v_rl
        TABLES
          intern                  = i_excel
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          OTHERS                  = 3.
      IF sy-subrc eq 0.
        LOOP AT i_excel.
          CASE i_excel-col.
            WHEN 0001.
              wa_final-field1 = i_excel-value.
            WHEN 0002.
              wa_final-field2 = i_excel-value.
            WHEN 0003.
              wa_final-field3 = i_excel-value.
            WHEN 0004.
              wa_final-field4 = i_excel-value.
            WHEN 0005.
              wa_final-field5 = i_excel-value.
            WHEN 0006.
              wa_final-field6 = i_excel-value.
            WHEN 0007.
              wa_final-field7 = i_excel-value.
            WHEN 0008.
              wa_final-field8 = i_excel-value.
            WHEN 0009.
              wa_final-field9 = i_excel-value.
            WHEN 0010.
              wa_final-field10 = i_excel-value.
            WHEN 0011.
              wa_final-field11 = i_excel-value.
            WHEN 0012.
              wa_final-field12 = i_excel-value.
            WHEN 0013.
              wa_final-field13 = i_excel-value.
            WHEN 0014.
              wa_final-field14 = i_excel-value.
            WHEN 0015.
              wa_final-field15 = i_excel-value.
            WHEN 0016.
              wa_final-field16 = i_excel-value.
          ENDCASE.
    *-at end of each row, a record needs to append the internal table
          AT END OF row.
            APPEND wa_final TO i_final.
            CLEAR: wa_final.
          ENDAT.
        ENDLOOP.
      ENDIF.
    Move all your Inatrnal tbale data to respected BAPI structures
    *&      Form  MOVE_HEADDATA
       * Move Header data to BAPI Header.
    FORM move_headdata .
    Move Header Data to BAPI Fields
      MOVE : wa_final-matnr      TO wa_mathead-material,
             wa_final-mbrsh      TO wa_mathead-ind_sector,
             wa_final-mtart      TO wa_mathead-matl_type.
    To get UOM
      SELECT SINGLE * FROM t006 INTO t006 WHERE msehi = wa_final-meins.
      MOVE: t006-isocode TO wa_mara-base_uom_iso,
            c_x          TO wa_marax-base_uom_iso.
    **-- Move Material Descriptions
      PERFORM move_materialdescription .
    ENDFORM.                    " MOVE_HEADDATA
    *&      Form  MOVE_CLIENTDATA
          * Move Basic data to Clientdata
    FORM   move_clientdata .
      MOVE : wa_final-spart      TO wa_mara-division,
             wa_final-bismt      TO wa_mara-old_mat_no,
             wa_final-extwg      TO wa_mara-extmatlgrp,
             wa_final-mtpos_mara TO wa_mara-item_cat,
             wa_final-groes      TO wa_mara-size_dim,
             wa_final-zeivr      TO wa_mara-doc_vers,
             wa_final-ekwsl      TO wa_mara-pur_valkey.
      MOVE : c_x      TO wa_marax-division,
             c_x      TO wa_marax-old_mat_no,
             c_x      TO wa_marax-extmatlgrp,
             c_x      TO wa_marax-item_cat,
             c_x      TO wa_marax-size_dim,
             c_x      TO wa_marax-doc_vers,
             c_x      TO wa_marax-pur_valkey.
    ENDFORM.                    " MOVE_CLIENTDATA
    *&      Form  MOVE_STORAGELOCATIONDATA
          * Move storage location data to STORAGELOCATIONDATA
    FORM move_storagelocationdata .
      CLEAR: wa_mard,wa_mardx.
      MOVE : wa_final-werks      TO wa_mard-plant,
             wa_final-lgort      TO wa_mard-stge_loc.
      MOVE : wa_final-werks      TO wa_mardx-plant,
             wa_final-lgort      TO wa_mardx-stge_loc.
    ENDFORM.                    " MOVE_STORAGELOCATIONDATA
    *&      Form  MOVE_SALESDATA
         * Move Salesdate to SALESDATA
    FORM move_salesdata .
      MOVE : wa_final-vkorg      TO wa_mvke-sales_org,
             wa_final-vtweg      TO wa_mvke-distr_chan,
             wa_final-dwerk      TO wa_mvke-delyg_plnt,
             wa_final-versg      TO wa_mvke-matl_stats,
             wa_final-ktgrm      TO wa_mvke-acct_assgt,
             wa_final-mtpos      TO wa_mvke-item_cat,
             wa_final-mvgr1      TO wa_mvke-matl_grp_1,
             wa_final-mvgr2      TO wa_mvke-matl_grp_2,
             wa_final-mvgr3      TO wa_mvke-matl_grp_3,
             wa_final-mvgr4      TO wa_mvke-matl_grp_4,
             wa_final-mvgr5      TO wa_mvke-matl_grp_5,
             wa_final-vrkme      TO wa_mvke-sales_unit.
      MOVE : wa_final-vkorg      TO wa_mvkex-sales_org,
             wa_final-vtweg      TO wa_mvkex-distr_chan,
             c_x                 TO wa_mvkex-delyg_plnt,
             c_x                 TO wa_mvkex-matl_stats,
             c_x                 TO wa_mvkex-acct_assgt,
             c_x                 TO wa_mvkex-item_cat,
             c_x                 TO wa_mvkex-matl_grp_1,
             c_x                 TO wa_mvkex-matl_grp_2,
             c_x                 TO wa_mvkex-matl_grp_3,
             c_x                 TO wa_mvkex-matl_grp_4,
             c_x                 TO wa_mvkex-matl_grp_5,
             c_x                 TO wa_mvkex-sales_unit.
    ENDFORM.                    " MOVE_SALESDATA
    *&      Form  MOVE_MATERIALDESCRIPTION
          * Move MATERIALDESCRIPTION to Material Description
    FORM move_materialdescription .
      CLEAR: wa_makt,i_makt.
      MOVE : wa_final-maktx TO wa_makt-matl_desc,
             sy-langu       TO wa_makt-langu.
      APPEND wa_makt TO i_makt.
      CLEAR wa_makt.
    ENDFORM.                    " MOVE_MATERIALDESCRIPTION
    *&      Form  basic_data
    FORM basic_data .
    **-- Move Material Data at Storage Location Level
      PERFORM move_storagelocationdata .
      MOVE : wa_final-vkorg      TO wa_mvke-sales_org,
             wa_final-vtweg      TO wa_mvke-distr_chan.
      MOVE : wa_final-vkorg      TO wa_mvkex-sales_org,
             wa_final-vtweg      TO wa_mvkex-distr_chan.
    **-- Move Material Data at Client Level
      PERFORM move_clientdata .
    IF ALT_UOM is not Given in flat file Move BASEUOM as ALT_UOM
      IF wa_final-meinh EQ c_space.
        MOVE : wa_final-meins     TO wa_marm-alt_unit,
               wa_final-meins     TO wa_marmx-alt_unit.
      ELSE.
        MOVE : wa_final-meinh      TO wa_marm-alt_unit,
                wa_final-umren      TO wa_marm-numerator.
        MOVE : wa_final-meinh     TO wa_marmx-alt_unit,
               c_x                TO wa_marmx-numerator.
      ENDIF.
      MOVE : wa_final-numtp      TO wa_marm-ean_cat,
             wa_final-brgew      TO wa_marm-gross_wt,
             wa_final-volum      TO wa_marm-volume,
             wa_final-voleh      TO wa_marm-volumeunit,
             wa_final-gewei      TO wa_marm-unit_of_wt.
      APPEND wa_marm TO i_marm.
      CLEAR wa_marm.
      MOVE : c_x                TO wa_marmx-ean_cat,
             c_x                TO wa_marmx-gross_wt,
             c_x                TO wa_marmx-volume,
             c_x                TO wa_marmx-volumeunit,
             c_x                TO wa_marmx-unit_of_wt.
      APPEND wa_marmx TO i_marmx.
      CLEAR wa_marmx.
    ENDFORM.                    " basic_data
    *&      Form  sales_data1
    FORM sales_data1 .
    Move Sales & Plant Data
      MOVE : wa_final-werks      TO wa_marc-plant,
             wa_final-mtvfp      TO wa_marc-availcheck,
             wa_final-ladgr      TO wa_marc-loadinggrp,
             wa_final-prctr      TO wa_marc-profit_ctr.
      MOVE : wa_final-werks      TO wa_marcx-plant,
             c_x                 TO wa_marcx-availcheck,
             c_x                 TO wa_marcx-loadinggrp,
             c_x                 TO wa_marcx-profit_ctr.
      MOVE: wa_final-tragr      TO wa_mara-trans_grp,
            c_x                 TO wa_marax-trans_grp.
    **-- Move Sales Data
      PERFORM move_salesdata .
    Move Tax Data
      MOVE : 'JP'              TO wa_mlan-depcountry_iso,
            'MWAR'             TO wa_mlan-tax_type_1,
             wa_final-taklv    TO wa_mlan-taxclass_1.
      APPEND wa_mlan TO i_mlan.
      CLEAR wa_mlan.
    ENDFORM.                    " sales_data1
    *&      Form  purchase_data
    FORM purchase_data .
    Move Plant Data
      MOVE : wa_final-werks      TO wa_marc-plant,
             wa_final-werks      TO wa_marcx-plant.
    Move PO data
      MOVE : wa_final-ekgrp  TO wa_marc-pur_group,
             wa_final-kautb  TO wa_marc-auto_p_ord,
             wa_final-usequ  TO wa_marc-quotausage,
             wa_final-kordb  TO wa_marc-sourcelist,
             c_x             TO wa_marcx-pur_group,
             c_x             TO wa_marcx-auto_p_ord,
             c_x             TO wa_marcx-quotausage,
             c_x             TO wa_marcx-sourcelist.
      MOVE: wa_final-matkl  TO wa_mara-matl_group,
            wa_final-bstme  TO wa_mara-po_unit,
             c_x            TO wa_marax-matl_group,
             c_x            TO wa_marax-po_unit.
    ENDFORM.                    " purchase_data
    *&      Form  mrp_data
    FORM mrp_data .
    **-- Move Material Data at Storage Location Level
      PERFORM move_storagelocationdata .
    Move All MRP data
      MOVE: wa_final-diskz TO wa_mard-mrp_ind,
            c_x            TO wa_mardx-mrp_ind.
      MOVE : wa_final-werks TO wa_marc-plant,
             wa_final-dismm TO wa_marc-mrp_type,
             wa_final-dispo TO wa_marc-mrp_ctrler,
             wa_final-beskz TO wa_marc-proc_type,
             wa_final-sobsl TO wa_marc-spproctype,
             wa_final-mtvfp TO wa_marc-availcheck,
             wa_final-minbe  TO wa_marc-reorder_pt,
             wa_final-fxhor  TO wa_marc-pl_ti_fnce,
             wa_final-disls  TO wa_marc-lotsizekey,
             wa_final-bstmi  TO wa_marc-minlotsize,
             wa_final-bstma  TO wa_marc-maxlotsize,
             wa_final-bstfe  TO wa_marc-fixed_lot,
             wa_final-mabst  TO wa_marc-max_stock,
             wa_final-ausss  TO wa_marc-assy_scrap,
             wa_final-dzeit  TO wa_marc-inhseprodt,
             wa_final-plifz  TO wa_marc-plnd_delry,
             wa_final-webaz  TO wa_marc-gr_pr_time,
             wa_final-fhori  TO wa_marc-sm_key,
             wa_final-eisbe  TO wa_marc-safety_stk,
             wa_final-strgr  TO wa_marc-plan_strgp,
             wa_final-wzeit  TO wa_marc-replentime,
             wa_final-lgfsb  TO wa_marc-sloc_exprc,
             wa_final-sbdkz  TO wa_marc-dep_req_id,
             wa_final-kzbed  TO wa_marc-grp_reqmts,
             wa_final-miskz  TO wa_marc-mixed_mrp,
             wa_final-stlal  TO wa_marc-alternative_bom,
             wa_final-stlan  TO wa_marc-bom_usage.
      MOVE : wa_final-werks TO wa_marcx-plant,
             c_x            TO wa_marcx-mrp_type,
             c_x            TO wa_marcx-mrp_ctrler,
             c_x            TO wa_marcx-proc_type,
             c_x            TO wa_marcx-spproctype,
             c_x            TO wa_marcx-availcheck,
             c_x            TO wa_marcx-reorder_pt,
             c_x            TO wa_marcx-pl_ti_fnce,
             c_x            TO wa_marcx-lotsizekey,
             c_x            TO wa_marcx-minlotsize,
             c_x            TO wa_marcx-maxlotsize,
             c_x            TO wa_marcx-fixed_lot,
             c_x            TO wa_marcx-max_stock,
             c_x            TO wa_marcx-assy_scrap,
             c_x            TO wa_marcx-inhseprodt,
             c_x            TO wa_marcx-plnd_delry,
             c_x            TO wa_marcx-gr_pr_time,
             c_x            TO wa_marcx-sm_key,
             c_x            TO wa_marcx-safety_stk,
             c_x            TO wa_marcx-plan_strgp,
             c_x            TO wa_marcx-replentime,
             c_x            TO wa_marcx-sloc_exprc,
             c_x            TO wa_marcx-dep_req_id,
             c_x            TO wa_marcx-grp_reqmts,
             c_x            TO wa_marcx-mixed_mrp,
             c_x            TO wa_marcx-alternative_bom,
             c_x            TO wa_marcx-bom_usage.
    ENDFORM.                    " mrp_data
    *&      Form  accounting_data
    FORM accounting_data .
    Move Plant Data
      MOVE: wa_final-werks TO wa_marc-plant,
            wa_final-werks TO wa_marcx-plant.
    Move Account Data
      MOVE :  wa_final-werks TO wa_mbew-val_area,
              wa_final-bklas TO wa_mbew-val_class,
              wa_final-vprsv TO wa_mbew-price_ctrl,
              wa_final-verpr TO wa_mbew-moving_pr,
              wa_final-peinh TO wa_mbew-price_unit,
              wa_final-stprs TO wa_mbew-std_price.
      MOVE :  wa_final-werks TO wa_mbewx-val_area,
              c_x TO wa_mbewx-val_class,
              c_x TO wa_mbewx-price_ctrl,
              c_x TO wa_mbewx-moving_pr,
              c_x TO wa_mbewx-price_unit,
              c_x TO wa_mbewx-std_price.
    ENDFORM.                    " accounting_data
    *&      Form  cost_data
    FORM cost_data .
    Move Plant Data
      MOVE: wa_final-werks TO wa_marc-plant,
            wa_final-awsls TO wa_marc-variance_key,
            wa_final-verid  TO wa_marc-prodverscs,   " Production Version
            wa_final-werks TO wa_marcx-plant,
            c_x            TO wa_marcx-variance_key,
            c_x            TO wa_marcx-prodverscs.
    Move Cost Data
      MOVE :  wa_final-werks TO wa_mbew-val_area,
              wa_final-bklas TO wa_mbew-val_class,
              wa_final-vprsv TO wa_mbew-price_ctrl,
              wa_final-ekalr TO wa_mbew-qty_struct.
      MOVE :  wa_final-werks TO wa_mbewx-val_area,
              c_x            TO wa_mbewx-val_class,
              c_x            TO wa_mbewx-price_ctrl,
              c_x            TO wa_mbewx-qty_struct.
    ENDFORM.                    " cost_data
    Call All Structures in to BAPI
      CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
        EXPORTING
          headdata             = wa_mathead
          clientdata           = wa_mara
          clientdatax          = wa_marax
          plantdata            = wa_marc
          plantdatax           = wa_marcx
          storagelocationdata  = wa_mard
          storagelocationdatax = wa_mardx
          valuationdata        = wa_mbew
          valuationdatax       = wa_mbewx
          salesdata            = wa_mvke
          salesdatax           = wa_mvkex
        IMPORTING
          return               = i_return
        TABLES
          materialdescription  = i_makt
          unitsofmeasure       = i_marm
          unitsofmeasurex      = i_marmx
          taxclassifications   = i_mlan.
      IF i_return-type = 'A' OR i_return-type = 'E' .
        DATA : l_v_string TYPE string,
               l_v_msg1   TYPE string,
               l_v_msg2   TYPE string.
        MOVE i_return-message TO l_v_string.
        CONDENSE l_v_string.
        PERFORM fill_error_table USING 'E'
                                       'ZMSG_MM'
                                       '098'
                                       v_reccon
                                       l_v_string
        v_error = v_error + 1.
        CLEAR: l_v_string.
      ELSEIF i_return-type = 'S'.
        PERFORM fill_error_table USING 'S'
                                             i_return-id
                                             i_return-number
                                            i_return-message_v1
                                           i_return-message_v2
                                           i_return-message_v3
                                           i_return-message_v4.
        v_success = v_success + 1.
      ENDIF .
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = 'X'.
      IF sy-subrc = 0.
        COMMIT WORK AND WAIT.      "for the update to table Transcation
      ENDIF.
    Regards,
    Siva.

  • Problem in extending material master data using BAPI?

    Hi all,
    I have created a program to upload material master using BAPI_MATERIAL_SAVEDATA WITH VIEWS
    Basic view, purchase view, account view , storage view and MRP view. I am successful while uploading this data while not  taking  the valuation type  field to account view(passing only valuation area,valuation class and moving price).
    But when i am trying to pass valuation type field also then it is giving error as 'First create the valuation-type-independent data' .
    So i have written another program to extend this material to enter valuation type , then it is giving the error as 'Valuation category does not allow split valuation'.
    Please help me to solve this problem and while modifying what are the mandatory values to pass to BAPI?
    Thanks,
    Vamshi.

    Hi VAMSHI,
    I have your same error but I don't know how to solve it. We have active "material split valuation" and valuation type is mandatory field if using ACCOUNTING and COSTING views.
    Please, let me know.
    Thanks in advance.
    GB

  • Zprogram to create material master data using bapi

    can anyone send me a zprogram which uses a
    bapi to create\update material master data .
    thanks ,
    Amit

    hi,
    here below a code sample that will help you
    FORM execution .
      DATA: is_headdata TYPE bapimathead.
      DATA: is_clientdata TYPE bapi_mara.
      DATA: is_clientdatax TYPE bapi_marax.
      DATA: is_plantdata TYPE bapi_marc.
      DATA: is_plantdatax TYPE bapi_marcx.
      DATA: is_valuationdata  TYPE bapi_mbew.
      DATA: is_valuationdatax  TYPE bapi_mbewx.
      DATA: it_materialdescription TYPE bapi_makt OCCURS 0 WITH HEADER LINE.
      DATA : is_storagelocationdata TYPE bapi_mard,
             is_storagelocationdatax TYPE bapi_mardx.
    *... views
      is_headdata-material = mara-matnr.
      is_headdata-ind_sector = 'M'.
      is_headdata-matl_type = 'ROH'.
      is_headdata-basic_view = 'X'.
      is_headdata-purchase_view = 'X'.
      is_headdata-mrp_view = 'X'.
      is_headdata-account_view = 'X'.
      is_headdata-cost_view = 'X'.
      is_headdata-storage_view = 'X'.
    *... constants
      is_clientdata-pur_valkey = '3'.
      is_clientdatax-pur_valkey = 'X'.
    *... Données article générales (de l'écran)
      is_clientdata-base_uom = mara-meins.
      is_clientdata-matl_group = mara-matkl.
      is_clientdata-mfr_no = mara-mfrnr.
      is_clientdata-manu_mat = mara-mfrpn.
      is_clientdata-pur_status = mara-mstae.
      is_clientdata-old_mat_no = mara-bismt.
      is_clientdatax-base_uom = 'X'.
      is_clientdatax-matl_group = 'X'.
      is_clientdatax-mfr_no = 'X'.
      is_clientdatax-manu_mat = 'X'.
      is_clientdatax-pur_status = 'X'.
      is_clientdatax-old_mat_no = 'X'.
    *... Description
      it_materialdescription-langu = sy-langu.
      it_materialdescription-matl_desc = makt-maktx.
      APPEND it_materialdescription.
      is_plantdata-sm_key = '000'.
      is_plantdata-dep_req_id = '2'.
      is_plantdata-availcheck = '02'.
      is_plantdata-auto_p_ord = 'X'.
      is_plantdatax-sm_key = 'X'.
      is_plantdatax-dep_req_id = 'X'.
      is_plantdatax-availcheck = 'X'.
      is_plantdatax-auto_p_ord = 'X'.
      is_plantdata-pur_status = mara-mstae.
      is_plantdatax-pur_status = 'X'.
          is_plantdata-profit_ctr = '100012'.
      is_plantdata-proc_type = 'F'.
      is_plantdata-determ_grp = 'Z001'.
      is_plantdata-deploy_horiz = '000'.
      is_plantdatax-proc_type = 'X'.
      is_plantdatax-determ_grp = 'X'.
      is_plantdatax-deploy_horiz = 'X'.
    *... Plant data
      is_plantdata-plant = marc-werks.
      is_plantdata-pur_group = marc-ekgrp.
      is_plantdata-abc_id = marc-maabc.
      is_plantdata-mrp_type = marc-dismm.
      is_plantdata-plnd_delry = marc-plifz.
      is_plantdata-lotsizekey = marc-disls.
      is_plantdata-safety_stk = marc-eisbe.
      is_plantdata-mrp_ctrler = marc-dispo.
      is_plantdata-iss_st_loc = marc-lgpro.
      is_plantdata-sloc_exprc = marc-lgfsb.
      is_plantdata-round_prof = marc-rdprf.
      is_plantdatax-plant = marc-werks.
      is_plantdatax-pur_group = 'X'.
      is_plantdatax-abc_id = 'X'.
      is_plantdatax-mrp_type = 'X'.
      is_plantdatax-plnd_delry = 'X'.
      is_plantdatax-lotsizekey = 'X'.
      is_plantdatax-safety_stk = 'X'.
      is_plantdatax-mrp_ctrler = 'X'.
      is_plantdatax-iss_st_loc = 'X'.
      is_plantdatax-sloc_exprc = 'X'.
      is_plantdatax-round_prof = 'X'.
    *... Valuation
      is_valuationdata-val_area = marc-werks.
      is_valuationdatax-val_area = marc-werks.
      is_valuationdata-price_ctrl = 'V'.
      is_valuationdata-price_unit = '1'.
      is_valuationdata-val_class = '3000'.
      is_valuationdata-qty_struct = 'X'.
      is_valuationdata-orig_mat = 'X'.
      is_valuationdata-price_unit = mbew-peinh.
      is_plantdata-lot_size = mbew-peinh.
      is_valuationdatax-price_ctrl = 'X'.
      is_valuationdatax-price_unit = 'X'.
      is_valuationdatax-val_class = 'X'.
      is_valuationdatax-qty_struct = 'X'.
      is_valuationdatax-orig_mat = 'X'.
      is_valuationdatax-price_unit = 'X'.
      is_plantdatax-lot_size = 'X'.
    Storage
      IF NOT marc-lgpro IS INITIAL.
        is_storagelocationdata-plant = marc-werks.
        is_storagelocationdata-stge_loc = marc-lgpro.
        is_storagelocationdata-stge_bin = mard-lgpbe.
        is_storagelocationdatax-plant = is_storagelocationdata-plant.
        is_storagelocationdatax-stge_loc = is_storagelocationdata-stge_loc.
        is_storagelocationdatax-stge_bin = 'X'.
      ENDIF.
      CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
      EXPORTING
      headdata                   = is_headdata
      clientdata                 = is_clientdata
      clientdatax                = is_clientdatax
      plantdata                  = is_plantdata
      plantdatax                 = is_plantdatax
      FORECASTPARAMETERS         =
      FORECASTPARAMETERSX        =
      PLANNINGDATA               =
      PLANNINGDATAX              =
       storagelocationdata        = is_storagelocationdata
       storagelocationdatax       = is_storagelocationdatax
      valuationdata              = is_valuationdata
      valuationdatax             = is_valuationdatax
      WAREHOUSENUMBERDATA        =
      WAREHOUSENUMBERDATAX       =
      SALESDATA                  =
      SALESDATAX                 =
      STORAGETYPEDATA            =
      STORAGETYPEDATAX           =
      FLAG_ONLINE                = ' '
      FLAG_CAD_CALL              = ' '
      IMPORTING
      return                     = return
    TABLES
         materialdescription        = it_materialdescription
      UNITSOFMEASURE             =
      UNITSOFMEASUREX            =
      INTERNATIONALARTNOS        =
      MATERIALLONGTEXT           =
      TAXCLASSIFICATIONS         =
         returnmessages             = it_returnmessages
      PRTDATA                    =
      PRTDATAX                   =
      EXTENSIONIN                =
      EXTENSIONINX               =
    endform.
    Regards.
    David

  • Error while updating AFS weights & measures material master data using BAPI

    Hello ABAP experts,
    Please help me in finding the right way in updating AFS weights & measures data (/AFS/MARM) data using BAPI /AFS/BAPI_MATERIAL_SAVE_DATA.
    I'm populating the following table parameters of the BAPI,
    1. SKUUNITSOFMEASURE with /AFS/MARM records
    s_bapi_marm-ALT_UNIT = 'EA'.
    s_bapi_marm-ALT_UNIT_ISO = 'EA'.
    s_bapi_marm-grid_value = 'XXXXS'.
    *s_bapi_marm-STOCK_CATEGORY = '01000'.
    s_bapi_marm-volume  = '10'.
    s_bapi_marm-GROSS_WT  = '10'.
    s_bapi_marm-NET_WEIGHT  = '10'.
    append s_bapi_marm to t_bapi_marm.
    2. UNITSOFMEASURE with MARM records
    s_bapi_uom-ALT_UNIT = 'EA'.
    s_bapi_uom-ALT_UNIT_ISO = 'EA'.
    s_bapi_uom-NUMERATOR = '1'.
    s_bapi_uom-DENOMINATR = '1'.
    s_bapi_uom-UNIT_OF_WT = 'KG'.
    s_bapi_uom-VOLUMEUNIT = 'CCM'.
    append s_bapi_uom to t_bapi_uom.
    But the BAPI returns me an error "Stock Category & is not valid in Category structure  &"
    Let me know if you have any inputs on this one.
    Thanks,
    Partha.

    Hi VAMSHI,
    I have your same error but I don't know how to solve it. We have active "material split valuation" and valuation type is mandatory field if using ACCOUNTING and COSTING views.
    Please, let me know.
    Thanks in advance.
    GB

  • Problem in uploading material master data using BAPI?

    Hi all,
    I am using BAPI_MATERIAL_SAVEDATA to upload materail master data. Here i have to pass moving average price values in two currenices(using account_view and valuationdata in BAPI). But i found only one field for  moving average price i.e moving_pr in valuationdata.
    Please help me on how to upload the moving average price in two currencies?
    Thanks,
    Aravind.

    Hi
    There is function module BAPI_MATERIAL_SAVEREPLICA where
    VALUATIONDATA parameter is in the tables tab.
    But I didn't test it. Try, may be it works as you need.

  • Uploading of material master data using bapi BAPI_MATERIAL_SAVEDATA

    hi guys,
    i am uploading data from a flatfile (say notepad file).
    the value for the field BRGEW(gross_wt) is displayed as 0.0000 WHEN i run the transaction MM03 where as  in the flat file its value  is 0000000000003
    the data type of BRGEW is P
    what should i do to solve this issue.
    my flat file looks like this
    000000000000010760FERTRNY01test material                           KG 005      NY010KG 0000000000003
    My structure is
    DATA:
    BEGIN OF MATERIAL_MASTER,
    MATNR(018) TYPE C,      "Material number
    MTART(004) TYPE C,      "Material type
    MBRSH(001) TYPE C,      "Industry sector
    WERKS LIKE MARC-WERKS,  "TYPE C Plant
    MAKTX(040) TYPE C,      "Material description
    MEINS(3)   TYPE C,      "base unit of measure
    MATKL(009) TYPE C,      "Material group
    SPART(002) TYPE C,      "Division
    WEBAZ(03)  TYPE C,      "GR processing time
    GEWEI LIKE MARA-GEWEI, "Weight unit
    BRGEW(13) type c, "Gross weight
    end of MATERIAL_MASTER.
    thanks
    Edited by: nishant patel on Aug 7, 2008 11:16 AM

    Hi,
    try to fill the BAPI structure
    WRITE ds_output1-brgew
                TO <bapi_structure>
                UNIT 'Pass the unit here'
                NO-GROUPING.
    Hope it will work.
    Thanks,
    Kamesh Bathla
    Edited by: Kamesh Bathla on Aug 7, 2008 6:51 PM

  • Customer -master upload using bapi

    hai ..
      can any body send me some example for customer master  creation using bapi ..
      in this account -group is mandatary..
    but i did.nt find  acc-group in bapi structures ..
    plz do helpful ..
    Tanx in advance ..

    Hi,
    Check the below links.
    [http://abaplovers.blogspot.com/2008/03/customer-master-bapis-function-modules.html|http://abaplovers.blogspot.com/2008/03/customer-master-bapis-function-modules.html]
    [http://abap.wikiprog.com/wiki/BAPI_CUSTOMER_CREATEFROMDATA1|http://abap.wikiprog.com/wiki/BAPI_CUSTOMER_CREATEFROMDATA1]
    Reward if found helpful.
    Regards,
    Boobalan Suburaj

  • I want to upload material master (MM01) using LSMW with BAPI method

    I want to upload material master (MM01) using LSMW with BAPI method and also later on I may need to change the updated data.
    Which business object and Method I should use so that i can do both.
    Thanks
    kumar n

    Hi,
    The business object is BUS1001.
    Thanks,
    Murali

  • 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...

  • Custom - Material Master Update using an IDOC (Message Type - MATMAS_BAPI)

    Hello everyone,
    I was writing a functional specs. Basically, I want to update the material master MM02 using an IDOC (MATMAS_BAPI01 - Basic Type & MATMAS_BAPI - Message Type). This is currently working.
    To my understanding, this currently uses function module - BAPI_IDOC_INPUT1 to update the material master after the IDOC is posted to SAP ECC from XI system.
    Now I want to add one small validation logic before it actually updates the material master (MM02).
    I looked around and found one exit - EXIT_SAPLMV02_002 in enhancement MGV00001. I was almost sure that this EXIT can be used to write the custom validation code before, actual MM02 updation.
    However while trying to establish a link between this EXIT and BAPI_IDOC_INPUT1, I found that EXIT_SAPLMV02_002 is actually a part of another function module - IDOC_INPUT_MATMAS01 and not BAPI_IDOC_INPUT1. I am stuck here if adding the custom logic in the exit really going to work.
    a bit of googling and I found from WE30 that the purpose of both these function modules are actually different. While BAPI_IDOC_INPUT1  actually create & updates the material master (also plant specific master data which is my need), IDOC_INPUT_MATMAS01 is just for maintenence of few fields in MM02 (may be custom fields).
    Can anyone point out if my thing is in right direction?
    Also please offer any solution where shall I put the Custom Logic in the EXIT or the some variants of
    BAPI_IDOC_INPUT1.
    A less technical explanation would be appreciated as I come from a functional background and invloved in this for writing the func specs. I want to make it sure that what I write is not useless and makes some sense.
    Thanks in advance,
    Arunesh

    Hi Lalit,
    Did some head breaking with the function module - BAPI_IDOC_INPUT1 to check whether it is calling the EXIT_SAPLMV02_002 internally. Couldn't get anywhere.
    On question of another EXIT in BAPI_IDOC_INPUT1, I don't see any. I am not very proficient in ABAP code, I must say though.
    I found the list of exits from google, almost same list everywhere.
    http://www.sapfans.com/forums/viewtopic.php?f=21&t=296637
    here I got the EXIT, I am talking about.
    Any other way to find either the EXIT or link the above?
    -- Arunesh

  • Reena Prabhakar - Sales order creation Using BAPI

    Hi Reena,
    This is Dinesh,i also face problem in Sales order creation using BAPI if you can send me the code it would be great help to me.
    Regards,
    Dinesh

    Anyhow, here is the code that I am using currently which works perfectly well. Not sure if it will be of any help to you, since the values to the BAPI come from the Webdynpro application. I have values stored in my "Test data directory" which I use for testing from the backend.
    FUNCTION ztest.
    Call the BAPI to create Sales Order
      CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
        EXPORTING
          order_header_in     = l_order_header
        IMPORTING
          salesdocument       = l_salesdocument
        TABLES
          return              = it_return
          order_items_in      = it_order_items
          order_partners      = it_order_partners
          order_schedules_in  = it_order_schdl
          order_conditions_in = it_order_conditions
          order_text          = it_order_text.
      READ TABLE it_return WITH KEY type = 'E'.
      IF sy-subrc = 0.
    *-- error occured
        CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
      ELSE.
    *-- no error
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
      ENDIF.
    ENDFUNCTION.

  • Need sales order creation using bapi in oops

    need code for sales order creation using bapi in oops

    hi rocky,
              could you pls give a bit explanation on what you are expecting.
    regards,
    Pavan

Maybe you are looking for