Skip to Content
0
Former Member
Nov 20, 2009 at 03:56 PM

Problem with Choose From List and User Fields

14 Views

Hi,

I added a user field in the form "Employee Master Data." Then i linked a Choose from List to this user field for the selection of Business Partners.

When I try to set the selected value through the DBDataSource I get the error that it isn't a user-defined object.

Usually i do:

Private Sub ChooseFromListEvents(ByVal pVal As SAPbouiCOM.ChooseFromListEvent, ByRef BubbleEvent As Boolean)

Dim oFrm As SAPbouiCOM.Form = SBO_Application.Forms.Item(pVal.FormUID)

If pVal.BeforeAction = True Then

' *** BEFORE ACTION ***

Else

' *** AFTER ACTION ***

Select Case pVal.ItemUID

Case "1000003", "1000014"

If Not pVal.SelectedObjects Is Nothing Then

oFrm.DataSources.DBDataSources.Item(0).SetValue("U_CodeAuto", 0, pVal.SelectedObjects.GetValue(0, 0))

oFrm.DataSources.DBDataSources.Item(0).SetValue("U_NameAuto", 0, pVal.SelectedObjects.GetValue(1, 0))

oFrm.Update()

End If

End Select

End If

End Sub

but in this case does not work.