‎2009 Feb 18 1:05 PM
Hi Experts,
What does this code do?
Num = 81977990.
Translate num(5) using u2018 0u2019.
Thanks,
Girish
In the future, please just try it out.
Edited by: Rob Burbank on Feb 18, 2009 9:33 AM
‎2009 Feb 18 1:26 PM
‎2009 Feb 18 1:08 PM
‎2009 Feb 18 1:13 PM
Hi Srini,
can u please explain me what is happening in the 2nd line-Translate
‎2009 Feb 18 1:13 PM
Hi Girish,
The code that you have specified here does not do anything.
But basically Translate statement is used to specify a PATTERN and using that you can change the input.
Just Press F1 on TRANSLATE key word. You wil know the exact use for that.
E.G.
DATA text TYPE string.
text = `Barbcbdbarb`.
TRANSLATE text USING 'ABBAabba'.
Best Regards,
Ram.
Edited by: ram Kumar on Feb 18, 2009 6:43 PM
‎2009 Feb 18 1:26 PM
These variants of the TRANSLATE statement are not allowed in Unicode programs. Their functions are replaced with methods of the following conversion classes:
CL_ABAP_CONV_IN_CE
Reading data from a byte-like data object and converting from an external format to the system format.
CL_ABAP_CONV_OUT_CE
Converting data from the system format to an external format and writing in a byte-like data object.
CL_ABAP_CONV_X2X_CE
Converting data from an external format to another external format.
DATA: num TYPE char10.
num = 81977990.
TRANSLATE num(5) USING '0'.
WRITE: num.
REPLACE num(5) IN num WITH '0'.
WRITE: num.output: 81977990
07990
‎2009 Feb 18 1:26 PM
‎2009 Feb 18 1:42 PM
‎2009 Feb 18 1:46 PM