Skip to Content

How to catch pValActionSuccess event when the YES button on a System Message form is clicked?

Hi, everybody

I am closing my previous thread and posting a much simplified version so as to encourage response.See previous:

https://answers.sap.com/questions/50761/how-can-we-catch-the-after-pressed-event-of-the-re.html

Please see the attached picture which explains my problem:

capture.jpg

Any help will be much appreciated.

Thanks,

Leon Lai

capture.jpg (360.1 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Nov 05, 2016 at 05:17 PM

    Hi Leon,

    Use the following if statement:

    If (pVal.BeforeAction = False 'After sap action
    	And pVal.ActionSuccess = True 'Action with sucess
    	And pVal.FormTypeEx = "120060805"  'Reconciliation form
    	And pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED 'Item pressed with BeforeAction false will be fired after close the system message
    	And pVal.ItemUID = "120000001" 'Reconcile button
    	And pVal.FormMode = 1 
    Then
    	
    	'Do your logic
    
    
    End If
    

    Kind Regards,

    Diego Lother

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 05, 2016 at 11:39 AM

    Hi Leon,

    Switch from the Click event to the Item_Pressed event.

    Click event ActionSuccess is generally equal to true (think of the Click event as the "mouse button down" event).

    The Item_Pressed however, takes into consideration whether the action performed by the button was actually successful (think of the Item_Pressed as the "mouse button up" event).

    Pedro Magueija

    LinkedIn | Twitter | Blog

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 05, 2016 at 03:59 PM

    Hi, Pedro

    Thanks for your reply. I will try your suggestion on Monday.

    But I have a bigger problem. How can I ensure that the Item Pressed event refers to the YES button I am interested in, and not to the YES button on other System Message forms?

    The problem appears to be a hard nut to crack.

    Best Regards

    LEON

    ADDED

    How do we award points in this new web site?

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 07, 2016 at 05:54 AM

    Hi Diego,

    Thanks for your reply.

    Your suggestion seems to work. I am doing a few more tests before marking your answer correct.

    Just one question:

    Please see the attached picture capture1.jpg which explains my question:

    capture1.jpg

    ALSO I am a bit lost with the new website. How do we mark an answer Useful or Answered?

    ADDED -----------------

    Where, in the UI API Help File can we get the codes for form modes?

    I got BoFormMode in the Help Files (see capture2) but I am not sure if we are talking about the same thing.

    capture2.jpg

    Best Regards

    Leon

    Add comment
    10|10000 characters needed characters exceeded

    • Hi, Diego

      Your explanation is very clear.

      And your code works perfectly. Great!

      I have been struggling in vain for the correct answer for months.

      Thanks a lot and Best Regards,

      Leon

      --------

      PS.

      I am trying now to mark the question as answered. But this is the 1st time I do this.

      So, if it doesn't work, hope you won't mind.