I've been trying to find a way to just check BOM if the raw material item open in Item Maintenance is a component of a BOM. It appears there is a FindWhereUsed Function of BM_WhereUsedCommon, but I haven't been able to get it to work.
SET oBM= oSession.AsObject(oSession.GetObject("BM_WhereUsedCommon"))
r = oBM.FindWhereUsed(CI_ItemCode_bus_ItemCode, "N", "SINGLE-LEVEL", 0)
SET oBM = NOTHING
Return is always 1 (Success) no matter the PN. I have also tried the "ReadBillDetail" function which also returns 1 every time. I'm firing this from a button script currently.