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

Frequently faced errors in Unicode while SAP Upgrade

Former Member
0 Likes
805

Hi Gusy,

I am going work on Unicode upgarde project, can any one share Frequently faced errors in Unicode while SAP Upgrade.

Thanks,

Gourisankar.

4 REPLIES 4
Read only

GauthamV
Active Contributor
0 Likes
699

hi,

Check out the below related threads

Read only

Former Member
0 Likes
699

Hi

Please check the below link you will get lot of things about unicode for upgrade

http://help.sap.com/saphelp_nw04/helpdata/en/79/c554d3b3dc11d5993800508b6b8b11/frameset.htm

Regards,

Syf

Read only

former_member206439
Contributor
0 Likes
699

Hi

MESSAGEG@3

Replace variable declaration of type X with appropriate value from method cl_abap_char_utilities

i.e. CONSTANTS: con_tab TYPE x VALUE '09',

con_cret TYPE x VALUE '0D'.

would be replaced with

CONSTANTS: con_tab TYPE c value cl_abap_char_utilities=>HORIZONTAL_TAB,

con_cret TYPE c value cl_abap_char_utilities=>CR_LF.

*UPLO *

Upload/ws_upload and download/ws_download are obsolete, since they are not Unicode enabled. Replace

with appropriate methods from cl_gui_frontend_services. Please also note that the data types of the various

parameters will also probably also need changing for the new method calls but the code below demonstrates

how to do this. I_TABLE is the original table and IT_UCTABLE is the converted table.

i.e. Function module u2018WS_DOWNLOADu2019

CALL FUNCTION 'WS_DOWNLOAD'

EXPORTING

FILENAME = p_file

FILETYPE = 'ASC'

MODE = ' '

TABLES

DATA_TAB = i_table

EXCEPTIONS

..

would be replaced with

data: gd_file type string.

types: t_uctable like line of i_table.

data: it_uctable type standard table of t_uctable.

gd_file = p_file.

it_uctable[] = i_table[].

CALL METHOD cl_gui_frontend_services=>gui_download

EXPORTING

filename = gd_file

filetype = 'ASC' " DAT,WK1

Append = ' ' "if mode = A then this would be X

CHANGING

data_tab = it_uctable

EXCEPTIONS

OTHERS = 1.

Function module u2018DOWNLOADu2019

CALL FUNCTION 'DOWNLOAD'

EXPORTING

filename = p_file

filetype = 'WK1'

TABLES

data_tab = i_table.

..

would be replaced with

data: gd_file type string.

DATA: ld_filename TYPE string,

ld_path TYPE string,

ld_fullpath TYPE string,

ld_result TYPE i.

types: t_uctable like line of i_table.

data: it_uctable type standard table of t_uctable.

gd_file = p_file.

shift gd_file RIGHT DELETING TRAILING '\'.

shift gd_file RIGHT DELETING TRAILING '/'.

shift gd_file left DELETING LEADING space.

CALL METHOD cl_gui_frontend_services=>file_save_dialog

EXPORTING

DEFAULT_EXTENSION = 'WK1'

default_file_name = gd_file

INITIAL_DIRECTORY = gd_file

CHANGING

filename = ld_filename

path = ld_path

fullpath = ld_fullpath

user_action = ld_result.

check ld_result eq 0.

gd_file = ld_fullpath.

gd_file = p_file.

it_uctable[] = i_table[].

CALL METHOD cl_gui_frontend_services=>gui_download

EXPORTING

filename = gd_file

filetype = 'ASC' " DAT,WK1

Append = ' ' "if mode = A then this would be X

CHANGING

data_tab = it_uctable

EXCEPTIONS

OTHERS = 1.

Or in circumstances where you need to add field texts to the first line of the file you could use the

GUI_DOWNLOAD function module:

DATA: BEGIN OF fields_tab OCCURS 0,

f1(50),

END OF fields_tab.

fields_tab-f1 = 'field1 text'.

APPEND fields_tab.

fields_tab-f1 = 'field2 text'.

APPEND fields_tab.

fields_tab-f1 = 'field3 text'.

APPEND fields_tab.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = i_filename

filetype = 'DAT'

IMPORTING

filelength = filelen

TABLES

data_tab = itab

fieldnames = fields_tab

EXCEPTIONS

.....

-


Note: u2018ws_uploadu2019 and u2018uploadu2019 would be the same as above but would use the

cl_gui_frontend_services=>gui_upload method call instead:

CALL METHOD cl_gui_frontend_services=>gui_upload

EXPORTING

filename = gd_file

filetype = 'ASC' " DAT,WK1

Append = ' '

CHANGING

data_tab = it_uctable

EXCEPTIONS

OTHERS = 1.

OPEN 004

Add u2018ENCODINGu2019 addition to statement

i.e. OPEN DATASET G_DATAFILE for OUTPUT IN TEXT MODE.

would be replaced with

OPEN DATASET G_DATAFILE for OUTPUT IN TEXT MODE ENCODING NON-UNICODE.

OPEN 002

IN..Mode is expected within open dataset command.

i.e. OPEN DATASET wfilepath FOR OUTPUT.

would be replaced with

OPEN DATASET wfilepath FOR OUTPUT IN TEXT MODE ENCODING NON-UNICODE.

Or OPEN DATASET wfilepath FOR OUTPUT IN BINARY MODE.

OPEN 001

FOR INPUT, FOR OUTPUT, FOR APPENDING or FOR UPDATE expected!

i.e. OPEN DATASET wfilepath FOR OUTPUT.

would be replaced with

OPEN FOR OUTPUT DATASET wfilepath FOR OUTPUT IN TEXT MODE.

DESCIBE002

THE DESCRIBE LENGTH can only be used with the IN BYTE or IN CHARACTER MODE

i.e. describe field e_text length line_length.

would be replaced with

describe field e_text length line_length IN CHARACTER MODE.

ASSIGN 019

The statement u2018ASSIGN PATH+PATHLENGTH TO

.u2019 Returns the following error message:

"You cannot use ASSIGN f+offset. Always use an explicit length (or '*')".

i.e. ASSIGN PATH+PATHLENGTH TO

.

would be replaced with

ASSIGN PATH+PATHLENGTH(2) TO

. u201Creplace 2 with the length of the field

MESSAGEG!2

Itab/structure and u201C u201C are not mutually convertible in a Unicode program

i.e. G_SHOW_LIST = SPACE.

would be replaced with

Clear: G_SHOW_LIST.

Or G_SHOW_LIST-field1 = space.

G_SHOW_LIST-field2 = space.

u2026etc

*MESSAGEG!3 *

var and var are not comparable in a Unicode program

Example Data: VAR like tabix.

was replaced with

Data: VAR type sy-tabix.

Read only

Former Member
0 Likes
699

Answered