Home > SAP Tips > Basis administration > Collect SAPGUI patch numbers
SAP Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

BASIS ADMINISTRATION

Collect SAPGUI patch numbers


Carol Whyman
01.14.2005
Rating: -4.03- (out of 5) Hall of fame tip of the month winner


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


We collect SAPGUI patch numbers and other logon information like hostname, userid, O/S, IP address and put it in a custom table. This allows us to easily see what computers need to be patched. We also highlight duplicates which alerts us to users that are trying to share userids. We have an R/3 4.6C system but it should work for other 4.* systems.



Code

We have done this by activating the user exit SUSR0001 (Tcode CMOD-> Utilities -> SAP Enhancements -> F8 Execute). The primary keys we have are:- MANDT USER_ID COMPUTER_NAME ZFILL1 is a data element with the following definition: Elementary type Domain CHAR01 Data type CHAR Length 1 Decimal pl. 0

The table zlogoninfo was created with the following fields:-

MANDT    MANDT  CLNT 3
USER_ID    XUBNAME CHAR 12
COMPUTER_NAME  RFCDEST CHAR 32
USER_OS   SYOPSYS CHAR 10
IP_ADDR RFC   IPADDR  CHAR 15
GUI    SYKERNRL CHAR 4
GUI_PATCH   CHAR30  CHAR 30
DUP_FLG   ZFILL1  CHAR 1
LAST_LOGON_DT   XULDATE DATS 8
LAST_LOGON_TM   XULTIME  TIMS 6

Our user exit has the following code:- 

*----------------------------------------------------------------------*
*   INCLUDE ZXUSRU01                                                   *
*----------------------------------------------------------------------*

* Definitions
* Table to hold user logon information
Tables: Zlogoninfo.

Data Begin of Logon_Dta.
        Include structure Zlogoninfo.
Data End of Logon_Dta.

Data: RFC_Data        like RFCSI,
      Duplicate_Flag  Type c,
      Patch_Level     like CNTLSTRINF-VERSION.

* Pick up Logon information
CALL FUNCTION 'RFC_SYSTEM_INFO' DESTINATION 'SAPGUI'
 IMPORTING
   RFCSI_EXPORT             = RFC_Data.

* Pick up the GUI patch level
CALL FUNCTION 'GUI_GET_FILE_INFO'
     EXPORTING
          FNAME        = 'SAPGUI.EXE'
     IMPORTING
          FILE_VERSION = Patch_Level.

* GUI Patch Level not found
IF SY-SUBRC <> 0.
  Move 'Not Found' to zlogoninfo-Gui_Patch.
ENDIF.

* Check if user has already signed on.
Select Single * from zlogoninfo where user_id  = Sy-Uname
                And              Computer_name = RFC_Data-RFCDest.

* If no record found... add new record otherwise change record If sy-subrc <> 0.
  Logon_Dta-User_Id       = Sy-Uname.
  Logon_Dta-Computer_Name = RFC_Data-RFCDest.
  Logon_Dta-User_OS       = RFC_Data-RFCopSys.
  Logon_Dta-IP_Addr       = RFC_Data-RFCIPAddr.
  Logon_Dta-GUI           = RFC_Data-RFCKERNRL.
  Logon_Dta-GUI_Patch     = Patch_Level.
  Logon_Dta-Dup_Flg       = ' '.
  Logon_Dta-Last_Logon_DT = Sy-Datum.
  Logon_Dta-Last_Logon_TM = Sy-Uzeit.
* Check if user ID exists in the table.  If it does update the flag
  Clear Duplicate_Flag.
  Select Single * from zlogoninfo where user_id  = Sy-Uname.
  If sy-subrc = 0.
    Duplicate_Flag = 'X'.
  EndIF.
* Check if Computer name xists in the table.  If it does update the flag
  Select Single * from zlogoninfo
                  where Computer_Name = RFC_Data-RFCDest.
  If sy-subrc = 0.
    Duplicate_Flag = 'X'.
  EndIF.
  Logon_Dta-Dup_Flg  = Duplicate_Flag.
  Insert into Zlogoninfo values Logon_Dta.
  If sy-subrc <> 0.
  EndIF.
Else.
  Zlogoninfo-User_OS       = RFC_Data-RFCopSys.
  Zlogoninfo-IP_Addr       = RFC_Data-RFCIPAddr.
  Zlogoninfo-GUI           = RFC_Data-RFCKERNRL.
  Zlogoninfo-GUI_Patch     = Patch_Level.
  Zlogoninfo-Last_Logon_DT = Sy-Datum.
  Zlogoninfo-Last_Logon_TM = Sy-Uzeit.
  Update Zlogoninfo.
EndIF.

Rate this Tip
To rate tips, you must be a member of SearchSAP.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
Basis administration
Select Text fields: Case-insensitive
Finding BADIs you can use
Easier maintenance of output types, procedures, conditions, etc.
Is this the quickest way to find a BADI?
Top 10 SAP tips of 2007
Dealing with backup server instability
SAP security audit log setup
Do not use SAP GUI with Internet Explorer 7 Beta
How to reinstall the Support Package Manager from the command line in SAP Basis
Display locked and unlocked SAP transactions

SAP Basis
Error when clicking the SAP GUI logon button
The difference between an SAP system and a non-SAP system
Becoming an SAP administrator: The self-study route
Basis consultant wants to learn NetWeaver Portal
SAP administration information for a Basis interview
Quiz: SAP ABAP development
What does the Parameter tab mean in SU01
Changing a customer message priority level after it's sent
Basis administration info in preparation for an interview
Easier maintenance of output types, procedures, conditions, etc.
SAP Basis Research

SAP Interface Technologies
Is C, C++ and Java knowledge required when learning SAP?
An ABAP user wants to learn XI
Select Text fields: Case-insensitive
Finding BADIs you can use
Quiz: SAP ABAP development
SAP exec discusses Imagineering, the future of development
Tools for enabling SAP screens on a BlackBerry
Is there a 'load of program' option in report generation?
Deleting entries from a dynamic table
Defining a structure in a report

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
Basis  (SearchSAP.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.

HomeNewsTopicsBlogsTipsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 2000 - 2008, TechTarget | Read our Privacy Policy
SearchSAP.com is a search service provided by TechTarget and is completely
independent of and not affiliated with SAP AG.
  TechTarget - The IT Media ROI Experts