Application Development and Automation 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: 
Read only

Unicode Error on Translate Statement

Former Member
0 Likes
1,016

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.

6 REPLIES 6
Read only

Former Member
0 Likes
890

use the below format........

DATA text TYPE string.

text = `Barbcbdbarb`.

TRANSLATE text USING 'ABBAabba'.

Read only

0 Likes
890

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

Read only

Former Member
0 Likes
890

hello ,

isntead of using transl as type x why dotn u use type c

hope it solves ru porblem

Read only

umashankar_sahu
Active Participant
0 Likes
890

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

Read only

Former Member
0 Likes
890

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

Read only

umashankar_sahu
Active Participant
0 Likes
890

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.