‎2010 May 24 9:02 AM
Hello,
What is the ABAP code to identify whether the system is an unicode. If there are already existing
threads for this question, please provide a referecne, I could not find the same.
Thanks.
‎2010 May 24 9:07 AM
Hi,
To Check whether the system is unicode or not you dont have any code.
Just go the new session and from there goto System Menu . In that Status is there.
Then a pop up screen will come and in the right side SAP System data you can see whether the system is unicode or not.
With Regards,
Sumodh.P
‎2010 May 24 9:11 AM
Hi Sumodh,
Thanks for the reply. But I wish to change my code based on the mode of the system (Unicode).
Any inputs ?
‎2010 May 24 9:20 AM
Hi,
Where you need to change the codings.
Eg :This is for checking that whether the file is in utf-8 or not. The below example is for the open dataset.
DATA: L_F_CHAR TYPE C,
OREF TYPE REF TO CX_ROOT,
L_VAR TYPE STRING.
TRY.
CALL METHOD CL_ABAP_FILE_UTILITIES=>CHECK_UTF8
EXPORTING
FILE_NAME = z_phys_dateiname1
IMPORTING
ENCODING = L_F_CHAR .
CATCH CX_SY_FILE_OPEN into oref .
l_var = oref->get_text( ).
MESSAGE l_var TYPE 'S' DISPLAY LIKE 'E'.
STOP.
CATCH CX_SY_FILE_AUTHORITY into oref .
l_var = oref->get_text( ).
MESSAGE l_var TYPE 'S' DISPLAY LIKE 'E'.
STOP.
CATCH CX_SY_FILE_IO into oref.
l_var = oref->get_text( ).
MESSAGE l_var TYPE 'S' DISPLAY LIKE 'E'.
STOP.
ENDTRY.
IF L_F_CHAR = 'U'.
OPEN DATASET z_phys_dateiname1 FOR APPENDING IN TEXT MODE
ENCODING DEFAULT.
ELSE.
OPEN DATASET z_phys_dateiname1 FOR APPENDING IN TEXT MODE
ENCODING NON-UNICODE.
ENDIF.
With Regards,
Sumodh.P
‎2010 May 24 9:30 AM
Sumodh,
Let me be more specific.
The function module is TEXT_FOR_HEADER. Inside this function module I have the required values (Text)
within the table TEXTLINES. I wish to identify the lengh of the character from this value -> textlines. (2 bytes or not etc., )
‎2010 May 24 9:34 AM
Hi,
In an Unicode System Character size stored internally in 2bytes. If you have any doubt on this just goto help.sap.com and from there you can get more documentation.
With Regards,
Sumodh.P
‎2010 May 24 9:37 AM
Hello Friends,
That's exactly my first post was. How to write an ABAP code to distinguish between Unicode and other systems ?
‎2010 May 24 9:49 AM
Hi,
While creating a program dont check the unicode check active button. If the system is not a unicode it will not throw a error. Other wise it will throw a error and check with UCCHECK also.
Visit Help.sap.com to get more on this.
With Regards,
Sumodh.P
‎2010 May 24 9:57 AM
Thanks a lot. I believe we are on way of getting the right answer. I want to add a variable inside my program to find out if the system is unicode. Is is possible ? Which is the table where the relevant information be saved?
‎2010 May 24 10:24 AM
Hi,
The code page will be different for 2 systems. if you need to more about the codepage goto the table tcp00.
From this you can get lot of codpages that are relevant for the systems.
With Regards,
Sumodh.P
‎2010 May 24 10:37 AM
‎2010 Aug 10 12:35 PM
‎2010 May 24 9:07 AM
Goto UCCHECK transaction and click the button Docu for ABAP + Unicode on application toolbar.
‎2010 Aug 10 12:42 PM