Skip to Content

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

value is not staying in edit box

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 val1 As String = Nothing
                Dim val2 As String = Nothing
                Try
                    val1 = oDataTable.GetValue(71, 0)
                Catch ex As Exception
                    MsgBox(ex.Message)
                End Try
                If (pVal.ItemUID = "Btn1") Then
                    oEdittext = oForm.Items.Item("crVal").Specific()
                    oEdittext.String = val1
                    SBO_Application.MessageBox("20")
                End If
               
                If (pVal.ItemUID = "Btn2") Then
                    oEditItem = oForm.Items.Item("dbVal").Specific()
                    oEditItem.String = val1
                End If

            End If
        End If

there is two button btn1 and btn2 for using chose from list

two button working chose from list from G/L account code object type ="1". at first time when i chose value from btn1

value is staying in edit box but when i chose value from btn2 value is not staying in edit box.

similarly

when i chose value from btn2

value is staying in edit box but when i chose value from btn1 value is not staying in edit box.

i am using databind both edit box...

i dont know why this is hapening ?

if dont understand ..... i can send full code

replied

Hi Ani Sinha

Good example is SDK_Samples_2005\COM UI\VB.NET\17.ChooseFromList.

And, I has attached some notes.

After you make changes, reguarding this notes, you can have correctly functioning of your code (it's correct).

The problem may be where are you make association of CFLs to items, edit text fields & buttons, specific properties.

Hope its can help you.

Best regards

Sierdna S.

P.S. Notes

First

-


Create all CFL objects on form by using AddChoseFromLists() function example.

Second

-


For every item, what do you want to have CFL object you need to set this specific properties:

- ChooseFromListUID - unique id of CFL;

- ChooseFromListAlias - column to select in CFL table.

An example: I have on form 2 fields for ItemCode and 2 buttons for CFL

-


To every obejct you need to associate own CFL object, so we need to have 4 CFLs.

In xml code it may be so:

 
... we adding userdatasources...
<userdatasources>
  <action type="add">
    ...
    <!-- 1. ItemCode 1 -->
    <datasource uid="uItemCod1" type="9" size="20"/>
    <!-- 2. ItemCode 2 -->
    <datasource uid="uItemCod2" type="9" size="20"/>
    ...
  </action>
</userdatasources>
... we adding items: EditText Fields for ItemCode 1 & 2 and CFL buttons

<items>
<action type="add">

<!-- ========================================= -->
<!-- FORM ITEMS  -->
<!-- ========================================= -->

<!-- ========================================= -->
<!-- Item Code 1 -->
<!-- ========================================= -->
<item uid="eItemCod1" type="16"
      left="121" width="100" top="10" height="14" visible="1"
      enabled="1" from_pane="0" to_pane="0" disp_desc="0" right_just="0"
      description="Item Code 1" linkto="" forecolor="-1" backcolor="-1" text_style="0" font_size="-1"
      supp_zeros="0" AffectsFormMode="1">
  <AutoManagedAttribute />
    <specific TabOrder="10" ChooseFromListUID="1" ChooseFromListAlias="ItemCode" >
     <databind databound="1" table="" alias="uItemCod1" />
    </specific>
</item>
<!-- CFL button 1 for Item 1 -->
<item uid="btnCFL1Itm" type="4" description="Select Item Code 1"
		      tab_order="15" 
		      visible="1" enabled="1" 
		      left="221" width="15" top="10" height="15" 
		      from_pane="0" to_pane="0" disp_desc="0" right_just="0" 
		      linkto="" forecolor="-1" backcolor="-1" 
		      text_style="0" font_size="-1" supp_zeros="0" AffectsFormMode="1">
  <AutoManagedAttribute>
    <Attribute id="CFL1" description="editable" modeAdd="1" />
  </AutoManagedAttribute>
  <specific image="CHOOSE_ICON" ChooseFromListUID="2" />
</item>
...
<!-- ========================================= -->
<!-- Item Code 2 -->
<!-- ========================================= -->
<item uid="eItemCod2" type="16" 
    left="121" width="100" top="25" height="14" visible="1"
    enabled="1" from_pane="0" to_pane="0" disp_desc="0" right_just="0"
    description="Item Code 2" linkto="" forecolor="-1" backcolor="-1" text_style="0" font_size="-1"
    supp_zeros="0" AffectsFormMode="1">
  <AutoManagedAttribute />
  <specific TabOrder="30"  ChooseFromListUID="3" ChooseFromListAlias="ItemCode" >
   <databind databound="1" table="" alias="uItemCod2" />
  </specific>
</item>
<!-- CFL button 2 for Item 2 -->
<item uid="btnCFL2Itm" type="4" description="Select Item Code 2"
		      tab_order="15" 
		      left="221" width="15" top="25" height="15" 
		      visible="1" enabled="1" from_pane="0" to_pane="0" disp_desc="0" right_just="0" 
		      linkto="" forecolor="-1" backcolor="-1" 
		      text_style="0" font_size="-1" supp_zeros="0" AffectsFormMode="1">
  <AutoManagedAttribute>
    <Attribute id="CFL2" description="editable" modeAdd="1" />
  </AutoManagedAttribute>
  <specific image="CHOOSE_ICON" ChooseFromListUID="4" />
</item>

<!-- ========================================= -->
... here CFL objects for CFL collection
<!-- ========================================= -->
<ChooseFromListCollection>
<action type="add">
  <ChooseFromList UniqueID="-1" ObjectType="-1" MultiSelection="0" IsSystem="1" />

  <!-- eItemCod1 -->
  <ChooseFromList UniqueID="1" ObjectType="4" MultiSelection="0" IsSystem="1" />

  <!-- btnCFL1Itm -->
  <ChooseFromList UniqueID="2" ObjectType="4" MultiSelection="0" IsSystem="1" />
  
  <!-- eItemCod2 -->
  <ChooseFromList UniqueID="3" ObjectType="4" MultiSelection="0" IsSystem="1" />
  
  <!-- btnCFL2Itm -->
  <ChooseFromList UniqueID="4" ObjectType="4" MultiSelection="0" IsSystem="1" />

</action>
</ChooseFromListCollection>

Edited by: Sierdna S on Oct 3, 2008 9:57 AM

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