‎2008 Oct 03 4:45 PM
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
‎2008 Oct 03 4:52 PM
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.
‎2008 Oct 03 4:48 PM
using the class cl_abap_char_utlities=>CR_LF you can overcome .
‎2008 Oct 03 4:52 PM
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.
‎2008 Oct 03 6:00 PM
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
‎2008 Oct 03 6:06 PM
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).
‎2008 Oct 03 6:17 PM
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
‎2008 Oct 03 6:34 PM
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
‎2008 Oct 03 6:36 PM
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).
‎2008 Oct 03 6:59 PM
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
‎2008 Oct 03 7:27 PM
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).
‎2008 Oct 03 8:25 PM
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
‎2008 Oct 03 8:44 PM
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.