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

select statement with begin of a string

Former Member
0 Likes
639

Hello,

i have a variable with type string.

Now I want to select from a table all entries which begins with this string.

How I have to implement the where element in my select statement?

Regards

Philipp

1 ACCEPTED SOLUTION
Read only

peter_ruiz2
Active Contributor
0 Likes
575

SELECT <fields>

FROM <table>

INTO TABLE <internal table>

WHERE <field> LIKE '<string>%'.

ex.

This will select all internal order that starts with '1'.

SELECT aufnr auart

FROM aufk

INTO CORRESPODING FIELDS OF TABLE i_aufk

WHERE aufnr like '1%'.

regards,

Peter

Edited by: Peter Ruiz on Jul 22, 2008 7:55 PM

Hello,

i have a variable with type string.

Now I want to select from a table all entries which begins with this string.

How I have to implement the where element in my select statement?

Regards

Philipp

2 REPLIES 2
Read only

peter_ruiz2
Active Contributor
0 Likes
576

SELECT <fields>

FROM <table>

INTO TABLE <internal table>

WHERE <field> LIKE '<string>%'.

ex.

This will select all internal order that starts with '1'.

SELECT aufnr auart

FROM aufk

INTO CORRESPODING FIELDS OF TABLE i_aufk

WHERE aufnr like '1%'.

regards,

Peter

Edited by: Peter Ruiz on Jul 22, 2008 7:55 PM

Read only

matt
Active Contributor
0 Likes
575

Concatenate % on the end of your string, and then use LIKE string

e.g. string containst "AB", concatenate % on the end gives "AB%".