Skip to Content
0
Sep 06, 2016 at 09:34 PM

Problems selecting tab via script

1109 Views

Hi everyone,

I've started scripting a few days ago and it works quite well.

But there is one issue I'm still fighting with:

I would like to run the transaction MM01 via VBA Excel script to create part numbers full automatically.

The code works fine until the following bold line:

.....

session.findById("wnd[0]/tbar[1]/btn[30]").press 'Select Button "Zusatzdaten"

session.findById("wnd[0]/usr/tabsTABSPR1/tabpZU05").Select 'Jump to Tab 5 "Grunddatentext"

session.findById("wnd[0]/usr/tabsTABSPR1/tabpZU05/ssubTABFRA1:SAPLMGMM:2110/subSUB2:SAPLMGD1:2031/cntlLONGTEXT_GRUNDD/shellcont/shell").Text = TEXTVARIABLE

session.findById("wnd[0]/tbar[0]/btn[11]").press 'Enter to Save and Close Session.

Selecting tab no. 5 works just a few times but after some loops (<10) the screen looks like this and my code stops working:

Instead of jumping to tab 5 the SAP screen looks like a freezed mixture of tab no. 1 an tab no. 5. And then it stops working.

Selecting tabs is (in my case) always a problem.

Can anyone please tell me how to select a tab without freezing? Why is it not working?

Thanks in advance.

Matthias

Attachments

Problem.PNG (56.4 kB)