Filehost.ro - gazduire fisiere
Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
Nou pe simpatie:
Ank_beleaua
Femeie
25 ani
Bucuresti
cauta Barbat
35 - 51 ani
Mrrrr's Forum (VIEW ONLY)ReguliInregistrareLoginPozeNu sunteti logat. Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides /

[EXCEL] SAP ALV Table Select All and Copy

Pagini: 1 Moderat de TRaP, TonyTzu
pus acum 2 luni#1
TRaP
Moderator
Postari: 960
We've been having trouble with running a code from Excel to access SAP. It has worked for almost 10 years now, and suddenly on one laptop it just wouldn't copy.

While trying to identify the why, I also tried to make the code less prone to errors, and in this endeavor I found an alternative to a contextMenu option that could save us in other situations as well.

In this case, however, the code was not the problem, nor the size of the ALV table, SAP was not the problem, and the printer was not the problem either.

After a Windows restart it all worked fine. So, I guess Windows was the problem. Windows on that particular laptop, maybe.

Anyway, here's the alternative Excel VBA code to copy entire ALV table from SAP to clipboard and later paste to Excel range:


SAP_session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").SelectAll
SAP_session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").contextMenu
SAP_session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectContextMenuItemByText "Copiere text"


This also works:

SAP_session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectAll
SAP_session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").contextMenu
SAP_session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectContextMenuItem "&LOCAL&COPY"


 
   
Pagini: 1  
Mergi la