on 12-14-2015 8:17 AM
Hi Guys,
how can I Count the numer of (open) sessions?
I tried several approaches but nothing worked
(I also haven't found any discussion about this)
thanks
bw
Michael
Hello Michael,
you can count the number of sessions with
Connection.Children.Count
Cheers
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you want to count only non-busy sessions where Scripting is enabled below function will give number of sessions according to filter criteria.
Public Function CountSessions() As Integer
Dim iSession As Integer
iSession = 0
If oSAP_APP Is Nothing Then Set oSAP_APP = SAP_Applic
If Not oSAP_APP Is Nothing Then
For Each oConnection In oSAP_APP.Children
If Not oConnection.DisabledByServer Then
For Each oSession In oConnection.Children
If oSession.Busy = False Then
iSession = iSession + 1
End If
Next
End If
Next
End If
CountSessions = iSession
End Function
Hello Michael,
to count the open session windows, which means the windows that are not iconified, you can try this:
OpenWin = 0
For i = 0 To connection.children.count - 1
Set session = Connection.Children(CInt(i))
If session.busy = false Then
Set window = session.activewindow
If window.iconic = false Then
OpenWin = OpenWin + 1
End If
End If
Next
MsgBox OpenWin
Let us know your results.
Cheers
Stefan
Thank you very very much for the quick respone to all of you
thanks
br
Michael
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.