‎2008 Jan 03 2:53 AM
Dear Friends,
Im trying to update the usr02.
Here all the fields are getting updated but the field MANDT does not get updated.....earlier its 777 but when im trying to modify it as 001.
its not getting done....so the login fails for thr respective ID.
Can any body help
‎2008 Jan 03 2:58 AM
Hi,
How are you updating this table?
You may need to use CLIENT-DEPENDENT or may need to pass the client while updating .
Regards,
Atish
‎2008 Jan 03 3:00 AM
I have passed the client , all the entries were moved to the table header correctly.......
and commit work gets satisfied.
‎2008 Jan 03 3:07 AM
‎2008 Jan 03 3:13 AM
this is my code...
REPORT ZSAPUSE_PASS_RESET.
type-pools:icon.
Run this progam as sap* in cient xxx. The user you specify
as a parameter, will have the same, client xxx password set in every
client
where it exists.
*
TABLES: USR02, T000.
DATA: PASSWD LIKE USR02-BCODE.
data:p_subrc type sy-subrc.
PARAMETERS: PA_USER LIKE USR02-BNAME.
PARAMETERS: PA_CLIT LIKE USR02-MANDT.
perform get_details changing p_subrc.
IF p_subrc <> 0.
write ICON_FAILURE as icon .
write:/ 'Sorry..Validation failed for the credentials given !!!'.
write:/ 'User ID:',pa_USER color 6 intensified on.
write:/ 'Client :',pa_clit color 6 intensified on.
endif.
SELECT SINGLE * FROM USR02 client specified WHERE BNAME = sy-uname AND MANDT = sy-mandt.
if sy-subrc = 0.
PASSWD = USR02-BCODE.
endif.
clear USR02.
perform get_details changing p_subrc.
if p_subrc = 0.
USR02-BCODE = PASSWD.
USR02-mandt = PA_CLIT.
USR02-LTIME = SY-UZEIT.
USR02-BCDA1 = USR02-BCDA2 = USR02-BCDA3 = SY-DATUM.
USR02-BCDA4 = USR02-BCDA5 = SY-DATUM.
UPDATE USR02.
if sy-subrc = 0.
commit work.
write:/ 'Details Updated successfully !!!' color 5.
else.
rollback work.
write:/ 'Error While Updation !!!' color 6.
endif.
else.
write:/ 'Error While Updation !!!' color 6.
endif.
form get_details changing p_subrc.
SELECT SINGLE * FROM USR02 client specified WHERE BNAME = PA_USER AND MANDT = PA_CLIT .
p_subrc = sy-subrc.
endform.
‎2008 Jan 03 3:17 AM
Concludes an SAP LUW.
Syntax
COMMIT WORK [AND WAIT].
All database updates are written firmly to the database, and all locks are released. Triggers the
database update. The AND WAIT addition allows you to pause the program until the update is
complete. If you omit it, the database is updated asynchronously.
Concludes an SAP LUW.
Syntax
COMMIT WORK [AND WAIT].
All database updates are written firmly to the database, and all locks are released. Triggers the
database update. The AND WAIT addition allows you to pause the program until the update is
complete. If you omit it, the database is updated asynchronously.
‎2008 Jan 03 4:44 AM
Hi,
I think the entries in data base is client specific.
And when u logon in 777 client and trying to update the 001. So it dont work.
So, u need to lohon to 777 and use what ever program u have then it works.
or
2. use a BAPI in u r program which run in 001 client