2011 Aug 12 4:53 PM
Hi All,
I have a situation where my source is 32 char length and destination InfoObject is only 20 char length. I want to derive a 20 char or less key from 32 char and store it in my InfoObject. The key should be unique to a char sequence.
I should also be able to derive the 32 char from 20 char key generated. Does ABAP have any standard functions which would derive a hash value which is unique and from which you can again derive the original value.
Please help.
Devang.
2011 Aug 13 3:20 PM
Hi Deva,
if you can create the uinique key yourself, you can use FM GUID_CREATE: You will get a unique identifier in 16 bytes raw hex format, 22 character upper/lower case ASCII char format and in 32 character uppercase ASCII format..
They are mutually convertible by FM GUID_CONVERT.
So you can use GUID_CREATE to get the 32 char source key - you can convert it to a 16 byte hex value for your object.
I don't know if this works as you did not say what it is all about.
Regards
Clemens
Hi Deva,
if you can create the uinique key yourself, you can use FM GUID_CREATE: You will get a unique identifier in 16 bytes raw hex format, 22 character upper/lower case ASCII char format and in 32 character uppercase ASCII format..
They are mutually convertible by FM GUID_CONVERT.
So you can use GUID_CREATE to get the 32 char source key - you can convert it to a 16 byte hex value for your object.
I don't know if this works as you did not say what it is all about.
Regards
Clemens
2011 Aug 12 6:00 PM
Unless there's a lot of redundancy in the source, I can't think that it's even mathematically possible. There are more combinations possible with 32 characters than with 20.
matt
2011 Aug 12 7:16 PM
HI Matt,
I am sure that we dont have so much data that it will pass combination of 20char. So I think we should be good mathematically.
Thanks,
Devang.
2011 Aug 12 8:29 PM
Hi,
I don't think what you're looking for is feasible, so you should better use the usual workaround : define a database table to store the values, with a primary key field made of 20 numeric digits, and data is 32 characters, and a unique index on the 32C field. Each new 32C value is assigned the next 20N number (like with a number range), and if it is an existing 32C value, then it returns the corresponding 20N key.
Sandra
2011 Aug 13 3:20 PM
Hi Deva,
if you can create the uinique key yourself, you can use FM GUID_CREATE: You will get a unique identifier in 16 bytes raw hex format, 22 character upper/lower case ASCII char format and in 32 character uppercase ASCII format..
They are mutually convertible by FM GUID_CONVERT.
So you can use GUID_CREATE to get the 32 char source key - you can convert it to a 16 byte hex value for your object.
I don't know if this works as you did not say what it is all about.
Regards
Clemens
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |