Skip to Content
0

​SDK: How to properly execute click button

Oct 31, 2017 at 02:13 PM

36

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Danilo Kasparian Oct 31, 2017 at 03:07 PM
0
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
Show 4 Share
10 |10000 characters needed characters left characters exceeded

Hi Danilo,

Your suggestion does change the panel but the procurement wizard does not work correctly using that method as it still thinks it on the previous step. Since the procurement wizard SAP provides expects the buttons to be used to change the panel, I must simulate having the next button pressed to skip the next step.

Is there a event I can catch when the panel is done loading, execute btnNext.Item.Click() ?

Regards,

William

0

I update the answer, I used BeforeAction = false now

Din`t test though.

0

Hi Danilo,

The new solution you provided work. Can you do one favour for me? For the if statement I have part of the code was comment out. It was this text showing below

'And pVal.BeforeAction = False Then

Can you remove the single quote before the word and, and also before the text before and, remove the word then? This was the change I need to make the code work correctly.

Thanks for the help,

William

1

Good that it works! I edited the answer as your comment, tks!

1