05-08-2009 10:13 AM
Hi,
I've got the following coding in a Non-Unicode system which should be converted to a Unicode compatible coding:
DATA: delimiter(1) TYPE x VALUE '02'.
CONCATENATE anz_pos l_zaehler INTO text-line SEPARATED BY delimiter.
...
SPLIT l_object_content-line AT delimiter INTO l_object l_adress.
Transaction UCCHECK complaints about the line CONCATENATE and SPLIT.
So what's the best way to retain the Hex value of '02' (this is requirement since there are old files archived, containing this delimiter, and which are still be processed) and split or concatenate the field values in an Unicode enabled Abap?
05-08-2009 12:01 PM
Hi,
Try this ..
DATA: l_lowval(5) TYPE c .
DATA: c_lowval(5) TYPE c value '\X\02' . ---> Hexadecimal
" Convert hexadecimal value to char
CALL FUNCTION 'STPU1_HEX_TO_CHAR'
EXPORTING
hex_string = c_lowval
IMPORTING
CHAR_STRING = l_lowval.
DATA: delimiter(1) TYPE C.
delimiter = l_lowval.
CONCATENATE anz_pos l_zaehler INTO text-line SEPARATED BY delimiter.
...
SPLIT l_object_content-line AT delimiter INTO l_object l_adress.
05-08-2009 10:20 AM
>
> Hi,
> I've got the following coding in a Non-Unicode system which should be converted to a Unicode compatible coding:
>
>
> DATA: delimiter(1) TYPE x VALUE '02'. > CONCATENATE anz_pos l_zaehler INTO text-line SEPARATED BY delimiter. > ... > SPLIT l_object_content-line AT delimiter INTO l_object l_adress. >
>
> Transaction UCCHECK complaints about the line CONCATENATE and SPLIT.
>
> So what's the best way to retain the Hex value of '02' (this is requirement since there are old files archived, containing this delimiter, and which are still be processed) and split or concatenate the field values in an Unicode enabled Abap?
try
DATA: xdelimiter(1) TYPE x VALUE '02'.
field-symbols:
<cdel> type c length 1.
assign xdelimiter to <cdel> casting.
After that use <cdel> instead of delimiter.
05-08-2009 11:54 AM
Rainer,
unfortunately the syntax check complaints about the word 'length 1' in the FIELD-SYMBOLS declaration.
05-08-2009 10:24 AM
try the belwo FM..
CACS_CONVERT_HEX_TO_STRING - this should serve the purpose
NLS_STRING_CONVERT_TO_SYS
STPU1_HEX_TO_CHAR
05-08-2009 12:01 PM
Hi,
Try this ..
DATA: l_lowval(5) TYPE c .
DATA: c_lowval(5) TYPE c value '\X\02' . ---> Hexadecimal
" Convert hexadecimal value to char
CALL FUNCTION 'STPU1_HEX_TO_CHAR'
EXPORTING
hex_string = c_lowval
IMPORTING
CHAR_STRING = l_lowval.
DATA: delimiter(1) TYPE C.
delimiter = l_lowval.
CONCATENATE anz_pos l_zaehler INTO text-line SEPARATED BY delimiter.
...
SPLIT l_object_content-line AT delimiter INTO l_object l_adress.
05-08-2009 12:23 PM
This, for when it would be a tab
*CONSTANTS: c_delimeter TYPE x VALUE '09'. "<TAB>
CONSTANTS: c_delimeter VALUE cl_abap_char_utilities=>horizontal_tab.
SPLIT yourfield at c_delimeter INTO v_result.