cancel
Showing results for 
Search instead for 
Did you mean: 

Complete Workflow using VBA (GUI) scripting

Former Member
0 Kudos

Hi,

  I have automated the Workflow processing process in SAP using GUI Scripting. User have to feed the required information in the Excel. Upon clicking a button, system will process the Workflow item from SAP automatically.

In this process, as the last step, system shows a prompt which has  "Complete Work Item" button. As per the process, user have to click this button to complete the workflow.

When I execute the automation script, system is not recognizing the steps for Clicking "Complete Work Item" button. Please refer the below code,

                    session.findById("wnd[0]").sendVKey 11

                     session.findById("wnd[1]").sendVKey 8    'This is the code for Clicking the button from the prompt.



because of this issue, I can't use my automation script.


Note: I have tried to point the focus in the prompt using Tab key. But the Tab key press is not recorded in the script from the SAP system.



Could you please help me in this regard. Let me know, if you need any more information.


Regards,

Vijay.


Accepted Solutions (0)

Answers (1)

Answers (1)

holger_khn
Contributor
0 Kudos

Hello.

I have test with my user and no issues when using this code line:

session.findById("wnd[1]/tbar[0]/btn[8]").press ' Press 'Complete Workitem' button

Do you get any errormessage?

Former Member
0 Kudos

Hi,

I have tried the code "session.findById("wnd[1]/tbar[0]/btn[8]").press"

But I didn't get any issue. The outcome is, it closes the popup (Workflow completed) and opens the First line item in the workflow list. The Expectation is, The Workflow should be completed and then focus should be moved to the workflow node.

Regards,

Vijay.

holger_khn
Contributor
0 Kudos

Hello.

So the 'Complete Work Item' is working fine and then you want to select the next or an specific line of open workflow items from list?

Former Member
0 Kudos

Yes.  But I have written the Code "session.findById("wnd[1]/tbar[0]/btn[8]").press" to press the button. There is no other line of code after this. As the outcome, it opened the workflow item from the list. That is not acceptable as per the process.

Let me know, if you need any more information.

Regards,

Vijay.

holger_khn
Contributor
0 Kudos

Is it the same when you execute Task Manual? Or does System react different?

Former Member
0 Kudos

Yes. I used to record the code from SAP and integrate with VBA. When do the manual steps (which is same in the recorded code), system works perfect. But when execute the automation script, final step alone is different. Its opens the next available workflow request as a additional step.

Not sure what is the route cause.

Regards,

Vijay.

holger_khn
Contributor
0 Kudos

Strange.

I have test on a different workflow object (for DMS) and it was fine. I can see your workflow is related to an different object. Unfortunately I have no similar object in my Q-System workplace. So I can´t test on it.