01-30-2008 2:13 PM
Hi,
I have made a user-exit that creates the user on our CUA system using BAPI BAPI_USER_CREATE1. The problem is that I cant find the functionality to deactivate the password for the user. Does anyone know a BAPI (or another RFC) or maybe another nice way to fix this?
I know I can do it using batch input and wrap it in a RFC, but that is not very pretty.
/Gitte
01-31-2008 10:08 AM
Found the answer my self.
In logon structure CODVN and CODVC should be set to X.
04-21-2008 10:55 AM
The SAP does the deactivation of the password in a different way. I have tried to debug the SAP program and found out that there is a FM to actually deactivate the password in CUA system.
Find the below the code for the same.
CONSTANTS : l_c_method TYPE bapimethod VALUE 'PWDINIT'.
DATA : l_v_bcode TYPE usr02-bcode,
l_v_usrname TYPE bapibname-bapibname.
DATA : l_wa_logondata TYPE bapilogond.
CLEAR l_wa_logondata.
l_wa_logondata-bcode = l_v_bcode.
l_wa_logondata-codvn = 'X'.
CLEAR l_v_usrname.
l_v_usrname = l_v_user_username.
CALL FUNCTION 'SUSR_ZBV_USER_SEND'
EXPORTING
username = l_v_usrname
method = l_c_method
subsystem = l_v_uszbvsys-subsystem
logondata = l_wa_logondata
EXCEPTIONS
wrong_system = 1
OTHERS = 2.
IF sy-subrc NE 0.
CONCATENATE 'Password for the User'
l_v_user_username
'could not be deactivated'
INTO l_v_log_string
SEPARATED BY space.
ELSE.
CONCATENATE 'Password for the User'
l_v_user_username
'has been Deactivated'
INTO l_v_log_string
SEPARATED BY space.
ENDIF.