‎2008 Oct 23 6:37 AM
hi all .
while i'm doin unicode conversion . i'm getting translate codepage error . pls anybody help me out in this issue . thanks
‎2008 Oct 23 6:48 AM
Hi,
Do UCCHECK for your program and see where it si giving Transalte error and after that you can follow these steps.
*******************************************
If u got * u2018Dangerous use of Translate in Multilingual system.u2019* Error
Correction:
To correct the Error occurring on TRANSLATE statement u2013 use this additional statement before the Translate statement.
SET LOCALE LANGUAGE sy-langu.
This statement defines the Text Environment of all the programs & internal sessions in the language specified in the LANGUAGE KEY, which in this case is u201Csy-languu201D, i.e. the log on language of the user.
***********************
Regards,
Syed
‎2008 Oct 23 6:39 AM
‎2008 Oct 23 6:42 AM
hi,
u need use *set locale* for that error ...
thank u
santhosh
‎2008 Oct 23 6:46 AM
set locale is for translate to upper case .. my error is .. when we translate from one codepage to another codepage . while din unicode up-gradtion . thanks
‎2008 Oct 23 6:48 AM
Hi,
Do UCCHECK for your program and see where it si giving Transalte error and after that you can follow these steps.
*******************************************
If u got * u2018Dangerous use of Translate in Multilingual system.u2019* Error
Correction:
To correct the Error occurring on TRANSLATE statement u2013 use this additional statement before the Translate statement.
SET LOCALE LANGUAGE sy-langu.
This statement defines the Text Environment of all the programs & internal sessions in the language specified in the LANGUAGE KEY, which in this case is u201Csy-languu201D, i.e. the log on language of the user.
***********************
Regards,
Syed
‎2008 Oct 23 6:56 AM
Hi,
DATA: BEGIN OF REC1,
LANGE(4) TYPE X,
SATZA(1),
BKLTZ1(5) TYPE P,
BKLTZ2(5) TYPE P,
KONTO1(6) TYPE P,
BF1(6) TYPE P,
BF2(7) TYPE P,
TXTSCHL1(1) TYPE P,
TXTSCHL2(2) TYPE P,
BF3(1),
WRBTR(6) TYPE P,
BKLTZ3(5) TYPE P,
KONTO(6) TYPE P,
INTNR(6) TYPE P,
BF4(3),
NAME1(27),
NAME2(27),
VRWZW(27),
C17A_WAEHRUNGSKENNZ(1),
C17B(2),
EWKZG(2) TYPE P.
DATA: END OF REC1.
FIELD-SYMBOLS: <C_REC1> TYPE C,
<C_V_RECSAV> TYPE C.
DATA: BEGIN OF REC1_C, "Take only character fields in this internal table
SATZA(1),
BF3(1),
BF4(3),
NAME1(27),
NAME2(27),
VRWZW(27),
C17A_WAEHRUNGSKENNZ(1),
C17B(2).
DATA: END OF REC1_C.
DATA : G_OUT1 LIKE REC1_C.
-
-
READ DATASET P_INDAT INTO V_RECSAV.
IF SY-SUBRC NE 0.
EXIT.
ENDIF.
TRANSLATE REC1 FROM CODE PAGE '0100' TO CODE PAGE '1100'.*
*Replace the above statement with the code below
ASSIGN REC1 TO <C_REC1> CASTING.
ASSIGN V_RECSAV TO <C_V_RECSAV> CASTING.
<C_REC1> = <C_V_RECSAV>.
MOVE-CORRESPONDING REC1 TO REC1_C.
PERFORM TRANSLATE_CODEPAGE USING '0100'
'1100'
CHANGING REC1_C G_OUT1.
MOVE-CORRESPONDING REC1_C TO REC1.
-
-
FORM TRANSLATE_CODEPAGE USING P_G_CODEPAGE
P_C_UNICODECP
CHANGING P_T143T TYPE ANY
P_L_OUT TYPE ANY .
DATA: CONVERTER TYPE REF TO CL_ABAP_CONV_OBJ.
DATA: L_OUT TYPE XSTRING.
FIELD-SYMBOLS <C_L_OUT> TYPE XSTRING.
DATA: L_FROMCODE TYPE CPCODEPAGE.
DATA: L_TOCODE TYPE CPCODEPAGE.
DATA : TP_CODEPAGE TYPE CPNORMCP,
TP_INBUFF TYPE I,
TP_OUTBUFF TYPE I.
L_FROMCODE = P_G_CODEPAGE.
L_TOCODE = P_C_UNICODECP.
CREATE OBJECT CONVERTER
EXPORTING
INCODE = L_FROMCODE
MISS = '.'
BROKEN = '.'
USE_F1 = 'X'
OUTCODE = L_TOCODE
EXCEPTIONS
INVALID_CODEPAGE = 1
INTERNAL_ERROR = 2.
IF SY-SUBRC <> 0.
CASE SY-SUBRC.
WHEN 1.
MESSAGE ID 'FES' TYPE 'E' NUMBER '024' RAISING UNKNOWN_ERROR.
WHEN 2.
MESSAGE ID 'FES' TYPE 'E' NUMBER '024' RAISING UNKNOWN_ERROR.
ENDCASE.
ENDIF.
CALL METHOD CONVERTER->CONVERT
EXPORTING
INBUFF = P_T143T
INBUFFLG = 0
OUTBUFFLG = 0
IMPORTING
OUTBUFF = P_L_OUT
EXCEPTIONS
INTERNAL_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
CASE SY-SUBRC.
WHEN 1.
MESSAGE ID 'FES' TYPE 'E' NUMBER '024' RAISING UNKNOWN_ERROR.
WHEN 2.
MESSAGE ID 'FES' TYPE 'E' NUMBER '024' RAISING UNKNOWN_ERROR.
ENDCASE.
ENDIF.
P_T143T = P_L_OUT.
ENDFORM. " TRANSLATE_CODEPAGE
‎2008 Oct 23 7:01 AM
hi . thanks for the which u sent me .. is there any related note for this codepage error . i was searching but i could not able find out notes for this error .pls let me know notes . thanks
‎2008 Oct 23 7:09 AM
Hi,
I am not sure about the note available. But Translate statement will not work in unicode systems.
Actually Fields with types I, P, F, and X remain unchanged by the conversion using translate statement, only character fields will be converted. So we have to move all character fields to separate structure and call the subroutine TRANSLATE_CODEPAGE which i have sent u which does the operation similar to u r translate statement.
‎2008 Oct 23 7:40 AM