Hi Kuldeep,
To update Bill of Material using DIAPI use this:
1. Use object oProductTrees as follows:
SAPbobsCOM.ProductTrees oProductTree = (SAPbobsCOM.ProductTrees)oCompany.GetBusinessObject(BoObjectTypes.oProductTrees);
2. Using GetByKey() Method check for existing Bill of Material.
3. Loop through all items in the Bill of Material or just update header as per your need.
4. Finally Update the Bill of Material.
Hope it helps.
Thanks & Regards
Ankit Chauhan