Skip to Content

​SDK: How to properly execute click button

Hi,

I’m currently writing code for the procurement wizard to default to a certain step of the wizard. For my below code example, when the user on panel two, it will execute the next button and go to step three. However, with the below sample code, the same code keeps executing again for panel 2. Do you know what I need to add to my code to ensure the code only execute once?

If pVal.FormType = "540010007" And pVal.ItemUID = "_wiz_next_" And pVal.EventType = 1 Then 'And pVal.BeforeAction = True Then
	Dim oSOForm As SAPbouiCOM.Form
	oSOForm = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount)


	If (oSOForm.PaneLevel = 2) Then
		MsgBox(pVal.EventType)
		Dim btnNext As SAPbouiCOM.Button
		btnNext = oSOForm.Items.Item("_wiz_next_").Specific
		btnNext.Item.Click()
	End If
End if

<br>

Regards

William

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Oct 31, 2017 at 03:07 PM
    If pVal.FormType = "540010007" And pVal.ItemUID = "_wiz_next_" And pVal.EventType = 1 Then And pVal.BeforeAction = False Then
    	Dim oSOForm As SAPbouiCOM.Form
    	oSOForm = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount)
    
    
    	If (oSOForm.PaneLevel = 2) Then
    		MsgBox(pVal.EventType)
    		Dim btnNext As SAPbouiCOM.Button
    		btnNext = oSOForm.Items.Item("_wiz_next_").Specific
    		btnNext.Item.Click()
    	End If
    End if
    Add comment
    10|10000 characters needed characters exceeded