Tab Delimit - Unicode system
We have a program that uses the tab delimit as follows..
z_tab TYPE x VALUE '09', and this is running good.
Now we want to start using the check box "Unicode checks active" which is available in Attributes, but the program pops up with a message as follow:
"Z_TAB must be a character-type data object (data type C,N,D,T or STRING). field string).
Is there any way I can use the TAB delimition with out using the hexa code (of TYPE x).. ??
I heard there is a class called "cl_gui_char_utlitites"..but not sure how to use it.. can any one help me in this regard..
adarsh rao replied
In the newer releases of SAP, ABAP supports multi-byte coding for characters in Unicode , earlier only single /double byte code were supported. Because of this the syntax check gives error for several statements which works in 4.6 B .
Data: str1(10), str2(10),str3(20) hex type x.
hex = '0A'. "0A is the hex code for new line '09' is horozontal tab
The class CL_ABAP_CHAR_UTILITIES has various attributes that contains values such as tab, line feed etc.
You can refer to the link below for more info.
u can use classes to eliminate the error.we too got many unicode errors in new 5.0 ECC version.
u can use classes CR_LF,HORIZONTAL_TAB depending on u'r requirement.
here is one example.
*& Report ZTEST10
data: str1(10), str2(10), str3(20).
str1 = 'Initial'.
str2 = 'Second'.
data: begin of itab occurs 0,
end of itab.
*concatenate str1 CL_ABAP_CHAR_UTILITIES=>CR_LF str2 into str3.
concatenate str1 CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB str2 into str3.
itab = str3.
CALL FUNCTION 'GUI_DOWNLOAD'
FILENAME = 'c:\unicode5.txt'
DATA_TAB = itab.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
May be it will help u.