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

reports

Former Member
0 Likes
506

suppose I have 100 entries of student information in my database , so I want to write a select query such that if I press    A*   then all the entries of student's name starting with char A...... should display, can anyone suggest the select query.

3 REPLIES 3
Read only

Former Member
0 Likes
435

Hi, you can use LIKE statement in your select

for example:

SELECT * FORM ABC WHERE USER_ID like "A%"

Read only

Former Member
0 Likes
435

This is a very basic concept...you would supply a parameter or select-options statement for the name (last name ?).  the user would input A* and execute..  Your Open SQL would do a select where last name eq (for parameters) or IN (for select options), into an internal table.  You would then loop over that table and write the content or use SALV (see demo programs named like SALV*) to display what you had retrieved.

However, note that these forums are not intended to be basic ABAP training classes.  There are many good materials on how to wite ABAP code, available from a variety of sources, including SAP Press.

Read only

former_member491621
Contributor
0 Likes
435

Hi Kaladhar,

You can use the below code

SELECT data

from DBTAB

into ITAB

WHERE <field> LIKE var.


where var = 'A*' or 'A%'