Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9129

Re: VBA Code to export data from SAP and save to Desktop

$
0
0

Hello Michael,

 

welcome in the Scripting Language forum.

 

I tried the printing of a source code in the SE80 transaction successfully with the following script.

 

Set Wshell = CreateObject("Wscript.Shell")

session.findById("wnd[0]/tbar[0]/btn[86]").press

Do

  bWindowFound = Wshell.AppActivate("Print Screen List")

  WScript.Sleep 1000

Loop Until bWindowFound

session.findById("wnd[1]/usr/ctxtPRI_PARAMS-PDEST").text = "LP01"

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

Do

  bWindowFound = Wshell.AppActivate("Information")

  WScript.Sleep 1000

Loop Until bWindowFound

session.findById("wnd[2]/tbar[0]/btn[0]").press

 

This is exact the same way as yours, but with other controls. In my opinion your script should work. Here your script, which I optimized a little bit, unfortunately without being able to prove it..

 

WScript.Sleep 10000

Set Wshell = CreateObject("Wscript.Shell")

Do

  bWindowFound = Wshell.AppActivate("Pdf995 Save As")

  WScript.Sleep 1000

Loop Until bWindowFound

Wshell.SendKeys ("Parked and Blocked Report" & " " & Format(Date, "mmddyyyy") & ".pdf")

WScript.Sleep 100

Wshell.SendKeys ("{ENTER}")

WScript.Sleep 100

 

Let us know your results.

 

Cheers

Stefan


Viewing all articles
Browse latest Browse all 9129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>