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: 

how to search a string from the database?

Former Member
0 Kudos

how to search a string from the database? starting with some character

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Are you talking about searching in SAP tables? If so, go to SE16. Give the value for the field (Starting with TEXT means you can give TEXT) and execute. This will give you the list of entries which has TEXT*** as value for that field.

If you want to write a program to search for a value use keyword 'CP' (Conatains pattern)

If w_text CP 'TEXT'.

Thanks and Regards,

Lakshmi.

5 REPLIES 5

Former Member
0 Kudos

Hi,

In Database table , if you want to search some field or any string then go to ctrl+F option and then type what field you want to search.

****Do reward if usefull

Vijay

Former Member
0 Kudos

Hi Gurminder singh,

string?? can u explain it clearly.

raam

Former Member

Former Member
0 Kudos

Hi,

Are you talking about searching in SAP tables? If so, go to SE16. Give the value for the field (Starting with TEXT means you can give TEXT) and execute. This will give you the list of entries which has TEXT*** as value for that field.

If you want to write a program to search for a value use keyword 'CP' (Conatains pattern)

If w_text CP 'TEXT'.

Thanks and Regards,

Lakshmi.

Former Member
0 Kudos

If you're trying to do this in a SELECT, you can use the LIKE verb in your WHERE clause.

Here's an Example


  SELECT obj_name FROM tadir
    INTO prog
    WHERE pgmid = 'R3TR'
      AND object = 'PROG'
      AND obj_name LIKE 'Z%'.

In this case it will select every row that obj_name starts with Z.

If you wanted to find every row that the field obj_name contains say... 'WIN' you use LIKE '%WIN%'.

Edited by: Paul Chapman on Apr 22, 2008 12:32 PM