Please follow the process mention in the below link for material
Importing the Multiple materials and fields from excel from Local file system using BADI
similar to it there is a sample code given by SAP,you need to talk to them to get it,I search long time once I find the template and code may be reply bcak to you.