Skip to Content
author's profile photo Former Member
Former Member

Create stocktaking using sdk

Hi all,

We are trying to create a stocktaking using the following piece of code but when the system try to save the document (ST.Add), system crashes with message vhost32.exe has stopped working. What is wrong on the following?

Dim ST As SAPbobsCOM.StockTaking ST = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oStockTakings) ST.ItemCode = "10001" ST.WarehouseCode = "00" ST.Counted = 5 ST.Add()
Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    Posted on Nov 14, 2012 at 05:18 AM

    Hi Fedias,

    I have similar code running in SBO 882. PL 8 without problem.

    Have you try clearing the temp folder / reinstall the DI API ?

    What is your SBO Version ?



    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 07, 2013 at 02:17 PM

    I asked support about this also. Currently they have no plans to opening this up.

    I put an "idea" in at:

    Maybe if we get enough votes they will add it back in.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 23, 2016 at 03:45 PM

    excuse me, someone has some example of accounting for stock Sap Bussines one through di api , it does not work right through me and I need to do one of a web service for a android application consuming the service. I have this does not work , I'm using the version 9.10.150 sap PL 05

    Dim oStockTaking As SAPbobsCOM.StockTaking

    ' Dim oRecord As SAPbobsCOM.Recordset

    ' oRecord = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

    'oRecord.DoQuery("SELECT * FROM MyStockTableTbale")


    Dim i As Integer

    ' For i = 0 To oRecord.RecordCount - 1

    oStockTaking = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oStockTakings)

    oStockTaking.ItemCode = TableLines.Rows(0).Item(0) 'oRecord.Fields.Item("ItemCode").Value

    oStockTaking.WarehouseCode = "02"

    oStockTaking.Counted = TableLines.Rows(0).Item(2)

    If oStockTaking.Add() = 0 Then

    MessageBox.Show("Error: " & oCompany.GetLastErrorDescription)

    End If

    ' oRecord.MoveNext()

    ' ReleaseObject(oStockTaking)

    ' Next

    MessageBox.Show("Done Processing")

    this is what I have but I Fail

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.