â2012 May 14 12:11 PM
Hi Gurus,
I'm trying to update my "Password" field value by comparing it with "New Password" Field value and deleting the value in New Password Field.
Let me explain it, in my aplication i have a Change Password Option,
Such that when i click that button, it gives two field i.e., Old Password And New Password,
Now by comparing Old Password With Password field in table , The value given in New Password Field should go and update in Password Field.
i'm attaching a image just check it out.
can anybody say, how to update one field value with another field value and delete value from later field.
i.e., update PASSWORD field with NEW PASSWORD field value and delete NEW PASSWORD value or it should not get saved in table itself,
instead update Password field value.
HELP Me guys.
â2012 May 14 12:21 PM
â2012 May 14 12:43 PM
hi Pawan,
how can i code it to update it.....
i select it from table through select query...
finding it confusiing....how to do it,
suggest me please.
thank you
â2012 May 14 12:22 PM
You have to encrypt while storing. You will find more details in SCN for storing passwords in DB. Please search for it.
If you have time, please read this http://scn.sap.com/community/abap/blog/2012/03/21/how-your-passwords-are-stored
â2012 May 14 1:23 PM
Are you trying to get BIG RED ARROWS onto the screen? Is that it?
â2012 May 14 1:29 PM
no no,
i'm pointing the three fields i have taken.
in screen i'll give value in New password, but while updating it should update password field.
how can i code it.
â2012 May 14 1:48 PM
data: ls_emptab TYPE zemployee_tab.
SELECT password oldpassword from zemployee_tab where personnumber = <Id from screen>.
IF <old password from screen> = password.
ls_emptab-newpassword = <new password from screen>.
ls_emptab-password = <new password from screen>.
Modify zemployee_tab from ls_emptab transporting newpassword password where personnumber = <id from screen>.
endif.
As keshavadas has mentioned you should consider using the MD5 hash functions to store your passwords. Anyone can check the passwords if you store it in plain text.
â2012 May 14 2:56 PM
Oh I see! Getting BIG RED ARROWS onto the screen would have been a much more interesting topic post. If you search the SDN for your password requirement you will find lots of help. You will not find as much help for big red arrows, which would warrant a better reason for your post.
Che
â2012 May 15 7:09 AM
Hi Shambu,
I tried the code snippet you posted but it shows errors,
like password field is not attached with any structure or internal table.
another error is that it is not accepting TRANSPORT statement.
just check the attachment please.
thank you
â2012 May 15 11:48 AM
It's time that you invest some own research effort, don't just paste errors for others to solve them.
Locked.
Thomas
â2012 May 14 2:01 PM
Lock table record for given personnumber.
Read data from table with given personnumber into workarea say LS_EMPLOYEE_TAB
if LS_EMPLOYEE-PASSWORD = <screen_field>-OLDPASSWORD.
LS_EMPLOYEE-PASSWORD = <screen_field>-NEWPASSWORD .
else.
"wrong password
endif.
Modify table from workarea LS_EMPLOYEE_TAB.
commit.
Unlock