Skip to Content
author's profile photo
Former Member

ItemEvent problem..

Hi all!

===============

Source Coding :

===============

Private Sub vAppl_ItemEvent(ByVal FormUID As String, pVal As SAPbouiCOM.IItemEvent, BubbleEvent As

Boolean)

If pVal.FormType = 2000000100 Then

If pVal.EventType = et_ITEM_PRESSED And pVal.ItemUID = "17" Then

Test()

End If

End If

End Sub

-


When I Clicked a butten (item) it should work a Event at vAppl_ItemEvent.

In upper source code it should be work Test() Function.

A problem of vAppl_ItemEvent is a working twice same Event( Test Function ).

Thank you for your help.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    Posted on Feb 14, 2005 at 09:09 AM

    Hi Choi,

    You should take care of Before_Action property of the ItemEven object (pVal). The Event is executed twice, first before executing SBO´s default procedure, and seccond after executing SBO´s default procedure.

    So you must decide when you want to handle the event, and look at the pVal.Before_Action property before calling Test function.

    Hope helps,

    Ibai Peñ

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Feb 14, 2005 at 09:13 AM

    > A problem of vAppl_ItemEvent is a working twice same

    > Event( Test Function ).

    You get the Event BEFORE pressing (validate here for example) and after pressing (do actions after something it's done). You are able to distinguish those zwo events using the BeforeAction property of the item event.

    So if you want to catch the event just once, decide if you want to catch before or after pressing and just add some code to your if-clause.

    If pVal.EventType = et_ITEM_PRESSED
        And pVal.ItemUID = "17" 
        And pVal.BeforeEvent = false Then
    
        Your code
    
    End If
    

    Add comment
    10|10000 characters needed characters exceeded