Skip to Content
author's profile photo Former Member
Former Member

UI fails to copy the choosen value from ChooseFromList form

I defined a chooseFromList to a column in a matrix, and it does not work. When I click the ikon of CFL the form appears, but the choosen value is not copyed to the cell

Expected Results:

The choosen value should be copyed to the DSResp Column, and the link button appears next to.

Actual Results:

When I choose a record in the CFL form, and press OK, or press duble clik, the CFL form closes, but the choosen value doesn't appears in the DSResp column. If I add/type a value to the column and click somewhere else the link button appears.

Private Sub AddChooseFromList()

Try

Dim oCFLs As SAPbouiCOM.ChooseFromListCollection

oCFLs = oForm.ChooseFromLists

Dim oCFL As SAPbouiCOM.ChooseFromList

Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams

oCFLCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)

oCFLCreationParams.MultiSelection = False

oCFLCreationParams.ObjectType = "171"

oCFLCreationParams.UniqueID = "CFL6"

oCFL = oCFLs.Add(oCFLCreationParams)

Catch

'MsgBox(Err.Description)

End Try

End Sub

Private Sub CreateForm()

.

.

.

oForm.DataSources.UserDataSources.Add("EmpDS", SAPbouiCOM.BoDataType.dt_SHORT_TEXT)

.

.

.

oColumn = oColumns.Add("DSResp", SAPbouiCOM.BoFormItemTypes.it_LINKED_BUTTON)

oColumn.TitleObject.Caption = "Responsible"

oColumn.Width = 90

oColumn.Editable = True

oColumn.DataBind.SetBound(True, "@QUA1", "U_Respon")

oLink = oColumn.ExtendedObject

oLink.LinkedObject = SAPbouiCOM.BoLinkedObject.lf_Employee

oColumn.DataBind.SetBound(True, "", "EmpDS")

oColumn.ChooseFromListUID = "CFL6"

oColumn.ChooseFromListAlias = "empID"

.

.

.

End Sub

Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent

If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then

Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent

oCFLEvento = pVal

Dim sCFL_ID As String

sCFL_ID = oCFLEvento.ChooseFromListUID

Dim oForm As SAPbouiCOM.Form

oForm = SBO_Application.Forms.Item(FormUID)

Dim oCFL As SAPbouiCOM.ChooseFromList

oCFL = oForm.ChooseFromLists.Item(sCFL_ID)

If oCFLEvento.BeforeAction = False Then

Dim oDataTable As SAPbouiCOM.DataTable

oDataTable = oCFLEvento.SelectedObjects

Dim val As String

Dim val2 As String

Try

val = oDataTable.GetValue(0, 0)

val2 = oDataTable.GetValue(1, 0)

Catch ex As Exception

End Try

If ((pVal.ItemUID = "DSResp") Or (pVal.ItemUID = "Button")) And sCFL_ID = "CFL6" Then

oMatrix.Columns.Item("DSResp").Cells.Item(oMatrix.RowCount).Specific.Value = val

End If

End If

End If

End Sub

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Mar 06, 2008 at 06:04 AM

    HI

    replace this code

    If ((pVal.ItemUID = "DSResp") Or (pVal.ItemUID = "Button")) And sCFL_ID = "CFL6" Then

    oMatrix.Columns.Item("DSResp").Cells.Item(oMatrix.RowCount).Specific.Value = val

    End If

    With

    If ((pVal.ColUid= "DSResp") Or (pVal.ItemUID = "Button")) And sCFL_ID = "CFL6" Then

    oMatrix.Columns.Item("DSResp").Cells.Item(oMatrix.RowCount).Specific.Value = val

    End If

    Regards

    Vishnu

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 06, 2008 at 02:28 PM

    Thanks Vishnu,

    Your solution works fine, but only once. I mean in a new record I can copy the choosen value from CFL form, but after, when I'd like to change the value and I open the CFL form, the choosen value fails to copy again. So, the only way to change the value is the manual way, it can be typed, but can't be choosen.

    Thanks,

    Zoltan

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      You've marked this question as answered, but also mentioned that it doesn't work when you want to change the value later.

      There is one line of code that I am confused by and I think it might be causing your problem.

      oMatrix.Columns.Item("DSResp").Cells.Item(oMatrix.RowCount).Specific.Value = val

      It looks to me like this code would only work on the very last row of the matrix. Can you have more than one in the matrix, and does doing the CFL on the last row work, even in a change situation?

      I think that oMatrix.RowCount should be changed to pVal.Row.

      pVal.row will tell you on which row the user performed the CFL.

      HTH

  • author's profile photo Former Member
    Former Member
    Posted on Mar 20, 2008 at 10:26 AM

    Hello John,

    I've tried your advice, and it works! Thanks, very much!

    Regards,

    Zoltan

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.