Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Tab Delimit - Unicode system

Friends,

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..

Thanks

Mavip

Tags:
Former Member
Former Member replied

Hello Mavi,

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 .

An eg

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.

http://help.sap.com/saphelp_nw04/helpdata/en/62/3f2cadb35311d5993800508b6b8b11/content.htm

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

*&

&----


*&

*&

&----


REPORT ZTEST10.

data: str1(10), str2(10), str3(20).

str1 = 'Initial'.

str2 = 'Second'.

data: begin of itab occurs 0,

str3(20),

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.

append itab.

write: str3.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

FILENAME = 'c:\unicode5.txt'

TABLES

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.

ENDIF.

May be it will help u.

Regards,

Adarsh.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question