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 REPLACEMENT for the given logic

Former Member
0 Likes
1,426

BEGIN OF CRLF,

CARRIAGE_RETURN(1) TYPE X VALUE '0D',

LINE_FEED(1) TYPE X VALUE '0A',

END OF CRLF,

This is not allowed in Unicode environments.

I get the below error:

CRLF must be a character type object.

How can I replace this statement.

I checked some posts on sdn but didnot work out.

Thanks

Kiran

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,378

the exact replacement is this..

data: cr, lf.

cr = cl_abap_char_utilities=>cr_lf.

lf = cl_abap_char_utilities=>cr_lf+1(1).

break-point.

11 REPLIES 11
Read only

Former Member
0 Likes
1,378

using the class cl_abap_char_utlities=>CR_LF you can overcome .

Read only

Former Member
0 Likes
1,379

the exact replacement is this..

data: cr, lf.

cr = cl_abap_char_utilities=>cr_lf.

lf = cl_abap_char_utilities=>cr_lf+1(1).

break-point.

Read only

0 Likes
1,378

Hi Vijay,

I have both those variables in a single structure kind.

but you are splitting them into two different variables.

This CRLF is used in many areas in my entre function group.

So how can I change it all of them?

is it the only solution?

Thanks

Kiran

Read only

0 Likes
1,378

it is the only solution, you have to use the cl_abap_char_utilities=>cr_lf, the way i mentioned, you have to use like this...

BEGIN OF CRLF,
CARRIAGE_RETURN(1) TYPE c,
LINE_FEED(1) TYPE c,
END OF CRLF

CRLF-CARRIAGE_RETURN = cl_abap_char_utilities=>cr_lf.
CRLF-LINE_FEED = cl_abap_char_utilities=>cr_lf+1(1).

Read only

0 Likes
1,378

I coded like this:earlier i coded with out that +1(1).

class CL_ABAP_CHAR_UTILITIES definition load.

data: BEGIN OF crlf,

carriage_return(1) type c,

line_feed(1) type c,

end of crlf.

crlf-carriage_return = CL_ABAP_CHAR_UTILITIES=>cr_lf.

crlf-line_feed = CL_ABAP_CHAR_UTILITIES=>cr_lf+1(1).

Now still I am getting this error.

statement is not accessible. and pointing at crlf-carriage_return =......

Thanks

kiran

Read only

0 Likes
1,378

Hi ,

this is one way of declaration and

c_tab type c value CL_ABAP_CHAR_UTILITIES=>horizontal tab

and

c_0d type c value CL_ABAP_CHAR_UTILITIES=>cr_lf

regards,

bharani

Read only

0 Likes
1,378

since the code you placed should be under some event, but you placed directly in the beginning. so use initialization or start-of-selection.

class CL_ABAP_CHAR_UTILITIES definition load.
data: BEGIN OF crlf,
carriage_return(1) type c,
line_feed(1) type c,
end of crlf.

start-of-selection.
crlf-carriage_return = CL_ABAP_CHAR_UTILITIES=>cr_lf.
crlf-line_feed = CL_ABAP_CHAR_UTILITIES=>cr_lf+1(1).

Read only

0 Likes
1,378

I solved it like this as I cannot have any events in my include.

class CL_ABAP_CHAR_UTILITIES definition load.

data: BEGIN OF crlf,

carriage_return(1) type c value CL_ABAP_CHAR_UTILITIES=>cr_lf,

line_feed(1) type c value CL_ABAP_CHAR_UTILITIES=>cr_lf,

end of crlf.

Will this work?

Now I dont get any errors.

Thanks

Kiran

Read only

0 Likes
1,378

the way you declared is ok.

But the line_feed value should be this

crlf-line_feed = CL_ABAP_CHAR_UTILITIES=>cr_lf+1(1).

Read only

0 Likes
1,378

Thanks vijay.

But I am having one more declaration as below

  • BEGIN OF html_td_end,

  • '</td>', crlf(2) TYPE x VALUE '0D0A',

  • END OF html_td_end,

and in the logic

DATA: L_TAG_END_STACK(64) TYPE C OCCURS 10 WITH HEADER LINE,

INSERT HTML_TD_END INTO L_TAG_END_STACK INDEX 1.

Replaced declarations like below

begin of html_td_end,

'</td>',

crlf(2) TYPE C VALUE cl_abap_char_utilities=>cr_lf,

end of html_td_end,

now what changes do i have to do in logic of insert statement.

bcoz it gives me an error that HTML_TD_END & L_TAG_END_STACK are not mutualy convertible

thanks

kiranu

Read only

0 Likes
1,378

you can try like this,,,,

DATA: L_TAG_END_STACK(64) TYPE C OCCURS 10 WITH HEADER LINE,
crlf(2) TYPE C VALUE cl_abap_char_utilities=>cr_lf.
data:  html_td_end(64).


concatenate 
'</td>' crlf into HTML_TD_END .

INSERT HTML_TD_END INTO L_TAG_END_STACK INDEX 1.