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

Password comparision

Former Member
0 Likes
766

Hi Friends,

I have five passwords in my ztable.

Now my requirement is to validate password, if i enter a password ,then it should not accept the previous five passwords which are in my ztable.

i tried with concatenation, but it is not working properly.

whether I need to compare each password independently or is there any other way.

Could any one plase help me with piece of code.

Thanks in advance.

Regads,

kumar.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
735

Hi,

U can use


SELECT *
        FORM ztable
        WHERE PASS = <NEW_PASS>.

IF sy-subrc = 0.
  MESSAGE 'Password already Present.' type 'E'.
ENDIF

6 REPLIES 6
Read only

Former Member
0 Likes
736

Hi,

U can use


SELECT *
        FORM ztable
        WHERE PASS = <NEW_PASS>.

IF sy-subrc = 0.
  MESSAGE 'Password already Present.' type 'E'.
ENDIF

Read only

Former Member
0 Likes
735

Hi Kumar,

You need to compare the password with all your stored passwords in z table. You can take all entries of z table into an internal table and use loop endloop statement.

Thanks.

Nitesh

Read only

Former Member
0 Likes
735

Hi,

Use a simple select query ,,,

Select password from ztable where password = 's_pwd'

if sy-subrc = true

"pwd present "

end if.

Regards

Renu

Read only

Former Member
0 Likes
735

Hy Kumar,

Mark the password as key field in ztable....That will satisfy u r requirement

Regards

Sas

Read only

Former Member
0 Likes
735

Hi,

Take all the entries of your ztable in itab.

Then using loop compare it with the given password.

if it matches give message

Thanks & Regards

Read only

Former Member
0 Likes
735

i got the answer. Thanks for all responses.