Application Development 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: 

module pool logon pwd as asterik

0 Kudos

hi

I'm creating a logon screen ( module pool ) where password entered by user to be displayed as asterik

kindly help me .. how do we do it ?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

parameters: P_pass(10).

at selection-screen output.

loop at screen.

if screen-name = 'P_PASS'.

screen-invisible = '1'.

modify screen.

endif.

endloop.

Refer to these related threads

thanks.

5 REPLIES 5

Former Member
0 Kudos

Hi,

parameters: P_pass(10).

at selection-screen output.

loop at screen.

if screen-name = 'P_PASS'.

screen-invisible = '1'.

modify screen.

endif.

endloop.

Refer to these related threads

thanks.

varma_narayana
Active Contributor
0 Kudos

Hi..

There are 2 ways .

<b>1. In the Screen painter :</b>

Double click on the field to change its attributes.

Select the Checkbox *Entry ..

<b>2. Dynamic changes to field:</b>

In the PBO module you can place this code .

loop at screen.

if screen-name = 'P_PASS'. "The name of the Screen field

screen-invisible = '1'. "Password entry with Asteriks

modify screen.

endif.

endloop.

reward if Helpful.

Former Member
0 Kudos

Hi

Have the invisible check box on for that field in the field attributes for screen painter..

PARAMETERS: P_PASS(10) MODIF ID M1.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'M1'.

SCREEN-INVISIBLE = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Plz Reward Points if helpful

Former Member
0 Kudos

Hi Avi,

PROGRAM ZHIDE NO STANDARD PAGE HEADING.

************************************************************************

  • This program hides any ABAP's source code and protects it with a

  • password. One can still run the abap (the load version is intact)

  • but it can not be displayed, edited, traced, transported or generated.

  • If the ABAP is not hidden, the program hides it, if it is hidden, it

  • unhides it.

  • The password is hard-coded in a source code, so the first candidate

  • to be hided sholuld be ZHIDE itself.

************************************************************************

SELECTION-SCREEN BEGIN OF BLOCK BLOCK.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(8) PWD.

SELECTION-SCREEN POSITION 35.

PARAMETERS: PASSWORD(8) MODIF ID AAA.

SELECTION-SCREEN END OF LINE.

PARAMETERS: PROGRAM(8).

SELECTION-SCREEN END OF BLOCK BLOCK.

*

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'AAA'.

SCREEN-INVISIBLE = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

*

INITIALIZATION.

PWD = 'PASSWORD'.

*

START-OF-SELECTION.

TABLES: TRDIR.

  • User name and passsword check

IF SY-UNAME <> 'IMRE' OR PASSWORD <> 'TITOK'.

WRITE: / 'Wrong password'.

EXIT.

ENDIF.

  • SAP owned?

IF NOT PROGRAM CP 'Z' AND NOT PROGRAM CP 'Y'.

WRITE: / 'Do not hide original SAP programs!'.

EXIT.

ENDIF.

  • Exists?

SELECT SINGLE * FROM TRDIR WHERE NAME = PROGRAM.

IF SY-SUBRC <> 0.

WRITE: / 'Program does not exists!'.

EXIT.

ENDIF.

  • Does it have a current generated version?

DATA: F1 TYPE D, F3 TYPE D.

DATA: F2 TYPE T, F4 TYPE T.

EXEC SQL.

SELECT UDAT, UTIME, SDAT, STIME INTO :F1, :F2, :F3, :F4 FROM D010LINF

WHERE PROG = :PROGRAM

ENDEXEC.

IF F1 < F3 OR ( F1 = F3 AND F2 < F4 ).

WRITE: / 'The program has no recent generated version!'.

EXIT.

ENDIF.

  • Compose a new program name

DATA: NEW_NAME(8), I TYPE I, J TYPE I.

NEW_NAME = PROGRAM.

DO 8 TIMES.

I = SY-INDEX - 1.

NEW_NAME+I(1) = '_'.

  • Search for acceptable program name variations

J = 0.

SELECT * FROM TRDIR WHERE NAME LIKE NEW_NAME.

J = J + 1.

ENDSELECT.

IF J = 1.

EXIT.

ENDIF.

NEW_NAME = PROGRAM.

ENDDO.

  • Can not generate appropriate program name

IF J > 1.

WRITE: / 'Can not generate appropriate program name'.

EXIT.

ENDIF.

  • Check if it is already in d010s (already hidden)

DATA: F5(8).

EXEC SQL.

SELECT PROG INTO :F5 FROM D010S WHERE PROG = :NEW_NAME

ENDEXEC.

IF F5 IS INITIAL.

  • There is no such hidden program, hide it

EXEC SQL.

UPDATE D010S SET PROG = :NEW_NAME WHERE PROG = :PROGRAM

ENDEXEC.

ELSE.

  • There is already a hidden program there, unhide it

EXEC SQL.

UPDATE D010S SET PROG = :PROGRAM WHERE PROG = :NEW_NAME

ENDEXEC.

ENDIF.

Reward if helpful.

Regards,

Harini.S

Former Member
0 Kudos

hi Avi,

You can change the display property of the password field as inivisble.Go to attributes of the field. Now in display check the invisible tab.

Now the field would have * as u get in the normal password field.