Skip to Content
0
Apr 27, 2009 at 08:07 AM

What this small code does? And how do I do it in Unicode.

38 Views

Hi.

I got the following code and I really don't know what it does or even why. All I know It's not UC enabled ( since it's uxinf the type x).

I was thinking I might be converting from ascii representation to text or something like that but I'm not that sure.

FORM TRANSLATE_FIELD USING STRING_TRAN

CHANGING STRING1.

DATA: STRING(255),

len1(3) type i,

LEN(3) TYPE I,

NUM(3) TYPE I,

I(3) TYPE I.

DATA: C VALUE 'A',

X TYPE X.

FIELD-SYMBOLS:<fc> type c.

STRING = STRING_TRAN.

len1 = strlen( STRING ).

LEN = 0.

NUM = 0.

while len < len1.

i = STRING+len(3).

move i to x.

assign x to <fc> casting type c.

move <fc> to c.

MOVE C TO STRING1+NUM.

len = len + 3.

NUM = NUM + 1.

endwhile.

ENDFORM. " TRANSLATE_FIELD

Thanks

Ariel