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

Re: Download SAP Report in Spreadsheet Format with automatic Save As selection

$
0
0

Hi,

 

Why are you traing to use  that button?Button.PNG

 

It's much easier to use simple Button.PNG its called "Local file" u can grab it by shortcut CTRL+SHIFT+f9...

 

Another option is to use SAP functions:: put "%PC" to command field then enter, and you will get the window with option to save data in excel.

Capture.PNG

 

Please find below some examples to download data to excel:

 

 

'For STANDARD T-CODES like MB52

'-----------------------------------------------------------------------------------------------

'export to excel button

Session.FindById("wnd[0]/tbar[1]/btn[45]").Press

 

 

Session.FindById("wnd[1]/usr/subSUBSCREEN_STEPLOOP:SAPLSPO5:0150/sub:SAPLSPO5:0150/radSPOPLI-SELFLAG[1,0]").Select

Session.FindById("wnd[1]/tbar[0]/btn[0]").Press

 

Uname = CreateObject("WScript.Network").UserName

 

 

Session.FindById("wnd[1]/usr/ctxtDY_PATH").Text = "C:\Users\" & uname & "\Desktop\"

Session.FindById("wnd[1]/usr/ctxtDY_FILENAME").Text = "TEMP.xls"

 

'rewrite

Session.FindById("wnd[1]/tbar[0]/btn[11]").Press

 

 

 

OPTION WITH "%PC"

'-----------------------------------------------------------------------------------------------

'save to TEMP

session.findById("wnd[0]/tbar[0]/okcd").Text = "%pc"

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

session.findById("wnd[1]/usr/subSUBSCREEN_STEPLOOP:SAPLSPO5:0150/sub:SAPLSPO5:0150/radSPOPLI-SELFLAG[1,0]").Select

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

session.findById("wnd[1]/usr/ctxtDY_PATH").Text = "C:\Users\" & Uname & "\Desktop\"

session.findById("wnd[1]/usr/ctxtDY_FILENAME").Text = "TEMP.xls"

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

 

 

 

Best,


Viewing all articles
Browse latest Browse all 9071

Trending Articles