Application Development 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: 

ABAP - Hexadecimal not matching for same character

murali_ram
Participant
0 Kudos
741

Hi Experts

Am trying to compare two characters of same length (character 16) in IF condition. But the IF condition fails eventhough both the characters are similar. later i found in the debugging both the characeters are showing different hexadecimal value. How to solve this. Please find the debugging screenshot in the attachment.

Thanks

Mlee.

3 REPLIES 3

thalesvb
Active Contributor
683

> There are at least eight different horizontal dash-like characters of varying lengths defined in Unicode (Wikipedia).

Since is not possible to know, by the shy debugger screenshot, lack of contextual code/explanation how each value was originated, you can either:

  1. Use regex and focus on numbers comparison (assuming they will always have that pattern)
  2. Dumb comparison with all dash-like possibilities
  3. Standardize a unicode character for that representation, and sanitize all old records (if they were persisted).

fedaros
Product and Topic Expert
Product and Topic Expert
0 Kudos
683

Hi murali.ram,

These two hexadecimals 2D and A4 may be visible identical, depending on your encoding, but they are really different as your hexadecimal pointed out. This kind of trick disul

I took your date and typed on hexed.it, and changed second date to AD hex char and look what is visible:

After that saved the file and opened on notepad++ and saw it on encoding ANSI:

and look what appears on UTF-8:

BTW: field XBLNR (reference) sometimes face this things as the users copy and paste from some places that may handle similar what is different. This kind of delusion also happens when someone type hyphen in the winword and they automatic change to a beautiful dash character, see similar but it's a different char.

Regards, Fernando Da Rós

Sandra_Rossi
Active Contributor
0 Kudos
683

Another answer to say the same than 2 other answers, but differently

3200300032003200AD003000

means blocks of 4 digits are 1 character

3200 = Unicode character U+0032

AD00 = Unicode character U+00AD

etc.

2D00 = Unicode character U+002D

Search the Web to see the difference between U+00AD and U+002D (they look the same but are different).