on 08-04-2021 10:56 AM
Hello !
In view of counting how many rows I have in my table, I usually export it via `VBA` in excel then count the rows. Is there any way to get it directly from `SAP`? I tried to get it by `.VerticalScrollbar.Maximum`, but unless I don't use it properly, it didn't give me the right number...
ScrollBar = session.findById("wnd[0]/usr").VerticalScrollbar.Maximum
MsgBox ("ScrollBar= " & ScrollBar)
In other words: In this filed I have 316 rows (counted with the excel export); `.VerticalScrollbar.Maximum` gives me 267 rows. Where are the 49 rows left in my count ?
I also found out that that this "information" button make this window appear:
And these two numbers make the 316 I'm looking for: 395-79 = 316
So I tried to interact with this window while recording a macro and it only saves this interaction:
session.findById("wnd[1]/usr/sub/1[0,0]/sub/1/6[0,10]/sub/1/6/8[0,14]/lbl[28,14]").setFocus
session.findById("wnd[1]/usr/sub/1[0,0]/sub/1/6[0,10]/sub/1/6/8[0,14]/lbl[28,14]").caretPosition = 0
No way to copy these numbers...
Thanks for reading and have a good day!
babozo
Hello Houcem-Eddine,
the Maximum property delivers the maximum position of the scrollbar thumb in pixels - that is really what the documentation says. I assume in a context of an ALV list it is the maximum number of lines, without those that are already displayed. So add the PageSize property to the Maximum and you get the number of all lines in the ALV list.
And decrement one, maybe for the header.
Best regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
With ALV in SAPGui, not all data is loaded into the table on the screen. It only comes in when you scroll down. I'm wondering if this is something similar? I.e. you only ever see a window of the data.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
11 | |
10 | |
8 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.