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

How to validate password?

Former Member
0 Likes
570

Hi friends by giving emplogin and password i want to validate password.

Please can you help with this...requirement...

i have a table with client name and password as field ..

and my code is this but its not working ..

Data declarations for local variables..

DATA : L_CODE TYPE ZUFPL7.

DATA : L_SUPNAM TYPE ZUFPL7.

data declarations

data: EMPLOGIN TYPE ZFIR_PASS-EMPLOGIN,

PASSWORD TYPE ZFIR_PASS-PASSWORD.

select statement....

MODULE USER_COMMAND_1111 INPUT.

CASE SY-UCOMM.

WHEN 'LOGIN'.

SELECT SINGLE EMPLOGIN

FROM ZFIR_PASS

INTO L_CODE

WHERE EMPLOGIN IN ZFIR_PASS-EMPLOGIN.

IF SY-SUBRC <> 0.

MESSAGE I000.

ENDIF.

SELECT SINGLE PASSWORD

FROM ZFIR_PASS INTO L_SUPNAM

WHERE PASSWORD IN ZFIR_PASS-PASSWORD.

IF SY-SUBRC <> 0.

MESSAGE I000.

ENDIF.

CALL SCREEN 1000. " if emplogin & password matches

ENDCASE.

ENDMODULE. " USER_COMMAND_1111 INPUT

Hi friends by giving emplogin and password i want to validate password.

Please can you help with this...requirement...

i have a table with client name and password as field ..

and my code is this but its not working ..

Data declarations for local variables..

DATA : L_CODE TYPE ZUFPL7.

DATA : L_SUPNAM TYPE ZUFPL7.

data declarations

data: EMPLOGIN TYPE ZFIR_PASS-EMPLOGIN,

PASSWORD TYPE ZFIR_PASS-PASSWORD.

select statement....

MODULE USER_COMMAND_1111 INPUT.

CASE SY-UCOMM.

WHEN 'LOGIN'.

SELECT SINGLE EMPLOGIN

FROM ZFIR_PASS

INTO L_CODE

WHERE EMPLOGIN IN ZFIR_PASS-EMPLOGIN.

IF SY-SUBRC <> 0.

MESSAGE I000.

ENDIF.

SELECT SINGLE PASSWORD

FROM ZFIR_PASS INTO L_SUPNAM

WHERE PASSWORD IN ZFIR_PASS-PASSWORD.

IF SY-SUBRC <> 0.

MESSAGE I000.

ENDIF.

CALL SCREEN 1000. " if emplogin & password matches

ENDCASE.

ENDMODULE. " USER_COMMAND_1111 INPUT

3 REPLIES 3
Read only

Former Member
0 Likes
538

Hi,

You have to pass both login id and password to where clause.

DATA : L_CODE TYPE ZUFPL7.

DATA : L_SUPNAM TYPE ZUFPL7.

*data declarations

parameters: p_EMPLOGIN TYPE ZFIR_PASS-EMPLOGIN,

p_PASSWORD TYPE ZFIR_PASS-PASSWORD.

MODULE USER_COMMAND_1111 INPUT.

CASE SY-UCOMM.

WHEN 'LOGIN'.

SELECT SINGLE EMPLOGIN

FROM ZFIR_PASS

INTO L_CODE

WHERE EMPLOGIN = p_emplogin and

password = p_password.

IF SY-SUBRC 0.

MESSAGE I000.

ENDIF.

CALL SCREEN 1000. " if emplogin & password matches

ENDCASE.

ENDMODULE. " USER_COMMAND_1111 INPUT

Reward.

Read only

Former Member
0 Likes
538

Hi,

By seeing the above code i came to unstand ur new to ABAp.

write select query as follows:

select count(*) from <tab> where emplogin = <field> and password = <password>.

if sy-subrc eq 0.

call screen 100 or some thing else......

else.

message

endif.

Read only

Former Member
0 Likes
538

Hi,

use function: SUSR_LOGIN_CHECK_RFC to check the logon id and password of employees into a custom application

Regards

Kiran Sure