cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Clipboard while transfering Data from SAP to Excel

Former Member
0 Kudos

I use the clipboard for a import of ordernumbers to excel. i use this code to copy all the numbers (the whole column):

.findById("wnd[0]/usr/cntlALV_CONTAINER/shellcont/shell").selectColumn "AUFNR"

.findById("wnd[0]/usr/cntlALV_CONTAINER/shellcont/shell").contextMenu

.findById("wnd[0]/usr/cntlALV_CONTAINER/shellcont/shell").selectContextMenuItemByPosition "0"

Usually it works, but: Only the first 98 Numbers are transfered. Overall about 300 Numbers should be transfered, but they arent.

When i do this step by hand, it works sometimes, sometimes not. i have no idea why. the numbers are only 7 digit, so i dont think my memory is too small

i paste the numbers with this code:

Range("A3").PasteSpecial skipblanks:=True

someone got a solution?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Ok, i solved the problem.

The grid view has at the beginning 97 lines of data. first if you begin to scroll down more and more data is added to the gridview.

so i had to scroll down first completly before taking the numbers!

peter_atkin
Active Contributor
0 Kudos

Hi

I have the very same issue with IW38 using similar code above resulting in the following message: "Not all data has been copied into the clipboard"

Example: IW38 selects 4305 records, then I run the script. The first 98 rows have the correct data, and the last 107 rows also have the correct data, but all the middle row have no data. NOTE: the script copies all 4305 rows, but most of them have blank data

How did you get around this issue?

PeteA

holger_khn
Contributor
0 Kudos

Hi Pete.

Don´t know how you scroll down before taking data into clipboard. But this way you need to scroll down the ALV-list in steps so that all lines was visible before taking into clipboard.

Btw, when working in IW38 I prefer download from ALV-list into MS ACCESS database directly. And include all my VBA coding into this ACCESS database for further action.

Holger