on 03-13-2018 1:14 PM
Hi All,
We have a value from source 0x000000000007D407 as timestamp datatype. which we take as varchar(255) in BODS(Because we checked the option unsupported datatype in datastore level). so value in BODS is 000000000007D407. Here our requirement is to convert the value into interger type.
How to achieve this in BODS.
Immediate response is much appreciated.
Thankyou in Advance 🙂
Hello Kalyani,
I've made a blog with some sample data out of your question.Hexadecimal to Integer
Let me know if it helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rajan,
Thank you soo much for your efforts. It will help me to get the code made easier.
The below custom function i have used...
$LV_VIN = upper($P_VIN) ;
$LV_RESULT = DECODE(length(LTRIM(RTRIM($LV_VIN, ' '),' ')) > 0 , 0 , -1 );
$LEN = length(LTRIM(RTRIM($LV_VIN, ' '),' '));
#PRINT($LEN );
IF ($LV_RESULT =0)
begin
$LV_VINMod = $LV_VIN ;
$LV_Pos =0;
$LV_Value =0;
WHILE ($LV_Pos <= $LEN )
BEGIN
$lv_char = substr($LV_VINMod ,$LEN-$LV_Pos , 1 );
#print('position'||$lv_char);
$LV_Value = $LV_Value + (cast(decode($lv_char = 'A' ,10,
$lv_char = 'B' ,11,
$lv_char = 'C' ,12,
$lv_char = 'D' ,13,
$lv_char = 'E' ,14,
$lv_char = 'F' ,15, $lv_char),'INT') * power(16,cast($LV_Pos,'INT')));
$LV_Pos = $LV_Pos + 1;
END
END
PRINT ($LV_Value);
RETURN $LV_Value ;
You can try the below.
http://www.forumtopics.com/busobj/viewtopic.php?t=101904&highlight=hexadecimal
BR,
Mahesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Write a custom function.
You'll find plenty of examples when you Google "SAP Data Services how to convert hexadecimal to integer". Please always search before posting.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
On general request. And because I couldn't resist the temptation.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.