2009 Jun 24 10:28 AM
Dear gurus
I have made an appraisal program. in this program checks has been made on sy-uname and kostl.
The problem im facing is that we have a user id with multiple logins
meaning
TECHTPF2 is a user id and it is being used in
1) Technical Department
2) Power House.
3) Utility and Maintenance.
I want to make an another check
if sy-uname eq 'TECHTPF2'.
"Here i want to prompt a window asking for a user name and password. This user id and password is defined by me".
endifPlus this coding has to go under the form section.
please guide me,
Dear gurus
I have made an appraisal program. in this program checks has been made on sy-uname and kostl.
The problem im facing is that we have a user id with multiple logins
meaning
TECHTPF2 is a user id and it is being used in
1) Technical Department
2) Power House.
3) Utility and Maintenance.
I want to make an another check
if sy-uname eq 'TECHTPF2'.
"Here i want to prompt a window asking for a user name and password. This user id and password is defined by me".
endifPlus this coding has to go under the form section.
please guide me,
2009 Jun 24 10:49 AM
Hi,
Use FM POPUP_GET_USER_PASSWORD , it will pop up a screen asking username and password and it will be returned to you, validate that if that does not match leave program.
This will solve your problem.
Regards
Karthik D
2009 Jun 24 11:39 AM
can you illustrate me with an example..
with a short code.
thank you
2009 Jun 24 12:07 PM
Hi,
Try like this;
Data : uname TYPE string, pass type string.
Data : Registry TYPE UDDICLS_REGISTRIES.
IF sy-uname EQ 'SAPUSER'. "Replace with your required user name
CALL FUNCTION 'POPUP_GET_USER_PASSWORD'
IMPORTING
USER = uname
PASSWORD = pass
TABLES
REGISTRY_TAB = Registry
EXCEPTIONS
CANCEL_PRESSED = 1
OTHERS = 2 .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*Do select in case you stored your usernames and passwords in ztable
*or just use a if condition as below
IF uname EQ 'Myuser' AND pass EQ 'welcome'.
*Do relevant tasks
Else.
* If neccessary show message that username/password is wrong
LEAVE PROGRAM.
ENDIF.
ENDIF.Regards
Karthik D
2009 Jun 26 6:29 AM
Dear Gurus.
As below code shows that im taking two parameters
1) User Name.
2) User Password
I want to change the text Field of Password into ***** form.
can you guide me how ?
within the below code.
Regards
Saad Nisar.
selection-screen begin of screen 500 title title as window.
parameters : p_name like sy-uname obligatory,
p_pass like sy-uname obligatory.
selection-screen end of screen 500.
title = 'Appraisal Program Login Screen'.
if user-bname eq 'TECHTPF2'or
user-bname eq 'FPLTPF2' or
user-bname eq 'TECHTPF1'or
user-bname eq 'ABAPER' or
user-bname eq 'ABAPDEV'.
call screen '500' starting at 10 10.
perform call_screen.
else.
*****************************************************************
* CALLING SCREEN.
*****************************************************************
call screen 0100.
endif.
2009 Jun 26 10:48 AM
2009 Jun 26 11:40 AM
So you defined your own dynpro: check the field attributes for your password field. There you can set it to display only '*'.
No rocket science.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |