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

How to check the table data through at user-command?

Former Member
0 Likes
912

Hi Experts,

I hav a selection screen contain user id ,password and pushbuttton.i hav a table zlogin which contains user id and password.when i will click on the button ,it will check the user id and password  in the table zlogin.if its match ,then i can able to see a report which contains some fields of another table.

Moderator message: sounds basic, please work yourself first on your requirement, search for available information and documentation.

Message was edited by: Thomas Zloch

Hi Experts,

I hav a selection screen contain user id ,password and pushbuttton.i hav a table zlogin which contains user id and password.when i will click on the button ,it will check the user id and password  in the table zlogin.if its match ,then i can able to see a report which contains some fields of another table.

Moderator message: sounds basic, please work yourself first on your requirement, search for available information and documentation.

Message was edited by: Thomas Zloch

3 REPLIES 3
Read only

Private_Member_49934
Product and Topic Expert
Product and Topic Expert
0 Likes
725

Check this link

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba81635c111d1829f0000e829fbfe/content.htm

For <ucom>, you must specify a code of up to four characters. When the user clicks the pushbutton on the selection screen, <ucom> is entered in the UCOMM of the SSCRFIELDS interface work area. You must use the TABLES statement to declare the SSCRFIELDS structure. The contents of the SSCRFIELDS-UCOMM field can be processed during the AT SELECTION-SCREEN event.

Read only

Former Member
0 Likes
725

Hi,

say p_val is id and p_val1 is pasword.

AT SELECTION SCREEN OUTPUT.

select id password from ZTABLE(where data exist) into wa(contain pass,id) where id = p_val and

                                                                                                                pass = p_val1.

if sy-subrc ne 0.

message i888(sabapdocu) with 'ERROR in password'.

else.

"write logic

endif.

Thanks

Read only

Former Member
0 Likes
725

Try using the below logic. Let me know if you have any questions.

   REPORT  ZTEST.

tables sscrfields.

selection-screen begin of line.
  parameters: user type <TYPE>.
selection-screen end of line.

selection-screen begin of line.
parameters: pw type <type>.
selection-screen end of line.

selection-screen begin of line.
selection-screen pushbutton 2(10) but user-command BUT.
selection-screen end of line.

at selection-screen.
case sscrfields.
  when 'BUT'.
* Add necessary validations here
    message s000(zzz) with 'button press detected'.
endcase.