cancel
Showing results for 
Search instead for 
Did you mean: 

Copying value from SAP to Excel [SAP scripting]

agarah
Member
0 Kudos
490

Dears,

I have quite big problem with SAP scripting and I am close to give up. I need to extract particular data from transaction VA03. as this activity is repetitive, I decided to prepare SAP script that will copy needed value from SAP to Excel. Script works excellent to one particular moment - value copying. I readthat SAP Scripting doesn't have direct connection with Windows Clipboard, I tried to emulate crtl+Y and crtl+C by SendVKeys but something still goes wrong.
I cannot just download data to excel - this functionality is not awailabl in this transaction.

To copy data, I need to click crtl Y and crtl C
Excel VBA shows error in moment that I marked in the code. The error message is: "617" - The virtual key is not enabled.
I paste part of code below.
I'm not software developer, just self-educating and it would truly make my work more automated

session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\01/ssubSUBSCREEN_BODY:SAPMV45A:4400/subSUBSCREEN_TC:SAPMV45A:4900/tblSAPMV45ATCTRL_U_ERF_AUFTRAG").getAbsoluteRow(0).Selected = True

session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\01/ssubSUBSCREEN_BODY:SAPMV45A:4400/subSUBSCREEN_TC:SAPMV45A:4900/tblSAPMV45ATCTRL_U_ERF_AUFTRAG/txtVBAP-POSNR[0,0]").SetFocus

session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\01/ssubSUBSCREEN_BODY:SAPMV45A:4400/subSUBSCREEN_TC:SAPMV45A:4900/tblSAPMV45ATCTRL_U_ERF_AUFTRAG/txtVBAP-POSNR[0,0]").caretPosition = 4

session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\01/ssubSUBSCREEN_BODY:SAPMV45A:4400/subSUBSCREEN_TC:SAPMV45A:4900/subSUBSCREEN_BUTTONS:SAPMV45A:4050/btnBT_PKON").press

session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_ITEM/tabpT\05/ssubSUBSCREEN_BODY:SAPLV69A:6201/tblSAPLV69ATCTRL_KONDITIONEN").verticalScrollbar.Position = 12

session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_ITEM/tabpT\05/ssubSUBSCREEN_BODY:SAPLV69A:6201/tblSAPLV69ATCTRL_KONDITIONEN/txtKOMV-KBETR[3,14]").SetFocus

session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_ITEM/tabpT\05/ssubSUBSCREEN_BODY:SAPLV69A:6201/tblSAPLV69ATCTRL_KONDITIONEN/txtKOMV-KBETR[3,14]").caretPosition = 7 [here the proper data is marked out]

session.findById("wnd[0]").sendVKey 90 [this is where error occurs. I tried to emulate crtl Y)

session.findById("wnd[0]").sendVKey 77 [ trying to emulate crtl c]

Accepted Solutions (0)

Answers (0)