Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Unicode X type length

Former Member
0 Likes
817

Hi

I have requirement for type conversion in unicode project.

I have a struct used in overlay statement

OVERLAY B0004 WITH SREP ONLY REPLSET.

but in unicode only char type structure need to use for ONLY [pattern].

here what should be length of line0, line1.......

or how to convert the hot coded data into Char type variable?

Please help me....

DATA: BEGIN OF REPLSET,

LINE0(16) TYPE X VALUE '000102030405060708090A0B0C0D0E0F',

LINE1(16) TYPE X VALUE '101112131415161718191A1B1C1D1E1F',

LINE2(02) TYPE X VALUE '2227',

LINE7(01) TYPE X VALUE '7F',

LINE8(13) TYPE X VALUE '8182838485868788898B8D8E8F',

LINE9(14) TYPE X VALUE '909192939495969798999B9D9E9F',

LINEA(11) TYPE X VALUE 'A0A4A6A8A9AAABACADAEAF',

LINEB(15) TYPE X VALUE 'B0B1B2B3B4B5B6B7B8B9BABBBCBDBE',

LINED(01) TYPE X VALUE 'DF',

END OF REPLSET.

5 REPLIES 5
Read only

Former Member
0 Likes
697

Hi Sri,

You can use the class cl_abap_char_utilities to declare the hard coded values for type X.

Read only

Former Member
0 Likes
697

Hi Sri,

You can convert hard coded data into chaR TYPE VARIABLE BY USING THE class cl_abap_char_utilities.See the exemple below.

Old statement: CONSTANTS: c_tab TYPE x VALUE '09', *****here value 9 is used for tab separator.

New statement: CONSTANTS: c_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.

Read only

0 Likes
697

Can we use like this:

DATA: BEGIN OF REPLSET,

LINE0(16) TYPE c VALUE cl_abap_char_utilities=>horizontal_tab

VALUE '000102030405060708090A0B0C0D0E0F',

LINE1(16) TYPE c VALUE cl_abap_char_utilities=>horizontal_tab VALUE '101112131415161718191A1B1C1D1E1F',

LINE2(02) TYPE c VALUE cl_abap_char_utilities=>horizontal_tab VALUE '2227',

LINE7(01) TYPE c VALUE cl_abap_char_utilities=>horizontal_tab VALUE '7F',

LINE8(13) TYPE c VALUE cl_abap_char_utilities=>horizontal_tab VALUE '8182838485868788898B8D8E8F',

LINE9(14) TYPE c VALUE cl_abap_char_utilities=>horizontal_tab VALUE '909192939495969798999B9D9E9F',

LINEA(11) TYPE c VALUE cl_abap_char_utilities=>horizontal_tab VALUE 'A0A4A6A8A9AAABACADAEAF',

LINEB(15) TYPE c VALUE cl_abap_char_utilities=>horizontal_tab VALUE 'B0B1B2B3B4B5B6B7B8B9BABBBCBDBE',

LINED(01) TYPE c VALUE cl_abap_char_utilities=>horizontal_tab VALUE 'DF',

END OF REPLSET.

Do I need to change length here?

please help me

Read only

0 Likes
697

hi, i dont think thats the way u shud declare

dont use VALUE '2227' etc for declarations at the end.... u shud constant attributes in SE24

u can goto SE24 and check the attributes of what u can use, in ur case if u want to add a new line then u shud be using cl_abap_char_utilites=>newline (line feed )

u shud do something like this, first use the class

CLASS cl_abap_char_utilities DEFINITION LOAD.

if u want to use constant attributes then u can use the below

charsize length of 1 character in bytes

newline

cr_lf

form_feed

horizontal_tab

vertical_tab

backspace

minchar

maxchar

then u shud access them like this

<b> cl_abap_char_utilites=>horizontal_tab </b>

Read only

Former Member
0 Likes
697

Hi Sri,

chk this link,it helps u in conversions:

http://www.asciitable.com/

regards,

keerthi