Track SAP GUI versions before upgrade

You need to know that your users are using the correct version of the SAP GUI before you upgrade the back-end system. SAP provides a user-exit since at least version 3.1H where you can run your own custom code immediately after users log in. The code and the process below work in 3.1H to 4.6C.

1. Create a custom table to track the additional data during login. I called mine ZUSR41 and added the following fields (data elements in parenthesis):


2. In CMOD create a project and add SAP enhancement SUSR001. In function module EXIT_SAPLSUSF_001 double-click the include program ZXUSRU01 to create it. Insert the following code:

  rfcsi,                               " Structure for RFC_SYSTEM_INFO
  zusr41.                              " Data stored at login

  lv_hostadr LIKE msxxlist-hostadr,
  lv_dec TYPE i.

* Get information about the user's GUI.
CLEAR rfcsi.
          rfcsi_export       = rfcsi
          OTHERS             = 1.

* Some versions of SAP GUI don't return the hostname or IP address;
* call TH_USER_INFO to get the missing info.
IF rfcsi-rfcdest IS INITIAL
OR rfcsi-rfcipaddr IS INITIAL.
  CLEAR lv_hostadr.

    Requires Free Membership to View

'TH_USER_INFO' IMPORTING hostaddr = lv_hostadr terminal = rfcsi-rfcdest EXCEPTIONS OTHERS = 1. * Convert the IP address from hex form. lv_dec = lv_hostadr+0(1). WRITE lv_dec TO rfcsi-rfcipaddr+0(3) LEFT-JUSTIFIED. rfcsi-rfcipaddr+3(1) = '.'. lv_dec = lv_hostadr+1(1). WRITE lv_dec TO rfcsi-rfcipaddr+4(3) LEFT-JUSTIFIED. rfcsi-rfcipaddr+7(1) = '.'. lv_dec = lv_hostadr+2(1). WRITE lv_dec TO rfcsi-rfcipaddr+8(3) LEFT-JUSTIFIED. rfcsi-rfcipaddr+11(1) = '.'. lv_dec = lv_hostadr+3(1). WRITE lv_dec TO rfcsi-rfcipaddr+12(3) LEFT-JUSTIFIED. CONDENSE rfcsi-rfcipaddr NO-GAPS. ENDIF. CLEAR zusr41. * Get "Windows System" (also Mac, etc.). Some versions of the SAP GUI * return a misleading operating system name -- call WS_QUERY to get * additional info. CALL FUNCTION 'WS_QUERY' EXPORTING query = 'WS' IMPORTING return = zusr41-ws EXCEPTIONS inv_query = 1 no_batch = 2 frontend_error = 3 OTHERS = 4. * Record date, time, and user in the ZUSR41 work area. zusr41-datum = sy-datum. zusr41-uname = sy-uname. zusr41-uzeit = sy-uzeit. * Find the last sequence number for this date and user, then increment * by 1 to ensure a unique key. SELECT MAX( seqnr ) INTO zusr41-seqnr FROM zusr41 WHERE datum = zusr41-datum AND uname = zusr41-uname. ADD 1 TO zusr41-seqnr. * Record the login data in the ZUSR41 work area. MOVE-CORRESPONDING rfcsi TO zusr41. * Store that login data in the database. INSERT zusr41. COMMIT WORK.
3. Back in CMOD activate your project.
4. Log in to test!

This was first published in July 2002

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

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.