Skip to Content

Importing the Multiple materials and fields from excel from Local file system using BADI

This document help us to understand the process of loading the multiple materials with multiple fields using the material using the local and application server file system.It has help us lot to meet business expectations and hence sharing with you all.Please refere to the link How to… MDG-M: Use the Data Import Framework | SCN

1.Define file converter type to be used during the file import


Define the converter type ZIB


2.Creation of BADI for file converter and BADI for implementation


click on create BADI implementation for BADI BADI_MDG_FILECONVERTER for enhancement spot


Provide Enhancement Implementation name and short text


Provide the BADI implementation Name and class


add filter value ZIB


Copy the sample class this will copy the sample code which needs to be modify as per requirement



click on the create classes,it will open up the copied methods.

click on method IF_EX_MDG_FILECONVERTOR~GET_DATA to see the code


you can modified code as per your requirement take help of your technical team to add the code for more number of fields which you will import using CSV file from your local or  Application


3.Importing the file using the webdynpro application MDG_FILE_UPLOAD_CMP, you can find this application in the role SAP_MDGM services folder adn you can add the same application for different can execute this application from NWBC work center or from roles as mention below.


execute the application as mention below,there are two options are available for import as shown below

we are moving with local file system.for importing the file from application you have do some additional setting like defining ports,fiel path as mention in configure document.We are focusing on import of material from local file system.


click on browse to select the file from application


select the fiel and click on add button to upload the file and Next..


it will Persistance choice 1,2 and 3.

1.will trigger the governance process with CR

2.will directly load the material in to active area. will send the error records to staging

in our case we are proceeding with 1 option and provide converter type ZIB as configure next


provide the CR type MAT0B and click on next


click on start upload and click on next…


it will show you the generated CR number .know go to the NWBC click on my CR


it will display the CR which got created


once you open up the CR you have option to process the material one by on or process multiple ones.Activated the CR


the status of CR changed to final check and approved


go back to check in MM03 for the materials got created


I am attaching the sample file whic was give by SAP A-MATMAS.CSV for reference…still we are working on adding more number of fields and how they behave…but hope this will give some relief for us.

You must be Logged on to comment or reply to a post.
  • Hi Shankar,

    Very Nicely documented the entire process for .CSV file import.

    Can you please tell me if we can also upload classification data using the same WD application and loading the data from local machine in .CSV format.

    If yes, then which BADI will be used for this activity?

    Can you please help me in achieving this requirement?



    • Satyam,

      You can use same WD application for uploading the data but the Idoc used for the Classification data is different.Hence you have load the classfication seperatly with different CR and BADI.

         It is the same place mention in the doc. where you can define your own BADI with CLFMASS IDOC types and segments.

      • Hi Shankar,

        Thanks for the reply.

        Can you please share with us the template .CSV file for CLFMAS Idoc as well as  we are bit confused while preparing it in our landscape.

        We have included  fields like Object key,Class Type, Internal Char number,Char Value in the template. Please let us know if any other fields from AUSP table or any other table is required while loading the data though the above method mentioned in your beautiful doc.

        Also, please confirm on  the below statement and correct me if I am wrong.

        “After loading the MATMAS file for new material creation into ECC by this method, the new material numbers gets created by enabling key mapping in ECC, so I think we have to fill the newly generated material numbers in CLFMAS file also in place of object key after taking the extract of the new material numbers”.

        Awaiting for your prompt reply.



          • Dear Satyam,

            we have used the same template,we have loaded with just material numbers and rest of the things were hard coaded system takes care automatically.

              Coming to AUSP it is an characteristic value which is again seperate IDoc type CHRMAS,we are still working on it.May be you can check with your developer how to take it forward.



          • Hi Shankar,

            Thanks for the reply.

            Can we also generate the material numbers thought this file upload approach if we leave the MATNR field as blank in the excel file? If yes, then how can we configure it?

            For AUSP, my question was , that we load the Material data into the system , then if we want to load the classification data as well for those material numbers , then what should be the file structure like?

            Any Comments and help would be very helpful.



  • Hi Shankar,

    I am not getting the option to upload materials through local drive, only DIF i can see, option to upload multiple materials is not showing up even i dont see it in the roles also, is it part of standard MDG functionaity or you customised the ui

  • Hello Shankar,


    Good doc, but when i upload the material facing the error-


    “Material number does not exist for material”


    Any thoughts?




  • Hi  Shankar,


    Could you please share complete  code for BADI BADI_MDG_FILECONVERTER related to material import?


    Thank you in advance,