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 system

Former Member
0 Likes
1,387

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.

13 REPLIES 13
Read only

Former Member
0 Likes
1,347

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

Read only

0 Likes
1,347

Hi Sumodh,

Thanks for the reply. But I wish to change my code based on the mode of the system (Unicode).

Any inputs ?

Read only

0 Likes
1,347

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

Read only

0 Likes
1,347

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., )

Read only

0 Likes
1,347

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

Read only

0 Likes
1,347

Hello Friends,

That's exactly my first post was. How to write an ABAP code to distinguish between Unicode and other systems ?

Read only

0 Likes
1,347

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

Read only

0 Likes
1,347

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?

Read only

0 Likes
1,347

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

Read only

0 Likes
1,347

Use cl_abap_char_utilities=>charsize.

Read only

nils_buerckel
Product and Topic Expert
Product and Topic Expert
0 Likes
1,347

Hi,

please have a look at:

Best regards,

Nils Buerckel

SAP AG

Read only

GauthamV
Active Contributor
0 Likes
1,347

Goto UCCHECK transaction and click the button Docu for ABAP + Unicode on application toolbar.

Read only

Former Member
0 Likes
1,347

Try this FM.

TR_GET_IS_UNICODE_SYSTEM

KR

Veeranji Reddy P.