Skip to Content
author's profile photo
Former Member

Check SAP username and password.

Hello Experts,

I program a RFC-Function modul which check SAP logon-data.

Import-parameter is username and password.

I would like to know if the password is correct.

Any help would be greatly appreciated.

Thanks

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Oct 04, 2005 at 04:27 PM

    You can always check the user name against the user tables, USR01, USR02, etc. I am not sure about checking the password, but I'm not optimistic.

    Regards,

    Rich Heilman

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Oct 04, 2005 at 04:37 PM

    Hello Rich,

    the password in table USR02 is encrypted.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Oct 04, 2005 at 04:41 PM

    You can check the User/Password with this FM :

        CALL FUNCTION 'SUSR_LOGIN_CHECK_RFC'
             EXPORTING
                  BNAME            = BNAME
                  PASSWORD         = PASSWORD
             EXCEPTIONS
                  PASSWORD_EXPIRED = 0
                  USER_LOCKED      = 1
                  USER_NOT_ACTIVE  = 2
                  WRONG_PASSWORD   = 3
                  NO_CHECK_FOR_THIS_USER = 4
                  OTHERS           = 5.
        CASE SY-SUBRC.
          WHEN 0.  "that's what we know - it's ok
          WHEN 1.  MESSAGE E158(00) RAISING CHANGE_NOT_ALLOWED.
          WHEN 2.  MESSAGE E148(00) RAISING CHANGE_NOT_ALLOWED.
          WHEN 3.  MESSAGE E152(00) RAISING CHANGE_NOT_ALLOWED.
          WHEN 4.  MESSAGE E199(00) WITH BNAME RAISING CHANGE_NOT_ALLOWED.
          WHEN OTHERS.
                   MESSAGE E191(00) RAISING INTERNAL_ERROR.
        ENDCASE.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Oct 04, 2005 at 04:49 PM

    thanks for the helpful and quick answer.

    Add comment
    10|10000 characters needed characters exceeded