Application Development 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: 

Translate string using hex(0020) in Unicode system.

Former Member
0 Kudos

Hello all,

We are facing a problem of the "translate" statement in the Unicode system.

The original statement goes as follows:

TRANSLATE BULOG USING WS_STRING1.

Here BULOG is a structure and ws_string1 is declared as follows:

DATA : ws_string1(2) type x value '0020'.

On compilation in the new system which is Unicode enabled, the above mentioned statement removes all the '#' placed in the structure.

We tried the following statement instead of the original TRANSLATE statement.

TRANSLATE BULOG USING SPACE.

But this statement leaves the '#' unchanged.

We have already REPLACE statement after converting the structure contents into a string.

We have also tried the convert methods of the classes CL_ABAP_CONV_IN_CE and CL_ABAP_CONV_OUT_CE.

Hoping to receive a fast response.

Thanks in advance.

Zankruti.

1 REPLY 1

Jelena
Active Contributor
0 Kudos

You might want to read ABAP Help on TRANSLATE:

Addition 2 
... USING  pattern 

Effect 
If you specify USING, the characters in text are converted according to the rule specified in pattern. 
pattern must be a character-type data object whose contents are interpreted as a sequence of 
character pairs.

Your option 1 is not working because type X is "Byte field", technically it's not a character-type. Your option 2 is not working because <pattern> must be a sequence of character pairs (you had just SPACE).

In Option 1 just change the definition from X to C or STRING.