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

Using string functionality to find a given name in the existing database

Former Member
0 Likes
1,079

Hello ABAPers,

I have a requirement in my task.

1. The input string is something like : " Thoesis  Industries  Labs"

2 The requirement is , if the enduser enters " Theosis  Labs  industries" or any other combination of the inputted words , it has to check in the database and throw an error if it already exists.

I have tried using CS. But it is not working.

Need help.

Regards,

Swapna V

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,054

Hello swapna,

          

you can find all occurrences of statement.

FIND ALL OCCURRENCES OF 'String' in table 'your table' match offset off.

Regards.

Sridhar.A

6 REPLIES 6
Read only

Former Member
0 Likes
1,055

Hello swapna,

          

you can find all occurrences of statement.

FIND ALL OCCURRENCES OF 'String' in table 'your table' match offset off.

Regards.

Sridhar.A

Read only

0 Likes
1,054

Hi Sridhar

Thanku for the reply.

But will the same hold good for a dynamic input I mean any kind of input that user enters

Read only

0 Likes
1,054

Hi Swapna lalitha,

it works for dynamic entry.

Are you checking the entry in database table or internal table.

please post the exact requirement.

Regards.

Sridhar.A

Read only

Former Member
0 Likes
1,054

try using CA (contains any) as below

if p_input ca 'Thoesis, Labs, Industries'.

   MESSAGE 'Already exists' type 'E'.

   else.

     WRITE: /'Sucess'.

     endif.


Regards,

Satish

Read only

0 Likes
1,054

Hi Satish,

Thanku for the reply.

But will the same hold good for a dynamic input I mean any kind of input that user enters

Read only

matt
Active Contributor
0 Likes
1,054

So, you're requirement is that the user enters a sequence of words. You then want to check whether those words are already in some internal table.

Now, given "Theosis  Labs  industries" do you want a match when the user enters  any combination of

Theosis , Labs and industries?


I.e. Should "Labs" give a match or is it only a combination of all three words, like "Labs industries Theosis"?


Is the search case sensitive? Is punctuation to be ignored? What exactly are you checking the user entry against?