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.
Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) | Reguli | Inregistrare | Login

POZE MRRRR'S FORUM (VIEW ONLY)

Nu sunteti logat.
Nou pe simpatie:
Profil Nicole23
Femeie
25 ani
Bucuresti
cauta Barbat
28 - 65 ani
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides / [EXCEL] SAP ALV Table Select All and Copy Moderat de TRaP, TonyTzu
Autor
Mesaj Pagini: 1
TRaP
Moderator

Inregistrat: acum 8 ani
Postari: 931
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"


pus acum 2 saptamani
   
Pagini: 1  

Mergi la