cancel
Showing results for 
Search instead for 
Did you mean: 

Operational tasks with the SDK

Former Member
0 Kudos

As I get more familiar with the SDK, I am trying to determine whether it's even possible to accomplish what I am trying to do - performing a cycle count, for example, from my own application and passing the counts back to SAP. I don't see anything in the web service side that will do this, and the only cycle count related methods I see in the DI API appear to be able to add items to be counted, but not actually perform the count. Before I spend much more time on it, am I trying to do something that just can't be done? Thanks in advance for any advice the community can provide.

Accepted Solutions (1)

Accepted Solutions (1)

edy_simon
Active Contributor
0 Kudos

Hi Kyle,

If you are referring to inventory stock count,

The DI API does allow you to perform this task.

below is VB code to add the stock count :

                        Dim oStockTake As SAPbobsCOM.StockTaking = oCompany.GetBusinessObject(BoObjectTypes.oStockTakings)

                        Dim sItemCode As String = oDT.GetValue("ItemCode", i)

                        Dim dQuantity As Double = oDT.GetValue("Count", i)

                        oStockTake.ItemCode = sItemCode

                        oStockTake.WarehouseCode = sWhsCode

                        oStockTake.Counted = dQuantity

                        Dim lErr As Integer = oStockTake.Add

I am not sure about the WS though.

Regards

Edy

Former Member
0 Kudos

Please bear with my ignorance, but what object is represented by "oDT"?

edy_simon
Active Contributor
0 Kudos

Hi Kyle,

Dont worry...

oDT in my code is a SAPbouiCOM.DataTable object.

I kept all the Item Code and the quantity in this datatable from external source, and when creating the Stock Take, I read the data from this Object.

Regards

Edy

Answers (1)

Answers (1)

Johan_H
Active Contributor
0 Kudos

Hi Kyle,

What Edy said, plus the Web service uses the DI API to communicate with the B1 system anyway, so you might as well cut out the middle man, so to speak. It is also much harder to debug.

The only thing is, that it does not seem to be possible yet to perform the actual Inventory Postings via the StockTaking object (nor does it have its own object), but as that bit is only a couple of clicks in the client...

Another possiblity is to use the DTW as the middle man. So your workflow becomes:

1. Your application creates the import files (tab delimited text)

2. The DTW imports the files. If I am not mistaken, it allows for command line arguments, so perhaps you could even call and run it from your own app.

3. A user performs the Inventory Posting in the B1 client.

Regards,

Johan