PARAMETERS: p_usr TYPE sy-uname DEFAULT sy-uname.
PARAMETERS: p_pwd TYPE rsyst-bcode.
AT SELECTION-SCREEN OUTPUT.
LOOP AT screen INTO DATA(screen_wa).
IF screen_wa-name = 'P_PWD'. " wenn Eingabeparameter P_PWD
screen_wa-invisible = 1. " dann Anzeige als Passwortfeld
MODIFY screen FROM screen_wa.
ENDIF.
ENDLOOP.
START-OF-SELECTION.
CALL FUNCTION 'SUSR_LOGIN_CHECK_RFC'
EXPORTING
bname = p_usr
password = p_pwd
EXCEPTIONS
wait = 1
user_locked = 2
user_not_active = 3
password_expired = 4
wrong_password = 5
no_check_for_this_user = 6
internal_error = 7.
CASE sy-subrc.
WHEN 0.
WRITE: / 'Password OK'.
WHEN 1.
WRITE: / 'wait'.
WHEN 2.
WRITE: / 'user_locked '.
WHEN 3.
WRITE: / 'user_not_active'.
WHEN 4.
WRITE: / 'password_expired'.
WHEN 5.
WRITE: / 'wrong_password '.
WHEN 6.
WRITE: / 'no_check_for_this_user'.
WHEN 7.
WRITE: / 'internal_error'.
WHEN OTHERS.
WRITE: / 'Other error.'.
ENDCASE.