Get "Login info" from SAP Login Object

Document ID : KB000121214
Last Modified Date : 19/11/2018
Show Technical Document Details
Introduction:
Using GET_LOGIN, you can only read the login entries of self-defined systems or applications, not from operating systems!! Make sure that the specified Type is also available in the variable UC_LOGIN_TYPES. I.e., you can only use it for self-defined login types.
Instructions:
An SQLI Vara can be used to retrieve this information for SAP logins:
 
SELECT CASE 
        WHEN OLC_Host = '*'
            THEN 'ALL'
        ELSE OLC_Host
        END + 'CLNT' + substring(OLC_Login, 1, 3) AS SAP_LOGSYS
    ,substring(OLC_Login, 5, 14) AS SAP_User
FROM OLC
INNER JOIN OH ON OLC_OH_Idnr = OH_Idnr
WHERE OLC_Type = 'R3'
    AND OH_DeleteFlag = 0
    AND OH_Client = 100
    AND OH_Name LIKE 'LOGIN.SAP.%'

You can set the client by changing the value of OH_Client in the statement above. In OH_Name you can give the names of the login-objects.