cancel
Showing results for 
Search instead for 
Did you mean: 

Offsetting String which contains Japanese Character. In the smartform

Former Member
0 Kudos
Hi,

I am having a problem with Japanese Character.

+ycomment(132) type c.+
+ycomment receives text from read text FM.+
+clear V_CHAR52.+
+V_CHAR52 = ycomment(52).+


Here are the scenarios.

* ycomment 
   = Pooulated in Japanese testing testing testing by Lore testing testing
  v_char52(displayed in form)    
   = Pooulated in Japanese testing testing testing by Lor

* ycomment 
  =  u308Fu305Fu304Fu306Eu540Du524Du306Fu5C0Fu5C71u5FB3u9053u3067u3059u79C1u306Eu540Du524Du306Fu5C0Fu5C71u5FB3u9053u3067u3059u308Fu305Fu304Fu306Eu540Du524Du306Fu5C0Fu5C71u5FB3u9053u3067
  v_char52(displayed in form)
  = u308Fu305Fu304Fu306Eu540Du524Du306Fu5C0Fu5C71u5FB3u9053u3067u3059u79C1u306Eu540Du5C0Fu524Du5C71u306Fu5FB3u5C0Fu9053u5C71u3067u5FB3u9053u3067u3059u308Fu305Fu304Fu306Eu540Du524Du306F

Accepted Solutions (1)

Accepted Solutions (1)

former_member205763
Active Contributor
0 Kudos

CAn u please explain the issue a bit more

Answers (2)

Answers (2)

Former Member
0 Kudos

thanks for the help

Former Member
0 Kudos

It is not indicated that it must be cut off up to 52 characters but up to 52 byte.

How can we make the strings or characters be cut in bytes

former_member156446
Active Contributor
0 Kudos

try this ycomment = ycomment+0(52).

former_member205763
Active Contributor
0 Kudos

So give the offset as 26

Former Member
0 Kudos

i tried also.

former_member205763
Active Contributor
0 Kudos

each unicode character takes two bytes so if u give offset 26 it means 52 bytes

Former Member
0 Kudos

How can I do this.

V_char52 to display in 52 byte length?

umashankar_sahu
Active Participant
0 Kudos

hi

for Byte processing your data object is of data type (X or xstring) and

for char-string processing data object is of data type (C, N, D, T and string).

in non-Unicode systems the length of a character is one byte, but in Unicode system the length of a character depends on which unicode character representation used.

for most of the asian countries 1byte = 2 char.

Former Member
0 Kudos

Ah yeah, i got it so when your characters are unicodes it does consumes all 2 bytes.

if i used in the form the font DBgothic does it says that all my characters has 2 bytes? as i have check it now, it does. please confirm.

the problem now how can i check the language or unicode type of the string i have get. like the v_char52?

the thing i did for now ithink this is stupid is

IF gv_char52 CA 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghiljklmnopqrstuvwxyz'.

gv_char52 = gs_footer-ycomment(52).

ELSE.

gv_char52 = gs_footer-ycomment(26).

ENDIF.

umashankar_sahu
Active Participant
0 Kudos

hi

this will give you clear picture about Byte processing and Character processing.

in case of byte processing

DATA : test TYPE X LENGTH 16, " here check length only 16

test1 TYPE Xstring.

test = '000102030405060708090A0B0C0D0E0F'. " but here passing string of 32

test1 = '00537'.

IF test byte-ca test1.

WRITE : test.

ENDIF.

In case of Char-String processing

DATA : test TYPE c LENGTH 32, " here check length only 32

test1 TYPE string.

test = '000102030405060708090A0B0C0D0E0F'. " but here passing string of 32

test1 = '00537'.

IF test ca test1.

WRITE : test.

ENDIF.

may be this comparison is helpfull for you.

umashankar_sahu
Active Participant
0 Kudos

if any point you want to convert your text in byte procsseing mode

use

CONVERT TEXT text INTO SORTABLE CODE hex.

1. The data object text must be of type c or string .

2. and the data object hex must be byte-type (X or Xstring)

for example

DATA : text TYPE c LENGTH 50 VALUE 'わたくの名前は小山徳道です私の名前は小山徳道ですわたくの名前は小山徳道で'.

DATA : hex TYPE xstring.

********SET LOCALE LANGUAGE 'D'.

CONVERT TEXT text INTO SORTABLE CODE hex.

WRITE : text.

WRITE : hex.