Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Update Password Through Module Pool Program.

Former Member
0 Likes
2,017

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.

10 REPLIES 10
Read only

Pawan_Kesari
Active Contributor
0 Likes
1,828

and.. the problem is?

Read only

0 Likes
1,828

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

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,828

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

Read only

che_eky
Active Contributor
0 Likes
1,828

Are you trying to get BIG RED ARROWS onto the screen? Is that it?

Read only

Former Member
0 Likes
1,828

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.

Read only

Former Member
0 Likes
1,828

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.

Read only

che_eky
Active Contributor
0 Likes
1,828

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

Read only

Former Member
0 Likes
1,828

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

Read only

ThomasZloch
Active Contributor
0 Likes
1,828

It's time that you invest some own research effort, don't just paste errors for others to solve them.

Locked.


Thomas

Read only

Pawan_Kesari
Active Contributor
0 Likes
1,828

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