10-31-2017 2:13 PM - edited 02-04-2024 1:32 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
Good that it works! I edited the answer as your comment, tks!
User | Count |
---|---|
89 | |
7 | |
6 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.