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

Need help regarding user checks.

Former Member
0 Likes
1,071

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".
endif

Plus 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".
endif

Plus this coding has to go under the form section.

please guide me,

6 REPLIES 6
Read only

Former Member
0 Likes
987

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

Read only

0 Likes
987

can you illustrate me with an example..

with a short code.

thank you

Read only

0 Likes
987

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

Read only

Former Member
0 Likes
987

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.

Read only

0 Likes
987

Help Please

Read only

0 Likes
987

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.