2013 Jan 14 1:26 PM
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.
2013 Jan 14 1:31 PM
Hi, you can use LIKE statement in your select
for example:
SELECT * FORM ABC WHERE USER_ID like "A%"
2013 Jan 14 1:32 PM
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.
2013 Jan 14 1:39 PM
Hi Kaladhar,
You can use the below code
SELECT data
from DBTAB
into ITAB
WHERE <field> LIKE var.
where var = 'A*' or 'A%'