Skip to Content
0
Former Member
Aug 05, 2008 at 04:16 PM

Delete lines of articles in Bill of Materials

189 Views

Hello!

I delete a Bill of Materials the following way (in the code below I shortened the code with xx at several places):

SAPbobsCOM.ProductTrees tree =
    (SAPbobsCOM.ProductTrees)
    xx.GetBusinessObjectSAPbobsCOM.BoObjectTypes.oProductTrees);

// delete BoM only if it exists
//
if(tree.GetByKey("T00001")){
    if(tree.Remove() != 0){
        myErrorMsg("Error deleting Bill of Materials");
        return;
    }
}

After this the BoM is deleted from the database, i.e. rthe corresponding line is deleted from table OITT.

But in table ITT1 all component articles of the deleted BoM are all present!

First I assumed that all entries from ITT1 (component lines of the BoM) are deleted automatically - but I guess I was wrong!

Question: How can I delete the component lines of a BoM I have to delete? There is no method tree.Items.Remove() or something similar to do this.

Thanks to all!

Frank Romeni