cancel
Showing results for 
Search instead for 
Did you mean: 

SAP gui Scripting: error due to popup

Former Member
0 Kudos

Hi expert,

I discover recently the SAP gui scripting functionality and I am having lot's of fun...

I am trying to mass generate (or clear) orders using SAP script fonctionality.

I first record one example, then amend the script, and then re run for multiple products in one go.

It works fine most of the time...

Unfortunately due to some master data setup the script sometime needs to be slighly changed from one orders to another (e.g if there is a minimum qty maintained I got a popup "are you sure you want to save", then my script bug...)

Most of the time just pressing enter or yes will help me, but I can't (or I don't want to) find out in advance when it will. So basically I want my script to be flexible enough to handle differents scenario.

I tried to modify the code to include a condition (if there is a popup, click enter) but I am not sure what the condition should look like... (obviously it should not look like anything I tried)

E.g:

If xxxxxxxx Then

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

(or session.findById("wnd[1]/usr/btnBUTTON_1").press)

End if

Can somebody help me to fill the xxxxxxxxxxxxx, or explain to me how I should do?

I hope it makes some sense...

Many thanks in advance

Julien

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Julien,

I have had sucess with this:

If Session.ActiveWindow.Name = "wnd[1]" Then

End If

Best Regards,

Cas

Answers (1)

Answers (1)

Former Member
0 Kudos

Thanks Cas,

Seems to work fine.

I had on my side make it work with "Isobject", but it didn't work the first time I tried... still don't know why!

You soluiton looks actually better!

Thanks and Regards

Julien