cancel
Showing results for 
Search instead for 
Did you mean: 

Re:Item Event

Former Member
0 Kudos

Hi All,

In my addOn ItemEvent is executing multiple times.(3 to 4 times).What is this issue and how should i solve this problem?

Kindly give me the solution.....:-)

Thanx in advance

Mohana

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

perhaps, when you change value on one field (textbox,Combo,etc...) your addon changes values on several field on your form... so ItemEvent fired each time you "update" each item/field...

... it seems your should verify with pval.InnerEvent porperty to avoid execute 3 or 4 times Itemevent.

Kinds regards

Former Member
0 Kudos

Hi,

plz give some example of using pval.innerevent.so it will be very useful for me.

Regards

Mohana

Nussi
Active Contributor
0 Kudos

Hi,

a sample can be:


If pVal.FormTypeEx = "134" And pVal.EventType = et_ITEM_PRESSED And pVal.ItemUID = "1" And pVal.BeforeAction = False and pVal.InnerEvent = False then
    'Button 1 pressed - BeforeAction is False and InnerEvent is False
end if

lg David

Former Member
0 Kudos

(stranged... the follow response went to another forum question!:S)

You should searching in sdk Help for clearing...

You may something like that (example in pseudoCode):

InnerEvent function()

begin

if pval.beforeaction =true then

select case pval.itemuid

case 'txtA':

if pval.innerevent = false then

'note: innerEvent= false means a directed action of end user

update information in txtB (for example..)

end if

case 'txtB':

if pval.innerevent =true then

'note: innerEvent=true means an action not directed caused by end user

... do something

end if

endselect

else

endif

end

I hope help you

Kinds Regards

Former Member
0 Kudos

You should searching in sdk Help for clearing...

You may something like that (example in pseudoCode):

InnerEvent function()
begin
 
if pval.beforeaction =true  then
  select case pval.itemuid 
      case 'txtA':
              if pval.innerevent = false then 
                      *'note: innerEvent= false means a directed action of end user*                        
                       update information in txtB (for example..)
              end if 
      case 'txtB':
            if pval.innerevent =true then
                 *'note: innerEvent=true means an action not directed caused by end user* 
                  ... do something
            end if
 
  endselect
 else
 
 endif
 
end

I hope help you

Kinds Regards

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi..

give exit sub or pVal.InnerEvent = False

Regards..

Billa 2007

Former Member
0 Kudos

Hi

1) You can use SetFilters(...) to filter events for your form (see function example below).

Select only filters what you need. Call function when Add-on loading...

2) In the Events Handler Subs add conditions for pVal.EventType and set BubbleEvent..

Regards

Sierdna S.


Private Sub SetFilters()

  Dim oFilters As SAPbouiCOM.EventFilters = Nothing
  Dim oFilter As SAPbouiCOM.EventFilter = Nothing

  Try

    '// Create a new EventFilters object
    oFilters = New SAPbouiCOM.EventFilters

    '// MENU_CLICK
    oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_MENU_CLICK)
    oFilter.AddEx("169")        'Menu
    oFilter = Nothing

    '// FORM_DATA_ADD
    oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD)
    oFilter.AddEx("140")        ' 
    oFilter = Nothing

    '// FORM_DATA_LOAD
    oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_FORM_DATA_LOAD)
    oFilter.AddEx("YOUR_FORM_TYPEEX") '
    oFilter = Nothing

    '// FORM_DATA_UPDATE
    oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_FORM_DATA_UPDATE)
    oFilter.AddEx("YOUR_FORM_TYPEEX") '
    oFilter = Nothing

    '// FORM_ACTIVATE
    oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_FORM_ACTIVATE)
    oFilter.AddEx("YOUR_FORM_TYPEEX") '
    oFilter = Nothing


    '// FORM_CLOSE
    oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_FORM_CLOSE)
    oFilter.AddEx("YOUR_FORM_TYPEEX") '
    oFilter = Nothing

    '// FORM_LOAD
    oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_FORM_LOAD)
    oFilter.AddEx("YOUR_FORM_TYPEEX") '
    oFilter = Nothing

    '// FORM_UNLOAD
    oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD)
    oFilter.AddEx("YOUR_FORM_TYPEEX") '
    oFilter = Nothing

    '// RIGHT_CLICK
    oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_RIGHT_CLICK)
    oFilter.AddEx("YOUR_FORM_TYPEEX") '
    oFilter = Nothing

    '// ITEM_PRESSED
    oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED)
    oFilter.AddEx("YOUR_FORM_TYPEEX") '
    oFilter = Nothing

    '// KEY_DOWN
    oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_KEY_DOWN)
    oFilter.AddEx("YOUR_FORM_TYPEEX") '
    oFilter = Nothing

    '// VALIDATE
    oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_VALIDATE)
    oFilter.AddEx("YOUR_FORM_TYPEEX") '
    oFilter = Nothing

    '// DOUBLE_CLICK
    oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_DOUBLE_CLICK)
    oFilter.AddEx("YOUR_FORM_TYPEEX") '
    oFilter = Nothing

    '// CHOOSE_FROM_LIST
    oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST)
    oFilter.AddEx("YOUR_FORM_TYPEEX") '
    oFilter = Nothing

    '// Setting the application with the EventFilters object
    SBO_Application.SetFilter(oFilters)

  Catch ex As Exception
    ' log exception
  Finally
    oFilter = Nothing
    oFilters = Nothing
    System.GC.Collect() 'Release the handle to the table
  End Try

End Sub

Edited by: Sierdna S on Oct 9, 2008 2:47 PM