on ‎2013 Mar 01 2:33 AM
Hi
I'm having trouble with a GUI table automation through VB (GuiTableControl.)
What is the best way to run though each row in a table - if i want to extract all values in a table not
just those displayed on the screen.
eg 4 rows are display on the screen. But if the table contain more entries, how do I move the
table to the fifth row.
oidtable.verticalScrollbar.Position = 4 ' fifth row..
sometime works and other times crashes..
is there a better way to move through all items one by one...not just the ones displayed..
The rows collection , contains rows on the screen.
This can get rows but again it only work for the four rows displayed on the screen rows (0-3)
oidtable.rows.item(3).item(0).text
how do i get the fifths row in a table..
mike.
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
I recently faced with a similar situation with the GuiTableControl.
A colleague wanted to extract data from a table which only have 2 visible rows whereas there are 2000+ rows in total. My first thought, like yours, was to use VerticalScrollBar.Position to scroll down the table, but the script crashes after it completed the 1st loop.
After trial and error with different strategies, my VBA script finally works. The key is to re-declare the GuiTableControl object after each scroll. It seems that whenever the VerticalScrollBar position changes, the table is re-loaded is SAP and all the cells are reset in reference to the VerticalScrollBar position. This is probably why SAP throw an exception when trying to get the value from the table after the 1st loop - the GuiTableControl declared initially no longer exist in memory after the scroll.
Anyway, my solution steps are basically as follow:
This way, we eliminate the need to use VBS for Sendkey and only needs VBA to do the job.
Thanks,
Sayuti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.