on 03-13-2023 1:11 PM
Hi!
I want to add and remove items from stock with VBA.
The database-tables I can access with the DI:
*** Items ***
Tables: OITM ITM10
Code:
Dim oItem As New SAPbobsCOM.Items
Set oItem = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems)
Dim KeyVorhanden As Boolean
keyExists = oItem.GetByKey(theKey) ' theKey = OITM.ItemCode / ITM10.ItemCode
oItem.Update
------------------------
** BusinessPartner***
Table: OCRD
Code:
Dim oBP As New SAPbobsCOM.BusinessPartners
Set oBP = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oBusinessPartners)
Dim KeyVorhanden As Boolean
keyExists = oBP.GetByKey(theKey) ' theKey = OCRD.CardCode
oBP.Update / oBP.Add
--------------------
*** Orders ***
Tables: ORDR RDR1
Code:
Dim oOrder As SAPbobsCOM.Documents
Set oOrder = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)
keyExists = oOrder.GetByKey(theKey) ' theKey = ORDR.CardCode
oOrder.Update
--------------
But now I want to add to stock. The tables are OBTN and OBTQ.
Or adding transactions. The tables are OITL and ITL1
How to access them?
With
Dim oST As New SAPbobsCOM.StockTransfer
Set oST = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oStockTransfer)
KeyVorhanden = oST.GetByKey(??)
???
Any idea?
Hi Patrick,
This is not an Enable Now question. Can you please edit your question and change the tags on the question to post it to a different community. No one looking at the Enable Now community will be able to help with this question.
Thanks
Shane
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
100 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.