Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Hi All CFL Error

hi,

when selecting vendor i set the vendor code and vendor name like purchase order using CFL but i getting error-

Item - Can't set value on item because the item can't get focus. [66000-153]

Awaiting soon reply

Rajkumar Gupta

Former Member
Former Member replied

Hi,

maybe you try to set the EditText.Value or .String on the CFL-Event?

This is what I do on a CFL-Event "Not BeforeAction" (also a DbDataSource and on a User defined form(!)) :

            '### ChooseFromLists
            '#
            If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then
                Dim oCflEvent As SAPbouiCOM.IChooseFromListEvent
                Dim oCfl As SAPbouiCOM.ChooseFromList
                Dim oDataTable As SAPbouiCOM.DataTable
                Dim cflID As String
                Dim cflValBefore As String = ""

                oCflEvent = pVal
                cflID = oCflEvent.ChooseFromListUID
                'Dim oForm As SAPbouiCOM.Form
                'oForm = SboConnection.SboUI.Forms.Item(FormUID)
                oCfl = oForm.ChooseFromLists.Item(cflID)
                If Not oCflEvent.BeforeAction Then
                    oDataTable = oCflEvent.SelectedObjects
                    If oDataTable Is Nothing Then Exit Sub

                    If cflID = "CFL_BPNO" Or cflID = "CFL_BPNOB" Then ' Bus.-partner - for both: CFL-EditText and CFL-Button 
                        '### Setting the selected values in the form:
                        '#
                        cflValBefore = oDbDs.GetValue("U_CardCode", oDbDs.Offset)
                        oDbDs.SetValue("U_CardCode", oDbDs.Offset, oDataTable.GetValue("CardCode", 0))
                        '# setting additional fields:
                        oUds.Item("UDS_BPNAME").ValueEx = oDataTable.GetValue("CardName", 0)
                        ' Set the DBDataSource (not EditTextValue - but this does not change the FormMode if needed):
                        oDbDs.SetValue("U_SlpCode", oDbDs.Offset, oDataTable.GetValue("SlpCode", 0)) 
                        ' Set the FormMode by code but I don t wanna UpdateMode when the same BP is selected again:
                        If oForm.Mode != SAPbouiCOM.BoFormMode.fm_ADD_MODE Then _
                            If cflValBefore != oDbDs.GetValue("U_CardCode", oDbDs.Offset) Then oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE
                        '#
                        '###
                    ElseIf cflID = "CFL_SLPCOD" Then ' SlpCode - only a CFL-Button for the SlpCode-Combo
                        cflValBefore = oDbDs.GetValue("U_SlpCode", oDbDs.Offset)
                        oDbDs.SetValue("U_SlpCode", oDbDs.Offset, oDataTable.GetValue("SlpCode", 0))
                        If oForm.Mode != SAPbouiCOM.BoFormMode.fm_ADD_MODE Then _
                            If cflValBefore != oDbDs.GetValue("U_SlpCode", oDbDs.Offset) Then oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE
                    End If

                End If
            End If
            '#
            '####

Edit: Changed < and > to "!=" because "<>" it is not visible in this forum

Maybe replace "!=" with less and greater symbol

Edited by: Roland Toschek on Sep 17, 2008 3:01 PM

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question