‎2007 Aug 28 6:32 PM
Hello Experts,
Is there any function module in ABAP to compare the two strings. Let us assume there are 2 string variables STR1 & STR2. If both variables doesn't have the same value then I need an exception.
Thanks in advance.
‎2007 Aug 28 6:35 PM
Hi Mohan,
Is there any specific reason for the use of function module for this small logic?
You can simply compare
IF str1 = str2.
....
ELSE.
RAISE exception.
ENDIF.
Thanks and Best Regards,
Vikas Bittera.
<b><REMOVED BY MODERATOR></b>
Message was edited by:
Alvaro Tejada Galindo
‎2007 Aug 28 6:36 PM
data : str1(20) type c,
str2(20) type c.
str1 = 'Hello'.
str2 = 'Hello1'.
if str1 = str2.
write : 'same'.
endif.
‎2007 Aug 28 6:37 PM
‎2007 Aug 28 6:41 PM
Hi Mohan,
Also, dont forget to translate to upper case, if you want case insensitive camparison.
TRANSLATE str1 TO UPPERCASE.
Thanks and Best Regards,
Vikas Bittera.
<b><REMOVED BY MODERATOR></b>
Message was edited by:
Alvaro Tejada Galindo
‎2007 Aug 29 2:25 AM
Hello,
Thanks for the responses. Yes, the reason for looking the Function Module is, in PPPI Message Recipe we can't compare strings with IF condition. That's why I am trying to find out the standard function module instead of writing custom function module.