2010 May 26 11:32 AM
Hi All,
I am creating a program to reset the passwords of users. It is a table control having user id and password. User ids and the new passwords can be entered there, and passwords can be reset.
I want to put a validation, where it will read the profile parameter (RZ11) and get the min password length (Current value field in RZ11) and populate an error if the password entered is less than the profile value.
How to go about this? Is there any function module to check this?
Thanks in advance.
Regards,
Arun Mohan
2010 May 26 11:54 AM
Hi Arun,
You can use function module RSAN_SYSTEM_PARAMETER_READ by inputing the desired parameter: login/min_password_lng.
If you test in SE37 t-code, thick the checkbox for upercase/lowercase letters.
Kind regards,
Garcia
2010 May 26 11:50 AM
Hi Arun,
There is one function module through which u get the user parameters.
Function module is : SUSR_USER_PARAMETERS_GET
U can write the code this way :
call function 'SUSR_USER_PARAMETERS_GET'
exporting
user_name = sy-uname
WITH_TEXT =
tables
user_parameters = gt_parameters
exceptions
user_name_not_exist = 1
others = 2
.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
else.
sort gt_parameters by parid.
read table gt_parameters into gs_parameters
with key parid = 'RZ11'
binary search.
if sy-subrc = 0.
p_werks = gs_parameters-parva. "this line wil give u the value for ur parameter.
endif.
endif.
gt_parameters is a table of type usparam and gs_parameters is the structure of type usparam.
p_werks is 1 field in which i want the value of the parameter.
If u fine the answer useful please give points.
2010 May 26 11:54 AM
Hi Arti,
I had asked about system profile parameter (RZ11), not user profile paramter.
Anyway, thanks for your effort.
Arun
2010 May 26 11:54 AM
Hi Arun,
You can use function module RSAN_SYSTEM_PARAMETER_READ by inputing the desired parameter: login/min_password_lng.
If you test in SE37 t-code, thick the checkbox for upercase/lowercase letters.
Kind regards,
Garcia
2010 May 26 11:54 AM
it's a kernel-call:
CALL 'C_SAPGALLPARAM' ID 'PAR_USUB' FIELD PAR_USUB-*SYS*
ID 'PAR_SUB' FIELD PAR_SUB-*SYS*.
PAR_TABLE_READ = 1.
copied from report RSPFPAR.
Edited by: Mylène Dorias on May 26, 2010 12:54 PM
2010 May 26 11:58 AM
Hi ,
Try in this way
data:lng type i.
call 'C_SAPGPARAM'
id 'NAME' field 'login/min_password_lng' "--------->Give your profile parameter here
id 'VALUE' field lng.
Regards,
lakshman.