Skip to Content
0
Former Member
Feb 25, 2009 at 10:42 AM

Field Symbols-Ascii to Char

140 Views

Hi,

My requirement is to cocatenate the characters A-Z to F0001, I am using the below code that actually converts the Ascii value to a char( found through the net), but it is giving error.

Can anybody solve my problem

data : asci type i value 65.
data : x1 type x,
       x2 type string.
field-symbols : <fc> type c.

while counter <> num.

move asci to x1.
assign x1 to <fc> casting. <<<<<<<<< error in this line
write <fc> to x2.
if asci le 91.
asci = asci + 1.
else.
asci = 65.
endif.

CONCATENATE val1 x2 INTO val.
it_itab-var1 = val.
APPEND it_itab.
CLEAR it_itab.

counter = counter + 1.
endwhile.

Error :

The length of "X1" in bytes must be a multiple of the size of a Unicode

character, regardless of the size of the Unicode character.

and if I write assign asci to <fc> casting. this will append # rather than the char value.

Need response ASAP.

Thanks in advance.

Pooja