cancel
Showing results for 
Search instead for 
Did you mean: 

Update User Defined Field using DBDataSource

Former Member
0 Kudos

Hi All,

I'm trying to update the user defined field using the DBDataSource object. However an error occurred - "Item is not a User-Defined Field".

The code used is as follows:

Dim oDS as SAPbouiCOM.DBDataSource

Dim oForm as SAPbouiCOM.Form

Set oForm = SBO_Application.Forms.GetForm("139", 1)

Set oDS = oForm.DataSources.DBDataSources.Item("ORDR")

oDS.SetValue("U_Field1",oDS.Offset,"abc")

Please help.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

you can't set value to a dbdatsource on a system form.

you have to update the value by using the item bound to the UDF, or the combo.

Dim oEdit as SAPbouiCOM.EditText

oEdit = oForm.Items.Item("itemUID").Specific

oEdit.String = "your value"

HTH

Sebastien

Answers (1)

Answers (1)

Former Member
0 Kudos

If you haven´t put the field directly in the standard form the user defined fields are in a different form. This form has the same type but with "-" before it.

So so should use this code to get the user defined fields form:

Set oForm = SBO_Application.Forms.GetForm("-139", 1)

Maybe this can be the cause