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

compare text

Former Member
0 Likes
831

Hi all,,

I want to compare two texts (words) ,, Is this possible.??

Like one is : ARC DOOR DELY

and another is : ASSOCIATED ROAD CARRIERS LTD

both has same vendor code "800007'

this is possible to compare 1st and 2nd text or line...

Please Help me..

1 ACCEPTED SOLUTION
Read only

former_member156446
Active Contributor
0 Likes
797

Hi, character types can be compared.... but I am not sure why you want to compare texts....

lv_1 = 'ARC DOOR DELY'.

lv_2 = 'ASSOCIATED ROAD CARRIERS LTD '.

if lv_1 eq lv_2 .

false.

else.

true.

endif.

5 REPLIES 5
Read only

Former Member
0 Likes
797

Try to use:

CS--->Contains string

Ex:

If string1 CS String1.

Logic

Endif.

List of comparison operator are in the link below.

[Compare words|http://help.sap.com/saphelp_nw04/Helpdata/EN/fc/eb3516358411d1829f0000e829fbfe/content.htm]

Hope this resolves your query

Regards,

Gurpreet

Read only

former_member156446
Active Contributor
0 Likes
798

Hi, character types can be compared.... but I am not sure why you want to compare texts....

lv_1 = 'ARC DOOR DELY'.

lv_2 = 'ASSOCIATED ROAD CARRIERS LTD '.

if lv_1 eq lv_2 .

false.

else.

true.

endif.

Read only

0 Likes
797

hI JAY...

Lv_1 = 'ARC DOOR DELY'.

lv_2 = 'ASSOCIATED ROAD CARRIERS LTD '.

in this two lines i want to comapre

first character of first line with first character of second line of first word..

then 2nd character of first line with first character of second line of 2nd word...

and so on...

Hows this possible...

please help me....

Read only

0 Likes
797

Hi:

Use offset like

Lv_1 = 'ARC DOOR DELY'.

lv_2 = 'ASSOCIATED ROAD CARRIERS LTD '.

this is bit by bit comparision

if lv_10(1) = lv_20(1)

if lv_11(1) = lv_21(1)

if lv_12(1) = lv_22(1)

so on...

For 1st and 2nd position

if lv_10(1) = lv_21(1)

etc

Regards

Shashi

Read only

awin_prabhu
Active Contributor
0 Likes
797

Hi friend,

Also try CP (Contains Pattern).

Ex:

a1 = 'ARC DOOR DELY'.

a2 = 'ASSOCIATED ROAD CARRIERS LTD'.

IF a1 CP a2.

......

ELSE.

......

ENDIF.

Thanks..

Edited by: Sap Fan on Mar 12, 2009 4:48 AM