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.
You might want to read ABAP Help on TRANSLATE:
... USING pattern
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
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.