Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9091

Re: Reset Password with BAPI_USER_CHANGE, but without user being forced to change it

$
0
0

Hi Andre

 

It's been a while since I used this but give it a try, I believe this will then not force the password change the next time the user logs in,

 

" Now change the Password.

  CALL FUNCTION 'SUSR_USER_CHANGE_PASSWORD_RFC'

    EXPORTING

      BNAME                           = lv_user

      PASSWORD                        = iv_old_password

      NEW_PASSWORD                    = iv_new_password

      USE_NEW_EXCEPTION               = 1

   EXCEPTIONS

      CHANGE_NOT_ALLOWED              = 1

      PASSWORD_NOT_ALLOWED            = 2

      INTERNAL_ERROR                  = 3

      CANCELED_BY_USER                = 4

      PASSWORD_ATTEMPTS_LIMITED       = 5

      OTHERS                          = 6.

 

 

   " If no Errors - Then Password is correct

   if sy-subrc = 0.

      ev_pwchange_ok = 'X'.

      return.

   else.

      CASE SY-SUBRC.

           WHEN 1.

              ev_return = 'PASSWORD_CHANGE_NOT_PERMITTED'.

           WHEN 2.

              ev_return = 'NEW_PASSWORD_NOT_PERMITTED'.

           WHEN OTHERS.

              ev_return = 'ERROR_WITH_PASSWORD_CHANGE'.

        ENDCASE.

     ENDIF.

 

Regards

 

Arden


Viewing all articles
Browse latest Browse all 9091

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>