cancel
Showing results for 
Search instead for 
Did you mean: 

Return Value into Textbox from CLF Form

Former Member
0 Kudos

Hi All

I Designed a Form using Screen Painter and Add some items on that form.One of them is Textbox with ChooseFromList.

Actually what i need is when i select the CLF it opens the Form which contains the Master Data of a Patient .When i select any row from the form code value should fill into the Textbox .

Here iam getting error opening a form using choose from list is working well .when i want return the value into the Textbox it showing the Error Message

Collection - Out of boundaries  [66000-34]

Code:


Dim CLFEvent As SAPbouiCOM.IChooseFromListEvent
                    Dim CLF_Form As SAPbouiCOM.Form
                    Dim CLF_ID As String
                    CLFEvent = pVal
                    CLF_ID = CLFEvent.ChooseFromListUID
                    CLF_Form = SAPapp.Forms.Item(FormUID)
                    Dim CLF As SAPbouiCOM.ChooseFromList
                    CLF = CLF_Form.ChooseFromLists.Item(CLF_ID)
                    If CLFEvent.Before_Action = False Then
                        Dim oDataTable As SAPbouiCOM.DataTable
                        oDataTable = CLFEvent.SelectedObjects
                        Dim val As String
                        val = oDataTable.GetValue(0, 0)
                        If (pVal.ItemUID = "txtPRegno") Or (pVal.ItemUID = "CFL_2") Then
                            CLF_Form.DataSources.DBDataSources.Item("@TB_PATIENTINFO").SetValue("Code", pVal.Row - 1, val)
                        End If
                    End If

Here iam getting the error msg


CLF_Form.DataSources.DBDataSources.Item("@TB_PATIENTINFO").SetValue("Code", pVal.Row - 1, val)

can any one suggest the answer

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi madhu,

That error usually arises from trying to access a Field or DataSource that does not exist. In this case I guess that either there is no @TB_PATIENTINFO table, or it does not have a "Code" field or the CFL_Form was instantiated with a form other then your user form.

Regards,

Vítor Vieira

Former Member
0 Kudos

Thanks for ur response

I created a user defined table TB_PATIENTINFO of object Type MasterData

In Screen Painter I Designed a Form

The Form Contains an Textbox Item

I Binded this TextBox with "U_PCode" from @TB_VISITDETAILS and Given and CLF with Object Type UDO_PINF which is Created for TB_PATIENTINFO

and also given "Code" in ChooseFromListAlias of the Textbox item properties

When i run the form it displays CLF in the TextBox and When i Clicked the CLF button it Displays the TB_PATIENTINFO Default Form .From that iam selecting a patient information according to alias give in the textbox item it should display the Patient Code in the TextBox but here iam getting the Problem

of the above error text msg which i posted earlier

this is the process i done to the textbox and clf button and written the above code posted for the clf button but iam getting the error there

can any one suggest the answer

YatseaLi
Product and Topic Expert
Product and Topic Expert
0 Kudos
CLF_Form.DataSources.DBDataSources.Item("@TB_PATIENTINFO").SetValue("Code", 0, val)
Former Member
0 Kudos

Thanks for ur response

I used the code that u suggest


CLF_Form.DataSources.DBDataSources.Item("@TB_PATIENTINFO").SetValue("Code", 0, val)

but iam getting the same error again

collection out of boundaries

my problem is partially solved

i assigned the "val" directly to textbox item instead of using the above code

here iam getting the value into the textbox but it also showing an error msg.


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

how should i clear this error

can any one suggest correct answer

Answers (0)