Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 10548

DI API: Updating Item Master Data

$
0
0

Hi All,

 

Using the SAPbobsCOM Object in VBA, I have created some functionality to create, remove or update an Item. while Create and Remove work spot on, I am struggling with the Update part. I would like to set an Active Item to Inactive on the Master Data window.

 

what I know from having done this in the DTW previously is that Active must be set to N and Inactive must be set to Y at the same time.

 

So I tried to replicate this using the SAPbobsCOM object but with no luck. Here is my code, based on a pop up window asking the user to pick Update or Delet as an action to run on the Item:

 

 

vItem.ItemCode = Worksheets(1).Range("A2").Value
If sMaintenanceOperation = "Update" Then
    vItem.Valid = tNO
    vItem.Frozen = tYES
End If
If sMaintenanceOperation = "Update" Then
    vItem.Update
Else
    vItem.Remove
End if

 

 

I get error -2028 when I run the Update part, which I believe means the Item doesn't exist. I am positive the Item does exist.

 

The same Item gets removed as expected if I run the remove part, which shows the vItem.ItemCode works fine.

 

What else is missing? Is it not working on the same principle as the DTW?


Viewing all articles
Browse latest Browse all 10548

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>