05-31-2006 8:01 AM
Hi all,
I want to write a code for selection screen for username and password but the code should not be hard coded.
It will accept values from a Ztable and check whether that password exists there or not.
If the password dont exist it will throw error The password should match the corresponding user id.
Pls experts help me out which FM to be used and how to proceed with the code.
With regards,
Abir.
05-31-2006 8:12 AM
Check this code,...
REPORT z_pass_word MESSAGE-ID zz .
data: wa like ztable.
PARAMETERS: p_user TYPE sy-uname,
p_passwd(10).
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name = 'P_PASSWD'.
screen-invisible = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
at selection-screen.
SELECT SINGLE * FROM ztable INTO wa WHERE username = p_user
AND password = p_passwd.
IF sy-subrc <> 0.
MESSAGE e000 WITH 'Please enter valid user id and password'.
ENDIF.
Regards
vijay
05-31-2006 9:59 AM
11-17-2006 12:50 PM
05-31-2006 8:13 AM
Hai
Password should be in some other format
I think it is in ascii format or Hexadescimal format
before comparing you will translate into the existing format
Thanks & regards
Sreenivasulu P
05-31-2006 8:18 AM
Hi,
Try with these FM's :
SNC_LOGIN_EXTERNAL_ID
SUSR_USER_EXTID_LOOKUP
If its useful, award points pls..
Regards,
Bharadwaj
05-31-2006 8:21 AM
HI
GOOD
AS PER YOUR REQUIREMENT
YOU WANT TO ACCEPT THE VALUE FROM A ZABLE AND YOU DONT WANT TO CREATE A SELECTION SCREEN FOR THIS.
IF THERE WONT BE ANY SELECTION SCREEN THAN HOW COULD YOU DIRECTLY SELECT THE VALUE FROM THE ZTABLE.
CAN YOU GIVE SOME MORE DETAIL ABOUT YOUR REQUIREMENT.
THANKS
MRUTYUN
05-31-2006 8:23 AM
hi please copy and run the code below, it will display '*' for the password field.. award points if found helpful
*&---------------------------------------------------------------------*
*& Report ZKSP_PASSWORD *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*
report zksp_password .
parameters: p_pass type xuncode.
*---------------------------------------------------------------------*
at selection-screen output.
loop at screen.
if screen-name = 'P_PASS'.
screen-invisible = '1'.
modify screen.
endif.
endloop.
*---------------------------------------------------------------------*
start-of-selection.
write: / p_pass.
.
For getting the password value from data base table the follow the event AT SELECTION given by vijay