‎2009 Nov 26 9:41 AM
hi,
I am new to SAP . Can any one tell me steps involved in uploading Material data using BAPI.
Thanks
‎2009 Nov 26 9:52 AM
Hi,
To upload the material using BAPI try to use BAPI_MATERIAL_SAVEDATA
In this BAPI you need to pass the data into required fields and also need to populate the update structure for the same filed with indicator 'X'.
check the BAPI documentation for more details.
after the BAPI call. use the function mmodule 'BAPI_TRANSACTION_COMMIT*
‎2009 Nov 26 9:53 AM
Hi,
To upload the material using BAPI try to use BAPI_MATERIAL_SAVEDATA
In this BAPI you need to pass the data into required fields and also need to populate the update structure for the same filed with indicator 'X'.
check the BAPI documentation for more details.
after the BAPI call. use the function module 'BAPI_TRANSACTION_COMMIT*
‎2009 Nov 26 10:07 AM
Hi , refer the bellow sample pice of code
Header
BAPI_HEAD-MATERIAL = wa_data-MATNR.
BAPI_HEAD-IND_SECTOR = wa_data-MBRSH.
BAPI_HEAD-MATL_TYPE = wa_data-MTART.
BAPI_HEAD-BASIC_VIEW = 'X'.
BAPI_HEAD-PURCHASE_VIEW = 'X'.
BAPI_HEAD-MRP_VIEW = 'X'.
BAPI_HEAD-STORAGE_VIEW = 'X'.
BAPI_HEAD-ACCOUNT_VIEW = 'X'.
BAPI_HEAD-COST_VIEW = 'X'.
BAPI_MARC1-plant = wa_data-WERKS .
BAPI_MARD1-STGE_LOC = wa_data-LGORT.
BAPI_MARD1-plant = wa_data-WERKS .
BAPI_MARDX-plant = wa_data-WERKS .
BAPI_MARCX-plant = wa_data-WERKS .
BAPI_MARDX-STGE_LOC = wa_data-LGORT.
BAPI_MARA1-OLD_MAT_NO = wa_data-bismt.
BAPI_MARA1-EXTMATLGRP = wa_data-EXTWG.
BAPI_MARA1-DIVISION = wa_data-SPART.
BAPI_MARA1-MAT_GRP_SM = wa_data-MAGRV.
BAPI_MARAX-MATL_GROUP = 'X'.
BAPI_MARAX-BASE_UOM = 'X'.
BAPI_MARAX-OLD_MAT_NO = 'X'.
BAPI_MARAX-EXTMATLGRP = 'X'.
BAPI_MARAX-DIVISION = 'X'.
BAPI_MARAX-MAT_GRP_SM = 'X'.
*MRP 1
BAPI_MARC1-MRP_TYPE = wa_data-DISMM.
BAPI_MARC1-REORDER_PT = wa_data-MINBE.
BAPI_MARC1-MRP_CTRLER = wa_data-DISPO.
BAPI_MARC1-LOTSIZEKEY = wa_data-DISLS.
BAPI_MARC1-MAX_STOCK = wa_data-MABST.
BAPI_MARCX-MRP_TYPE = 'X'.
BAPI_MARCX-REORDER_PT = 'X'.
BAPI_MARCX-MRP_CTRLER = 'X'.
BAPI_MARCX-LOTSIZEKEY = 'X'.
BAPI_MARCX-MAX_STOCK = 'X'.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
HEADDATA = BAPI_HEAD
CLIENTDATA = BAPI_MARA1
CLIENTDATAX = BAPI_MARAX
PLANTDATA = BAPI_MARC1
PLANTDATAX = BAPI_MARCX
STORAGELOCATIONDATA = BAPI_MARD1
IMPORTING
RETURN = BAPI_RETURN
TABLES
MATERIALDESCRIPTION = IT_MAKT
UNITSOFMEASURE = IT_MARM
UNITSOFMEASUREX = IT_MARMX
MATERIALLONGTEXT = IT_MLTX
TAXCLASSIFICATIONS = IT_MLAN.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
Regards
‎2009 Nov 26 12:58 PM
use function module BAPI_MATERIAL_SAVEDATA
and if you hav eto us internal number range use FM BAPI_STDMATERIAL_GETINTNUMBER
if you want to know the procedure how to work with BAPI to upload materian then follow as below
1. go to MM01 and try to create a material and note down the mandatory fields and then go to display mode and check for the other fileds that have data other that what u have given because screen will automatically flow related data based on the data that you have given inputs in the previous screen but for BAPI you have to pass all the field. this is the place where u will find problem
2. no you have all the fields go to BAPI FM and check for mandatory structures
3. now read the documentation of the FM and check for precious information
4. go to FM and open the structures and check for the fields
now you pass to the FM
regards,
venkat suman.
‎2009 Nov 27 3:10 AM