cancel
Showing results for 
Search instead for 
Did you mean: 

How to add or remove from stock?

0 Kudos

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?

moshenaveh
Community Manager
Community Manager
0 Kudos

Welcome to the SAP Community! We're glad you've come here to get answers to your questions.

Since you're asking a question here for the first time, I'd like to offer some friendly advice on how to get the most out of your community membership and experience.

Please see https://community.sap.com/resources/questions-and-answers, as this resource page provides tips for preparing questions that draw responses from our members. Feel free to take our Q&A tutorial at https://developers.sap.com/tutorials/community-qa.html, as that will help you when submitting questions to the community. And connect with our SAP Champions for advice about asking questions.

You should also make sure your e-mail notifications are turned on for "Comments and answers to my questions and questions I follow" at #communications -- so you won't miss any replies to your question.

In addition, I recommend that you include a profile picture. By personalizing your profile, you encourage readers to respond: https://developers.sap.com/tutorials/community-profile.html.

Now for some specific suggestions on how you might improve your question:

* Outline what steps you took to find answers (and why they weren't helpful) -- so members don't make suggestions that you've already tried.

* Share screenshots of what you've seen/done (if possible), as images always help our members better understand your problem.

Should you wish, you can revise your question by selecting Actions, then Edit.

The more details you provide (in questions tagged correctly), the more likely it is that members will be able to respond.

I hope you find this advice useful, and please let me know if you require any additional guidance!

Accepted Solutions (0)

Answers (1)

Answers (1)

ShaneLipke
Product and Topic Expert
Product and Topic Expert
0 Kudos

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

0 Kudos

Thanks for your answer.

But where stand, that my question is an "Enable Now" question?

The only tag was "Digital Transformation".

I have now added the tags "SAP Business One" and "SAP Business One Extensibility" to it.

0 Kudos

Thanks for your answer.


I have now added the tags "SAP Business One" and "SAP Business One Extensibility" to it.