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

String Start With

Former Member
0 Likes
6,451

Dear all,

I'm looking for a way to check the string that have a prefix 'abc'. How can i do this kind of checking in ABAP?? Please advise.

Regards,

Kit

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,372

if it is in IF condition checking (or any other condition checking)

If itab-str cp 'ABC*'.

endif.

but if it is in select query where clause

then

select * from dbtab into corresponding fields of table itab where str like 'ABC%'.

regards

shiba dutta

4 REPLIES 4
Read only

Former Member
0 Likes
2,372

if a+0(3) = 'abc'.

*--a is string

endif.

Read only

Former Member
0 Likes
2,372

say ur variable name is str

then u can check str+0(3) = 'abc'

Read only

Former Member
0 Likes
2,372

Hi,

Take the first three letters of the string and compare the same with abc using string operation CO . this will solve your problem

Regards

Shiva

Read only

Former Member
0 Likes
2,373

if it is in IF condition checking (or any other condition checking)

If itab-str cp 'ABC*'.

endif.

but if it is in select query where clause

then

select * from dbtab into corresponding fields of table itab where str like 'ABC%'.

regards

shiba dutta