How to Convert a HEX value to CHAR value...Unicode Issue...
Hi,
How can I convert HEX value to CHAR value.
The Code in <b>non Unicode</b> system is:
DATA: t_text LIKE tline OCCURS 0 WITH HEADER LINE.
constants: c_hex_20a5(2) TYPE x VALUE '20A5'.
t_text-tdline = 'seller of the item so listed. A legend of the Seller Code(s) is as'.
TRANSLATE t_text-tdline USING c_hex_20a5.
The same code give error in <b>Uni-Code</b> system:
<b>error is "c_hex_20a5 must be an character type object (C, N, D, T or String type)."</b>
If anyone know, what is the solution, please let me know.
Thanks!
Puneet.
Hi,
Try declaring the Hex chars using the ABAP char utilities. This is just a sample piece of code on how to declare and use:
CLASS cl_abap_char_utilities DEFINITION LOAD.
DATA: ws_lf TYPE c VALUE cl_abap_char_utilities=>cr_lf.
data: c_newline TYPE x VALUE '0D'. [ it is zero D, for carriage return ]
ws_lf = c_newline.
CONCATENATE it_tab-maktx
ws_lf
ws_template
INTO it_notificatn-template.
Hope this helps...
Regards
Subramanian
Similar Messages
-
How to Convert From HEX to Java Unicode
String hexString = "81698a94816a93fa97a790bb8dec8f8a814083478393835e815b83768389834383598354815b836f8e968bc69594814083568358836583808c9f8fd8835a8393835e";
I have an hex string as shown above. Could please some one tell me how to convert to java unicode.Divide it into four-character pieces and for each piece to this:char c = (char)Integer.parseInt(thePiece, 16);That converts the four-character piece (e.g. "8a94") to the corresponding Unicode character (\u8a94). String those chars together into a char array or a String or whatever you need.
-
How to replace regex match into a char value (in the middle of a string)
Hi uncle_alice and other great regex gurus
One of my friends has a peculiar problem and I cant give him a solution.
Using String#replaceAll(), i.e. NOT a Matcher loop, how could we convert matched digit string such as "65" into a char of its numeric value. That is, "65" should be converted into letter 'A'.
Here's the failing code:
public class GetChar{
public static void main(String[] args){
String orig = "this is an LF<#10#> and this is an 'A'<#65#>";
String regx = "(<#)(\\d+)#>";
//expected result : "this is an LF\n and this is an 'A'A"
String result = orig.replaceAll(regx, "\\u00$2");
// String result = orig.replaceAll(regx, "\\\\u00$2"); //this also doesn't work
System.out.println(result);I don't know that we have lost anything substantial.i think its just that the kind of task this is
especially useful for is kind of a blind-spot in the
range of things java is a good-fit for (?)
for certain tasks (eg process output munging) an
experienced perl programmer could knock up (in perl)
using built-in language features a couple of lines
which in java could takes pages to do. If the cost is
readability/maintainability/expandability etc.. then
this might be a problem, but for a number of
day-to-day tasks it isn't
i'm trying to learn perl at the moment for this exact
reason :)Yes. And when a Java source-code processor(a.k.a. compiler) sees the code like:
line = line.replaceAll(regexp, new String(new char[] {(char)(Integer.parseInt("$1"))}));or,
line = line.replaceAll(regexp, doMyProcessOn("$1")); //doMyProcess returns a Stringa common sense should have told him that "$1" isn't a literal string "$1" in this regular expression context.
By the way, I abhor Perl code becaus of its incomprehensibleness. They can't be read by an average common sense. Java code can be, sort of ... -
How to Count the number of TAB chars value '0A' in a line?
I have a requirement to count the number of TABs in a text file that I am processing (they must equal 75) to ensure that all the fields have been submitted on the file I am reading?
How do I identify the TABs in a line?
I have this so far:
CONCATENATE gv_unix_file gv_lstfiles-name INTO gv_unix_file.
OPEN DATASET gv_unix_file for INPUT IN TEXT MODE ENCODING NON-UNICODE.
IF sy-subrc <> 0 .
message e000(zz) with 'Cannot access in_uk files'.
ENDIF.
CONCATENATE gv_unix_file_arc gv_lstfiles-name INTO gv_unix_file_arc.
OPEN DATASET gv_unix_file_arc FOR OUTPUT IN TEXT MODE ENCODING NON-UNICODE.
IF sy-subrc <> 0 .
message e000(zz) with 'Cannot access in_uk files'.
ENDIF.
DO.
READ DATASET gv_unix_file into lv_str.
IF sy-subrc <> 0.
exit. "exit do loop, file is done.
else.
TRANSFER lv_str to gv_unix_file_arc.
ENDIF.
ENDDO.Here is a sample code:
DATA: lv_string TYPE string,
lv_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
lv_i TYPE i.
DATA: result_tab TYPE match_result_tab.
DO 3 TIMES.
CONCATENATE 'A' lv_string INTO lv_string SEPARATED BY lv_tab.
ENDDO.
" this is how you need to find how many tabs are in your transfer work area...
FIND ALL OCCURRENCES OF lv_tab IN lv_string RESULTS result_tab.
DESCRIBE TABLE result_tab LINES lv_i.
WRITE:'No. of tabs found:', lv_i. -
How to convert from scientific notations to double value ?
Hi all,
i need to convert a string 2E-23 to corresponding double values so that i can compare it one more existing double value. Is there any API present for this ?
Thanks and regards,
rosamama.Note: This thread was originally posted in the Swing forum, but moved to this forum for closer topic alignment.
-
How to convert a string to a currency value ? getting a dump with exception
Hi,
I am getting a exception not caught in CX_SY_CONVERSION_NO_NUMBER.
I am trying to convert a string value with ',' to a currency value.
I tried using Replace and Condense. But the error still persists.
Is there a FM or a casting that I can use?
Cheers
KiranHi,
Sorry I got my question wrong. I have a problem - that when I'm trying to pass a value from a string to a currency field.
But, the currency field is a field symbol.
so, I have
data abc type string.
abc = "5345"
<curr_val> = abc.
now <curr_val> = 0.000
Please suggest. -
How to convert an internal table of char type to Raw (1022 char) format int
Hi All,
I am facing the problem while converting the character type internal table to Raw (1022 char) format internal table.
Example :
Source :
Internal table - Itab_send of type char132.
Target : ( Required )
Internal table - itab_receive of type SDOK_SDATX .
Note : SDOK_SDATX = Raw ( 1022 char )
Thank you,
PurshothPossible Solution : Move it to source character field to string and string to raw field.
try to find FM , go in se37 and *RAW *
RSAB_CONVERT_RAW_TO_CHAR convert raw to char.
Edited by: Harsh Bhalla on Dec 15, 2009 10:31 PM -
How to avoid client opening for maintainig char value for POreleasestrategy
Hello Experts
I have configured Purchase Order release strategy in our development client. I have released all transport requests for PO release in our quality client. But after releasing transport requests , value in characteristics like PO value was not copied in quality client.
To achieve my purpose I have opened by our client by scc4 transaction code & once again maintained values in characteristics.
*Is there any method to update characteristics values in release strategy without opening client?*
Regards
AmitUsing CL20n, the complete assignment of characteristic values per release stratrgies can be defined. There will be no need to open the client at all.
-
How to convert result rows into comma separated values
hi,
Version
BANNER
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
PL/SQL Release 11.1.0.7.0 - Production
CORE 11.1.0.7.0 Production
TNS for Linux: Version 11.1.0.7.0 - Production
NLSRTL Version 11.1.0.7.0 - ProductionQuery
Select distinct prcdr_code from procedure p where P.PRCDR_CTGRY_LKPCD='P' ;
Output
PRCDR_CODE
0001F
0001T
0002F
0002T
0003F
0003T
0004F
0005F
0005T
0006F
0006T
0007F
0007T
0008F
0008T
0009F
0009T
000VA
000VG
Desired Output
0001F,0001T,0002F,0002T .................
My work
i tried this .....
Select distinct wm_concat(prcdr_code) as re from procedure p where P.PRCDR_CTGRY_LKPCD='P' ;
But i got ORA-22813: operand value exceeds system limits error
Please help me ..Thanks,
P Prakash
Edited by: prakash on Jan 4, 2012 9:05 AMAggregating CLOB's....
user defined aggregate function can do it...
create or replace type clobagg_type as object
text clob,
static function ODCIAggregateInitialize(sctx in out clobagg_type) return number,
member function ODCIAggregateIterate(self in out clobagg_type, value in clob) return number,
member function ODCIAggregateTerminate(self in clobagg_type, returnvalue out clob, flags in number) return number,
member function ODCIAggregateMerge(self in out clobagg_type, ctx2 in clobagg_type) return number
create or replace type body clobagg_type is
static function ODCIAggregateInitialize(sctx in out clobagg_type) return number is
begin
sctx := clobagg_type(null) ;
return ODCIConst.Success ;
end;
member function ODCIAggregateIterate(self in out clobagg_type, value in clob) return number is
begin
self.text := self.text || value ;
return ODCIConst.Success;
end;
member function ODCIAggregateTerminate(self in clobagg_type, returnvalue out clob, flags in number) return number is
begin
returnValue := self.text;
return ODCIConst.Success;
end;
member function ODCIAggregateMerge(self in out clobagg_type, ctx2 in clobagg_type) return number is
begin
self.text := self.text || ctx2.text;
return ODCIConst.Success;
end;
end;
create or replace function clobagg(input clob) return clob
deterministic
parallel_enable
aggregate using clobagg_type;
SQL> select trim(',' from clobagg(ename||',')) as enames from emp;
ENAMES
SMITH,ALLEN,WARD,JONES,MARTIN,BLAKE,CLARK,SCOTT,KING,TURNER,ADAMS,JAMES,FORD,MILLER
SQL> ed
Wrote file afiedt.buf
1 with t as
2 (select 'PFL' c1, 0 c2,110 c3 from dual union all
3 select 'LHL', 0 ,111 from dual union all
4 select 'PHL', 1, 111 from dual union all
5 select 'CHL', 2, 111 from dual union all
6 select 'DHL', 0, 112 from dual union all
7 select 'VHL', 1, 112 from dual union all
8 select 'CPHL', 0, 114 from dual union all
9 select 'WDCL', 1, 114 from dual union all
10 select 'AHL' ,2 ,114 from dual union all
11 select 'NFDL', 3, 114 from dual)
12 --
13 -- end of test data
14 --
15 select trim(clobagg(c1||' ')) as c1, c3
16 from (select * from t order by c3, c2)
17 group by c3
18* order by c3
SQL> /
C1 C3
PFL 110
LHL CHL PHL 111
DHL VHL 112
CPHL AHL NFDL WDCL 114 -
Compare Integer value to Char value
Hi Experts,
I have one query. I have one amount field. I wanted to validate that this field should not contain any text i.e. SY-ABCDE.
Example:
data: lv_var TYPE I.
LV_VAR = '100.00'.
IF LV_VAR NE SY-ABCDE.
"SOME MESSAGE
ENDIF.
While debugging I found that still control is going to inside above mentioned if condition.
Can anybody will suggest me how to write condition for it.
Thanks,
Neha>
neha gupta wrote:
> LV_VAR = '100.00'. => THis doesnt have a alphabetic value right??
> IF LV_VAR NE SY-ABCDE. ======> NE means not equal to.. and of course 100.00 is NE 'ABCD...XYZ"
> "SOME MESSAGE ==============> so it does in.
> ENDIF.
> While debugging I found that still control is going to inside above mentioned if condition.
> Neha
neha,
hope you understnad now
so for checking...
first do this...
translate lv_var to uppercase. " this is needed bychane the string contains lower case.. and sy-abcde doesnt contain lower case elements.
if lv_var CA sy-abcde.
message 'contains chars' type 'I'.
endif.
Edited by: Soumyaprakash Mishra on Oct 12, 2009 8:33 PM -
How to convert hex into a string value
hei evryone!
can anyone please help me on how to convert a hex value into a string suppose.. Example i want to convert 4275646479 which is a hex value, into a string "BUDDY"? how will i do that???
Any suggestion, tutorial site would be appreciated?
Thx!something like this will convert string to byte[]
e.g.
you want to convert following.
656667 => ABC
String toConvert = "656667";
byte[] returnVal = String2byteArr (toConvert );
String FinalStr = new String(returnVal);
public static byte[] String2byteArr(String Result)
byte[] byteRet = new byte[Result.length()/2];
int k=0;
for (int j=0; j<(Result.length()); j+=2)
try
Integer I = new Integer (0);
I = I.decode ("0x"+Result.substring(j, j+2));
int i = I.intValue ();
if (i > 127)
i = i - 256;
byteRet[k++] = new Integer(i).byteValue();
catch(Exception e)
System.err.println(e);
return byteRet;
}// String2byteArr
Hope this will help you, So that i can get 3$ (:-)
Avi -
How to convert hex string to time stamp?
Hello everyone..
I am currently working on a project in which I have to read the data from a unit and display that data using LabVIEW. I am using serial communication for reading the data. The read data is in hex format.
Now, I want to convert this hex string to a time stamp value. I am reading total 16 bytes. How to convert this hex data to a time stamp value. I have developed a VI. But I want to know that the displayed time stamp is correct or not? Or suggest me some other solution.
I am using LabVIEW 2011.
Thanks & Regards,
Manisha
Attachments:
Test.vi 7 KBHi mancan,
As Iam using LV2009 Iam unable to open your example.Anyway for converting hex to time stamp
Thanks as kudos only -
How to print the HEX values of non-displayable characters!
I am trying to tokenize a string that contains non-displayable characters i.e. EBCDIC or ASCII. How can I print the HEX values of the non-displayable characters. e.g.
"StartTEST1TEST2TEST3TEST4TEST5TEST6TEST7TEST812END"
How can print the HEX values of in the above string. Any help is appreciated.
Thankschar ch = 28; // or whatever character you want to look at.
String hexString = Integer.toHexString(ch);
System.out.println(hexString); -
How to convert a string value to date
Dear All,
I am new to powershell script, i was trying to store a Ad user password set date to a variable add, add a number of days to get the expire date.
but when i try to convert the variable to date value, I am getting the error as below.
Please help me......
PS C:\script> $passwordSetDate = (get-aduser user1 -properties * | select PasswordLastSet)
PS C:\script> $passwordSetDate
PasswordLastSet
7/15/2014 8:17:24 PM
PS C:\script> $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
Cannot find an overload for "ParseExact" and the argument count: "3".
At line:1 char:1
+ $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodException
+ FullyQualifiedErrorId : MethodCountCouldNotFindBest
PS C:\script> $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)Dear All,
I am new to powershell script, i was trying to store a Ad user password set date to a variable add, add a number of days to get the expire date.
but when i try to convert the variable to date value, I am getting the error as below.
Please help me......
PS C:\script> $passwordSetDate = (get-aduser user1 -properties * | select PasswordLastSet)
PS C:\script> $passwordSetDate
PasswordLastSet
7/15/2014 8:17:24 PM
PS C:\script> $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
Cannot find an overload for "ParseExact" and the argument count: "3".
At line:1 char:1
+ $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodException
+ FullyQualifiedErrorId : MethodCountCouldNotFindBest
PS C:\script> $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
In your post you ask how to convert a string value to a date. The value returned from the Get-AdUser is already a date. It does not need to be converted.
Bill has sshown one way to convert a date to a string and there are other methods. You need to clarify your question.
If you are really trying ot convert strings to dates then you can start with this:
[datetime]'01/21/1965 13:33:23'
Most date strings aer autodetected by the class.
¯\_(ツ)_/¯ -
How to convert a string to hex in TestStand
Hi everyone, I think this is a fairly easy question to answer but I am newer to TestStand.
In one step I am pulling in the Serial Number of a Device (which is alpha and numeric characters) and storing it as a String Local called Local.SerialNumberString. In the following step I need to convert this Local to a Hex value and store it as Locals.SerialNumberHex
Here is the data representation I need to take place:
Locals.SerialNumberString = ABC123456
and would like to know of a function that would convert to the following:
Locals.SerialNumberHex = 414243313233343536
How can this be done?
Thanks so much!It looks like what you are asking for is more than just converting to hex, it looks like you want to convert the characters in the string to their ascii value representation and then convert that to hex.
1) Use a for loop Locals.i = 0; Locals.i < Len(Locals.SerialNumberString); Locals.i++
2) Inside the loop do: Locals.SerialNumberHex += Str(Asc(Mid(Locals.SerialNumberString, Locals.i, 1)), "%.2x")
Hope this helps,
-Doug
Maybe you are looking for
-
How to use cursor data in more than one location in the form?
hi all. is it possible to make cursor as global or public in the form so i can use its data in more than location for testing like in buttons triggers. for example: if i declare the following cursor in "WHEN-NEW-FORM-INSTANCE" trigger CURSOR cur IS S
-
Old ipod updater ... where can I get a copy?
I had asked this question in a previous post but received no replies so I though I would try again. I am (like lots of others) having problems with my ipod and itunes 5 and the new ipod updater. I was hoping to download an old ipod-updater - say Feb
-
Hi All, In one of the scenario Sender channel is picking files from FTP server. It is working correctly, after the first file gets polled, it is taking some time to poll the successive files. If there are lot of files each having different size in th
-
Change the purchasing group of shopping cart created in SRM from PR in ECC
Dear All, When a PR is created in ECC and transferred to SRM using program BBP_EXTREQ_TRANSFER, the purchasing group does not get assigned correctly in the SC created in SRM. I tried implementing Badi BBP_BADI_EXTREQ_OUT to resolve the same. But it i
-
Can I use indesign without being online
can I use indesign without being online.