Skip to Content
Jul 02, 2015 at 10:45 AM

display characters that are not equal in two strings.



I am having a requirement. I am having str1 and str2. I need to display the characters that are not common in both the strings.

data: lv_key type string value 'ABCDEFGHIJKLMNOPQRSTUVWXYZ*#^',

lv_str type string value '&TES%T'.

lv_key has the set of values that are allowed. lv_str has the input string.

Now i need the display like "Invalid chars are &%" in my write statement. Guys i know we can check character by character. But that will be a huge performance impact.

Secondly if we use CN we will get the SY-FDPOS with the first invalid char only. in case ours has two and in real time it can have many.

Any better ideas ??