2012 Oct 12 6:13 PM
Hi,
I want to check if text string contains some specific hexadecimal code.
The built-in ABAP FIND() function allows to use only plain text type (C, N etc.) variables as search parameter, but I want to use hex type variable (type X).
Is there any string search function that can receive as search parameter the variable of type X (hex type)?
Thanks.
2012 Oct 12 7:13 PM
You should be able to use the 'IN BYTE MODE' addition. For example:
FIND hex2 IN hex1 IN BYTE MODE.
This is in the documentation for the FIND keyword, as well as a number of ther string manipulation keywords. Use F1 help for details.
2012 Oct 12 7:13 PM
You should be able to use the 'IN BYTE MODE' addition. For example:
FIND hex2 IN hex1 IN BYTE MODE.
This is in the documentation for the FIND keyword, as well as a number of ther string manipulation keywords. Use F1 help for details.
2012 Oct 12 7:38 PM
Do I understand right, that «hex2» may be type of string and if I use keyword «IN BYTE MODE», then FIND() will still search by hex code value and not by plain text?
And one more general question, what service do you use to paste a code here in forum? http://pastebin.com or something else?
2012 Oct 15 4:33 PM
If you use IN BYTE MODE, both fields must be byte-type (as opposed to charactor-type) fields. This means that both hex1 and hex2 must be type x or type xstring. I don't know of a way to find a byte stored as hex in a character string. But I imagine it shouldn't be too hard to convert the character string to a hex string. This sounds like the kind of topic that would have many of posts on these forums.
(to format your code as code: go to the advanced editor. Paste your code and select it. Click the '>>' Insert button. Select Syntax Highlighting->Plain).
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |