Hi Tiru,
I have solved such an issue with an enhancement at the end of the FM GET_STPO.
Here you can change "internal table WA" for change in BOM data. If you want to delete or add a component, you need to change the "internal table ADD_WA" too. And be carefull about the field ADD_WA-INDEX, it should be incremental.