cancel
Showing results for 
Search instead for 
Did you mean: 

Script to export result from LT22

Former Member
0 Kudos

Dears ,

to get the last mAterial from storage bin befor getting empty I use following script for LT22 and want to export to excel. Code for windows popup "save as " is integrated, but while SAP popup is still open and I think waiting for answer Code stops.

Accepted Solutions (0)

Answers (1)

Answers (1)

script_man
Active Contributor
0 Kudos

Hi Michael,

I would proceed as follows:

for example:

. . .

session.findbyId("wnd[1]/usr/cmbG_LISTBOX").key = "10"

Call Auto_SaveAs_SAP(session)

session.findfyId("wnd[1]/tbar[0]/btn[0]").press

. . .

Sub Auto_SaveAs_SAP()

set Wshell = createObject("Wscript.Shell")

n = 0
do
  bWindowFound = Wshell.AppActivate("Save as")
  WScript.Sleep 1000
   n= n + 1
   if n > 10 then exit do
Loop Until bWindowFound

WScript.Sleep 500


if bWindowFound then

    'Here is the rest of Auto_SaveAs_SAP(session)

end if

Regards,

ScriptMan