Skip to Content

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

Error in Choose from list on Matrix

Hi all,

I am using CFL in matrix for my user define form, When i choose a value from CFL , i am getting the following error

<b>" Item -Can't set value on item because the item can't get focus [66000-153]"</b>

<u>the code i used is given below</u>

<u>this is in Item Event</u>

Try

If FormUID = ("FRMIGRP") Then

If pVal.Before_Action = False Then

If (pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST) Then

' If pVal.EventType = SAPbouiCOM.BoEventTypes.et_GOT_FOCUS 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 val1 As String

Dim val2 As String

Dim val3 As String

Try

val = oDataTable.GetValue(0, 0)

val1 = oDataTable.GetValue(1, 0)

Catch ex As Exception

MessageBox.Show(ex.Message)

End Try

Try

If (pVal.ItemUID = "txtcode") Then

Dim oDS As SAPbouiCOM.DBDataSource

oDS = oForm.DataSources.DBDataSources.Item("@PSSIT_GRPHDR") 'add your dbdatasource here

oDS.SetValue("U_grpcode", oDS.Offset, val) ' val1 is the value you are setting

oDS.SetValue("U_grpname", oDS.Offset, val1)

End If

Catch ex As Exception

MessageBox.Show(ex.Message)

End Try

Try

val2 = oDataTable.GetValue(0, 0)

val3 = oDataTable.GetValue(1, 0)

If (pVal.ItemUID = "matr") And (pVal.ColUID = "supp") Then

Dim oEdit As SAPbouiCOM.EditText

oMatrix.FlushToDataSource()

oForm.DataSources.UserDataSources.Item("EditDS2").ValueEx = val2.ToString

oEdit = subcol.Cells.Item(pVal.Row).Specific

oEdit.Value = val2.ToString

oEdit = subname.Cells.Item(pVal.Row).Specific

oEdit.Value = val3.ToString

("EditDS2").ValueEx = Nothing

End If

Catch ex As Exception

MessageBox.Show(ex.Message)

End Try

End If

And i used data source also to set the value using below code, but for that also value is not set in to the field

Dim oEdit As SAPbouiCOM.EditText

Dim oDS As SAPbouiCOM.DBDataSource

oDS = oForm.DataSources.DBDataSources.Item("@PSSIT_GRPDTL") 'add your dbdatasource here

oDS.SetValue("U_supcode", oDS.Offset, val2) ' val1 is the value you are setting

oDS.SetValue("U_supname", oDS.Offset, val3)

SOmebody can help me to solve this issue

Regards

Suresh R

Former Member
Former Member replied

this is the Code,

Sub SetEmptyRow(ByVal Row As Integer)

Try

Dim oMatrix As SAPbouiCOM.Matrix

oMatrix = PI_Frm.Items.Item("m_det").Specific

DETAIL_oDBds.Offset = Row - 1

DETAIL_oDBds.SetValue("LineId", DETAIL_oDBds.Offset, oMatrix.VisualRowCount)

DETAIL_oDBds.SetValue("U_itno", DETAIL_oDBds.Offset, "")

DETAIL_oDBds.SetValue("U_itdesc", DETAIL_oDBds.Offset, "")

DETAIL_oDBds.SetValue("U_unit", DETAIL_oDBds.Offset, "")

DETAIL_oDBds.SetValue("U_stx", DETAIL_oDBds.Offset, "")

DETAIL_oDBds.SetValue("U_poqty", DETAIL_oDBds.Offset, "")

DETAIL_oDBds.SetValue("U_qnos", DETAIL_oDBds.Offset, "")

DETAIL_oDBds.SetValue("U_rate", DETAIL_oDBds.Offset, "")

DETAIL_oDBds.SetValue("U_total", DETAIL_oDBds.Offset, "")

DETAIL_oDBds.SetValue("U_rdate", DETAIL_oDBds.Offset, "")

DETAIL_oDBds.SetValue("U_act", DETAIL_oDBds.Offset, "")

DETAIL_oDBds.SetValue("U_pur", DETAIL_oDBds.Offset, "")

DETAIL_oDBds.SetValue("U_pdate", DETAIL_oDBds.Offset, "")

oMatrix.SetLineData(Row)

Catch ex As Exception

'app.MessageBox(ex.Message)

End Try

End Sub

Regards,

Anitha

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question