‎2009 Apr 02 1:15 PM
Hi all,
We are doing unicode upgrade from 4.7 to Ecc. The below code is not showing any error in Non-unicode system but in Unicode version it is giving error in 'Translate' Statement .
The error is "TRANSL should be of any of these data type ' C , N , D, t ' ".
DATA: TRANSL(2) TYPE X VALUE '7F20',
TEMP TYPE STRING VALUE '587ADF202'.
TRANSLATE TEMP USING TRANSL.
WRITE: / TEMP.
Regards,
Purshoth.
‎2009 Apr 02 1:18 PM
use the below format........
DATA text TYPE string.
text = `Barbcbdbarb`.
TRANSLATE text USING 'ABBAabba'.
‎2009 Apr 02 1:22 PM
it is the third time you post exactly the same question now.
you already got very qualified answers on your older threads.
that should be enough
‎2009 Apr 02 1:20 PM
hello ,
isntead of using transl as type x why dotn u use type c
hope it solves ru porblem
‎2009 Apr 02 1:48 PM
hi
when u upgrade your system from 4.7 to ECC6.0 some of ABAP key words impacted because of byte processing (X, Xstring) or character processing. for those abap key words its now must additionaly you mentioned in byte mode or in character mode as per the condition.
Key word
CONCATENATE
FIND
REPLACE
SHIFT
SPLIT
CONDENSE
CONVERT TEXT
OVERLAY
TRANSLATE
SET BIT
GET BIT
in case of TRANSLATE
1. TRANSLATE dobj [FROM CODE PAGE cp1] [TO CODE PAGE cp2].
2. TRANSLATE dobj [FROM NUMBER FORMAT nf1] [TO NUMBER FORMAT nf2].
These variants of the TRANSLATE statement are not allowed in Unicode programs. Their functions are replaced with methods of the following conversion classes:
1 CL_ABAP_CONV_IN_CE Reading data from a byte-like data object and converting from an external format to the system format.
2 CL_ABAP_CONV_OUT_CE Converting data from the system format to an external format and writing in a byte-like data object.
3 CL_ABAP_CONV_X2X_CE Converting data from an external format to another external format
‎2009 Apr 02 1:59 PM
hi,
The argument of these instruction like TRANSLATE shd be of String, C, N , D,T.
The error that u r getting is shown when arguments of different types are passed,
Please check with that
Thanks and Regards
Suraj S Nair
‎2009 Apr 03 7:42 AM
hi Purshothaman
If you spcify Using in addition with Translate , the charcters in TEMP are converted according to the TRANSL. TRANSL must be a character-type data object whose contents are interpreted as a sequence of character pairs.