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

System is unicode or not?

Former Member
0 Likes
2,189

Hello

For some reason, i need to find out that executing system is unicode enabled or not? i should know it with in my prog. I need it to put a validation in mu prog. I checked SYST structure at runtime, no use!

Thank you

1 ACCEPTED SOLUTION
Read only

Clemenss
Active Contributor
0 Likes
2,049

Hi,

data:
    L_RESULT(5) type C.

  call 'C_SAPGPARAM' id 'NAME'  field 'abap/unicode_check'
                     id 'VALUE' field L_RESULT.                "#EC CI_CCALL
  if L_RESULT cs 'on'.
    P_RESULT = 'X'.
    return.
  endif.

  if CL_ABAP_CHAR_UTILITIES=>CHARSIZE > 1.
    P_RESULT = 'X'.
    return.
  endif.

Regards,

Clemens

Hello

For some reason, i need to find out that executing system is unicode enabled or not? i should know it with in my prog. I need it to put a validation in mu prog. I checked SYST structure at runtime, no use!

Thank you

6 REPLIES 6
Read only

Former Member
0 Likes
2,049

Hi,

I am not understanding what are you trying to say.

If I am correct then you want to check whether your SAP system is UNICODE enabled or not.

If this is your query, then you can find this thing by:

Login to SAP -> GoTo system -> Click on Status.

In the middle, you will see "Unicode System", if value is "Yes", then your system is Unicode enabled.

If you want to put check points in program, to know whether executing system is Unicode enabled or not, then this link will definately help you.[ABAP Development Under Unicode|http://help.sap.com/saphelp_nw04/helpdata/en/79/c55458b3dc11d5993800508b6b8b11/content.htm]

For your referrence:

[Unicode related issue|;

[Unicode related issue|;

May it helps you.

Regards,

<DS>

Read only

Former Member
0 Likes
2,049

I am not able to understand your requirement as to why you need to check whether your system is unicode compliant dynamically? Would you be running the program in different systems/instance and need a different behaviour (based on whether it is unicode compliant?)

Read only

0 Likes
2,049

Yes Chris, i want to put validations in the custom program, because this program executes in both systems(enabled and not).

Thank you

Read only

0 Likes
2,049

There is a system parameter in RZ11 which will say the system is unicode system or not. you can check for that.

there will be function modules to get those parameters. I am not sure of this FM RSAN_SYSTEM_PARAMETER_READ.

try something like this.

Read only

Clemenss
Active Contributor
0 Likes
2,050

Hi,

data:
    L_RESULT(5) type C.

  call 'C_SAPGPARAM' id 'NAME'  field 'abap/unicode_check'
                     id 'VALUE' field L_RESULT.                "#EC CI_CCALL
  if L_RESULT cs 'on'.
    P_RESULT = 'X'.
    return.
  endif.

  if CL_ABAP_CHAR_UTILITIES=>CHARSIZE > 1.
    P_RESULT = 'X'.
    return.
  endif.

Regards,

Clemens

Read only

Former Member
0 Likes
2,049

Hi

, your code only works if the RZ11 'abap/unicode_check' parameter is set. In our case that parameter is not set, so it returns a non-Unicode system even if it is Unicode. The code below returns the result regardless of the parameter:

DATA G_CURR_CONFIG_TYPE TYPE CPA_SYS_CONFIG_TYPE.

DATA G_CURR_CONFIG_TYPE_TEXT TYPE STRING.

DATA SYS_TYPE TYPE TEXT15. " NUC Non-Unicode sys

*

* System Type Assignment

CALL METHOD CL_I18N_SYSTEM_SETTINGS=>GET_SYS_CONFIG_TYPE

  IMPORTING

    EX_SYS_CONFIG_TYPE      = G_CURR_CONFIG_TYPE

    EX_SYS_CONFIG_TYPE_TEXT = G_CURR_CONFIG_TYPE_TEXT.

*

CASE G_CURR_CONFIG_TYPE.

  WHEN CL_I18N_SYSTEM_SETTINGS=>C_SYS_CONF_TYPE_UC.

    SYS_TYPE = 'Unicode'.

  WHEN OTHERS.

    SYS_TYPE = 'non-Unicode'.

ENDCASE.

WRITE: / SYS_TYPE.