Skip to Content
author's profile photo
Former Member

Update User Defined Field using DBDataSource

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    author's profile photo
    Former Member
    Oct 07, 2005 at 09:30 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Oct 07, 2005 at 09:33 AM

    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

    Add comment
    10|10000 characters needed characters exceeded