on 10-25-2011 1:37 PM
Hello,
does anyone know a method to get the SAP GUI version and the patchlevel of all currently logged in users? With transaction SM04 it is only possible to list all users on the current application server with the GUI version, but not with the patchlevel.
Regards,
Jann
Hello Jann,
a call to method GET_GUI_VERSION() of class CL_GUI_FRONTEND_SERVICES should return the information you are looking for.
Best regards
Rolf-Martin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We use the following program to write into an indx database:
REPORT ZSAPGUI_VERSION.
data:
sapgui_version(20),
sapgui_pl(20),
sapgui_type(20).
DATA: BEGIN OF USER_TBL OCCURS 100.
INCLUDE STRUCTURE UINFO.
DATA: END OF USER_TBL.
data: begin of rec occurs 0,
terminal like user_tbl-term,
user like user_tbl-bname,
type like sapgui_type,
version like sapgui_version,
patch like sapgui_pl,
counter type i,
end of rec.
tables indx.
import rec from database indx(ui) id 'GUI_VERSION_TRACE' ACCEPTING PADDING.
clear rec.
call 'C_GUI_VERSION' id 'VERSION' FIELD sapgui_version
id 'PATCHLEVEL' field sapgui_pl
id 'TYPE' field sapgui_type. "#EC CI_CCALL
call FUNCTION 'TH_USER_INFO'
importing terminal = rec-terminal
.
rec-type = sapgui_type.
rec-version = sapgui_version.
rec-patch = sapgui_pl.
rec-user = sy-uname.
rec-counter = 1.
collect rec.
export rec to database indx(ui) id 'GUI_VERSION_TRACE'.
This is built into the login mechanism using EXIT_SAPLSUSF_00 so every logon is saved with user, terminal, gui version and patchlevel and number of logons.
Markus
...and then you can use the following report:
REPORT ZSAPGUI_VERSION_REPORT .
data:
sapgui_version(20),
sapgui_pl(20),
sapgui_type(20).
DATA: BEGIN OF USER_TBL OCCURS 100.
INCLUDE STRUCTURE UINFO.
DATA: END OF USER_TBL.
data: begin of rec occurs 0,
terminal like user_tbl-term,
user like user_tbl-bname,
type like sapgui_type,
version like sapgui_version,
patch like sapgui_pl,
counter type i,
* date like sy-datum,
* HOSTADR like user_tbl-HOSTADR,
end of rec.
data: begin of sum occurs 0,
type like sapgui_type,
version like sapgui_version,
patch like sapgui_pl,
terminals type i,
counter type i,
end of sum.
tables indx.
import rec from database indx(ui) id 'GUI_VERSION_TRACE'.
sort rec.
loop at rec.
clear sum. move-corresponding rec to sum. add 1 to sum-terminals.
collect sum.
endloop.
sort sum.
loop at sum.
* write: / 'Typ', 'Version', 'Patch', 'Terminals', 'Zähler'.
write: / sum-type, sum-version, sum-patch, sum-terminals, sum-counter.
hide: sum-type, sum-version, sum-patch.
endloop.
at line-selection.
loop at rec.
if rec-type = sum-type and rec-version = sum-version and rec-patch =
sum-patch.
* write: / 'Terminal-ID', 'Benutzer-ID', 'Typ', 'Version', 'Patchlevel', 'Zähler'.
write: / rec-terminal, rec-user, rec-type, rec-version, rec-patch,
rec-counter.
endif.
endloop.
top-of-page during line-selection.
format color 1.
write text-002. uline.
Markus
...nearly.
I get a list with the type, version, patch, terminal and counter.
But in the "terminal" coloum is only a number shown. Is there any way to get the name of the terminal / user here? A number is useless in this case, because I cant identify the users with a non up-to-date GUI.
Thanks,
Jann
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.