Field type password ABAP
Field type password ABAP: If you need an example to create parameter type password abap you need only declare a parameter type CHAR and after its neccesary made a LOOP to screen-name to verify the name of parameter, this is because its neccesary modify only the paraeter thats you need change propertie visible to hide values writen by the user.
Field type password ABAP
This it’s very count used when you need to protect a program if only some users can execute this program and if you don’t want to use Autority-Checks, normally when an ABAP Developer use this techniques its when for example the program update any table, to ensure any unauthorized user execute this program abap developer protects the program with password or key.
ABAP forms that include this kind of type password are usually used to protect a transaction with password to limit acces for some users that have this secret password, for an ABAP consultant its very easy to skip this security level with debugger, but
a normal person does not have this knowledge.
Please see code below
PARAMETERS : P_PASS(6). AT SELECTION-SCREEN OUTPUT. LOOP AT SCREEN. IF SCREEN-NAME = 'P_PASS'. SCREEN-INVISIBLE = '1'. MODIFY SCREEN. ENDIF. ENDLOOP. START-OF-SELECTION. IF p_pass NE 'DONITO'. MESSAGE 'Password incorrecta' TYPE 'E'. ENDIF.
After do this you will get a field screen type password in abap, please see image below
Now you only need compare values and show error message if password its not correct
IF p_pass NE 'DONITO'. MESSAGE 'Password incorrect' TYPE 'E'. ENDIF.
Here you have a source code more elaborate
PARAMETERS : p_user(15), p_pass(6), l_user TYPE z_users. AT SELECTION-SCREEN OUTPUT. LOOP AT SCREEN. IF screen-name = 'P_PASS'. screen-invisible = '1'. MODIFY SCREEN. ENDIF. ENDLOOP. START-OF-SELECTION. SELECT SINGLE * FROM z_users WHERE user = p_user AND password = p_password INTO l_user. IF sy-subrc = 0. IF p_pass = l_user-password AND luser-user = p_user. WRITE: 'Welconme to SAP system'. ELSE. WRITE: 'Your password its incorrect please verify'. ENDIF. ELSE. WRITE: 'Your input data its not correct please verify'. ENDIF.
-
Pingback: How to send email with excel file attachment from itab in ABAP - Abap example