Dear Govind,
Please elaborate what do you mean by material codes?
There are Multiple methods of Migrating Data into D365 Finance & Operations, Business Edition. Try exploring Configuration Packages (Formerly RapidStart) also you can use web services and the excel add-in to input any data into any table.
You can also use the Edit in Excel function wherever available to input data.