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: 

Extract data where it begins wiht certain leters

Former Member
0 Kudos

Hello,

I have for all entries for 5 tables but I need to extract all the data where it begins with certain leters like "ab". how can I define that in my select. Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You can use wild card characters like '%' in Where class,


... WHERE CITY LIKE '%town%'.

This condition is true if the column CITY contains a string containing the pattern u2018townu2019.

... WHERE NAME NOT LIKE '_n%'.

This condition is true if the column NAME contains a value whose second character is not u2018nu2019.

3 REPLIES 3

Former Member
0 Kudos

You can use wild card characters like '%' in Where class,


... WHERE CITY LIKE '%town%'.

This condition is true if the column CITY contains a string containing the pattern u2018townu2019.

... WHERE NAME NOT LIKE '_n%'.

This condition is true if the column NAME contains a value whose second character is not u2018nu2019.

Former Member
0 Kudos

Hi,

FIELD LIKE 'ab%'.

If you want get all the entries in the second char is b then try this
 
FIELD LIKE '_b%'.

For more help refer to this link..how to use LIKE operator

http://help.sap.com/saphelp_nw04/helpdata/EN/fc/eb3a1f358411d1829f0000e829fbfe/content.htm

Former Member
0 Kudos

hi,

Try this way

Select kunnr bukrs into table t_knb1

from knb1

for all entries in t_kna1

where kunnr = t_kna1-kunnr and

ernam ca 'ab'.

Depending on your need you can use the following.

CO (Contains Only)

CN (Contains Not only)

CA (Contains Any)

NA (contains Not Any)

CS (Contains String)

NS (contains No String)

CP (Contains Pattern)

NP (contains No Pattern)