cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Choose From List and User Fields

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello,

Try to set your textbox value or string not the dbdatasource object value.

Regards,

J-

Former Member
0 Kudos

Hi Gianluca,

try to eliminate the line

oFrm.Update()

and try out, it should work.

Regards

shiva