cancel
Showing results for 
Search instead for 
Did you mean: 

SAPSCRIPT/VBS -Identify/Control a new screen (pop-up)

Former Member
0 Kudos

Hello experts.

I search a solution to control a new screen (pop-up).

Via a specific transaction (ZSU01), i fill some field (user, reference, comment, ...), and i execute => a new screen appear.

Problem : When i record a sapscript, all actions generated on the new screen is not recorded.

Question : How i can control actions in a new screen? I can switch screen?

Maybe i can identify the new screen (by id? ..) and modify my current session with a new Connection.Children ?

Edited by: Christophe Boudinet on Mar 8, 2010 5:42 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

script_man
Active Contributor
0 Kudos

Hi Christophe,

basically, a script can be recorded only in the first mode. Is the new screen a new mode, we must proceed as follows:

1. The script will be recorded in the first mode should be terminated

2. The resulting script must be manually added the following lines:

For example:


...
session.findById("wnd[0]/tbar[0]/okcd").text = "/i"
session.findById("wnd[0]").sendVKey 0
set wshell = createObject("Wscript.Shell")
PATH = "c:\Documents and Settings\USERNAME\sapworkdir"
wshell.run chr(34) & PATH & "\script_2.vbs" & chr(34)

3. Thereafter, this script should be under a new name eg script_1.vbs be saved.

4. Now the first mode should be closed.

After the first mode has been closed, the new mode (screen) is still open, this is internally declared as the first mode.

5. A new script in the new session is being recorded.

6. Thereafter, this script should be under a new name eg script_2.vbs be saved.

7. Done

When the new screen is not a new mode, I only know the method wshell.sendkeys.

Regards,

ScriptMan

Edited by: ScriptMan on Mar 10, 2010 9:39 AM