Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

9.1 error adding BOM with SAPbobsCOM.ProductionItemType.pit_Resource


I'm working on 9.1 sapb1 version.

I'm trying to add a new BOM. All is ok until my itemType is SAPbobsCOM.ProductionItemType.pit_Item.

If I try to change this using the new properties of the BOM SAPbobsCOM.ProductionItemType.pit_Resource i retrieve an error: Errore nella creazione della distinta TEST (No matching records found (ODBC -2028)).

This is my simple code:


    Private distinta As SAPbobsCOM.ProductTrees

    Private distinta_riga As SAPbobsCOM.ProductTrees_Lines

distinta = myDB.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oProductTrees)

distinta.TreeCode = itemCodePadre

distinta.Quantity = 1 'qta

distinta.TreeType = SAPbobsCOM.BoItemTreeTypes.iProductionTree

distinta.PriceList = idListino

distinta_riga = distinta.Items

For line As Integer = 0 To dt.Rows.Count - 1

                        itemType = dt.GetValue("itemType", line)

                        itemCodeFiglio = dt.GetValue("itemCode", line)

                        qta = dt.GetValue("qty", line)

                        If line > 0 Then


                        End If

                        distinta_riga.SetCurrentLine(distinta_riga.Count - 1)

                        Select itemType.ToLower

                            Case "articolo"

                                distinta_riga.ItemType = SAPbobsCOM.ProductionItemType.pit_Item

                                Case "risorsa"

                                distinta_riga.ItemType = SAPbobsCOM.ProductionItemType.pit_Resource

                        End Select

                            distinta_riga.ItemCode = itemCodeFiglio

                             distinta_riga.Quantity = qta


                    ret = distinta.Add()


I have find no examle in sdk, so i don't know if, mabe, there is a mandatory field that i don't set.

Someone can help me?




Helpful Answer

Not what you were looking for? View more on this topic or Ask a question