Go to transaction code KKPHIE and enter the cost object (usually the plant code)


 

 

 


Double click on the cost object group in which you want to assign the material,

Then click on 

 




Click on   and then on  to be able to add new materials.
Add the respective material and then go back and click save       .