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 error

Former Member
0 Likes
1,686

Dear All,

I am getting unicode errror i.e. UC_OBJECTS_NOT_CONVERTIBLE means dataobjects in unicode programs cannot be converted,

while upgrading from 4.6 to ECC 6.0, when iam trying to open downloaded file in excel.

In debugging, error occurs while executing statment "CALL METHOD OF obj_ex_sheet " in the code given below:

-


FORM open_downloaded_file_in_excel *

-


FORM open_downloaded_file_in_excel.

DATA:

lv_ole_books TYPE ole2_object,

lv_ole_sheets TYPE ole2_object,

lv_subrc LIKE sy-subrc,

lv_title(70) TYPE c,

lv_text1(70) TYPE c,

lv_text2(70) TYPE c.

start excel

CREATE OBJECT obj_ex_sheet 'EXCEL.SHEET'.

IF sy-subrc NE 0.

lv_subrc = sy-subrc.

FREE OBJECT obj_ex_sheet.

PERFORM error_handling_ms_excel USING lv_subrc.

ENDIF.

CALL METHOD OF obj_ex_sheet 'Application' = obj_ex_app.

IF sy-subrc NE 0.

lv_subrc = sy-subrc.

FREE OBJECT obj_ex_app.

FREE OBJECT obj_ex_sheet.

PERFORM error_handling_ms_excel USING lv_subrc.

ENDIF.

SET PROPERTY OF obj_ex_app 'Visible' = 1.

open data file: main file

CALL METHOD OF obj_ex_app 'Workbooks' = lv_ole_books.

CALL METHOD OF lv_ole_books 'Open' = obj_ex_wbook

EXPORTING #1 = gv_filename

#2 = 2

#3 = 0

#4 = 1

#5 = 0

#6 = 0

#7 = 1.

IF sy-subrc NE 0.

lv_subrc = sy-subrc.

FREE OBJECT obj_ex_wbook.

FREE OBJECT obj_ex_app.

FREE OBJECT obj_ex_sheet.

PERFORM error_handling_ms_excel USING lv_subrc.

ENDIF.

FREE OBJECT lv_ole_books.

CALL METHOD OF obj_ex_wbook 'Worksheets' = lv_ole_sheets.

CALL METHOD OF lv_ole_sheets 'Item' = obj_ex_wsheet

EXPORTING #1 = 1.

FREE OBJECT lv_ole_sheets.

GET PROPERTY OF obj_ex_wsheet 'UsedRange' = obj_ex_usedrange.

CALL METHOD OF obj_ex_usedrange 'AutoFormat'

EXPORTING #1 = 18.

SET PROPERTY OF obj_ex_wsheet 'Name' = sy-tcode.

FREE OBJECT obj_ex_usedrange.

PERFORM free_ole_objects.

CALL FUNCTION 'FLUSH'

EXCEPTIONS

OTHERS = 0.

ENDFORM.

regards,

Divya

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,268

Hi,

Go to program attributes and enable the check box

*UNICODE CHECKS ACTIVE"

10 REPLIES 10
Read only

Former Member
0 Likes
1,269

Hi,

Go to program attributes and enable the check box

*UNICODE CHECKS ACTIVE"

Read only

0 Likes
1,268

its not working.I hv already tried.

give me some other solution....

Read only

0 Likes
1,268

Hi Experts,

any take on this....

I really need solution ASAP.

bye,

Divya

Read only

Former Member
0 Likes
1,268

hi,

Use TCode UCCHECK,Give ur program name and execute .It will show the errors and solution.do accordingly.

Read only

0 Likes
1,268

I hv executed the Tcode UCCHECK with my program and I get the error as " Upload/WS_UPLOAD and Download/WS_DOWNLOAD are obolete since they are not Unicode enabled; use the class cl_gui_frontend_services"

so plz tell me how can I implement this class for WS_DOWNLOAD ?

ASAP

its urgent !!!!!!!

thanks in advance

bye

Read only

0 Likes
1,268

Hi Divya,

Use XXL_FULL_API function module, to download data to a excel file.

Also read the below document, on how to use it.

Parameters of the XXL_FULL_API Function Module

Table Parameters

  • List data DATA, any structure

o Please note that the data table can contain both rows and columns, which are not intended to be used in the list object. You can restrict the rows to be transferred with the parameters DATA_STARTING/ENDING_AT (see below). Which columns are transferred and in which order they are to appear in the list object, is controlled by table SEMA (see also

o Table SEMA ) Please note that the data table must not be transferred empty; it must always contain at least one row.

  • Titles of the vertical keys VKEY

Number of the key column (INT2)

Text (domain SCRTEXT_L)

  • Characteristics of the horizontal keys HKEY

(see also

Table HKEY )

Hierarchy level (INT2)

Number of the column (INT2)

Text (domain SCRTEXT_L)

  • Semantic information SEMA

Column number (INT2)

Type (C 3, value supply)

Standard aggregattion (C 3, value supply)

Origin of the column, i.e. number of the column in DATA (INT2)

Assigned currency column (from Release 2.1B)

  • Printed texts PRINT_TEXT

HeaderFooter (C, value supply: H/F)

LeftCenterRight (C, value supply: L/C/R)

Line number (INT2)

Text (C 60)

  • Online texts ONLINE_TEXT

Line number (INT2)

Key text (domain SCRTEXT_L)

Value text (C 60)

Scalar Input Parameters

  • File name for the list object FILENAME (C 😎

  • Title row HEADER_1 (C 60)

  • Subtitle HEADER_2 (C 60)

  • First row to be transferred in the data table DATA_STARTING_AT (N)

  • Last row to be transferred in the data table DATA_ENDING_AT (N)

o By supplying the parameters DATA_STARTING/ENDING_AT it is possible to identify a range of consecutive lines in the data table. If one of the two parameters does not have its default value, only the range defined by the two values is transferred. Please note that the range to be transferred from the table DATA must not be empty. For the same reason, the data table as a whole must never be empty.

  • No. of V keys N_VRT_KEYS (N)

  • No. of H keys N_HRZ_KEYS (N)

  • No. of attribute columns (i.e. columns in the actual data range) N_ATT_COLS (N)

  • Switch for string conversions SEMA_TYPE (C, value supply: 'blank'/X)

  • Default title for storing the list object in SAPoffice (domain SO_OBJ_DES)

  • Flag to determine the default processing option NO_START (C, value supply: 'blank'/X)

  • Flag to suppress the selection screen NO_DIALOG (C, value supply: 'blank'/X)

o If both NO_DIALOG = u2018Xu2019 and NO_START = u2018Xu2019, the selection screen of XXL is suppressed. The list object will automatically be stored in SAPoffice under the title determined by SO_TITLE (in case SO_TITLE is empty, an artificial title will be created). In every other combination of the two parameters (including the default one), the selection screen will be displayed. In this case, the value in NO_START will only determine which option is given as the default when the selection screen is displayed for the first time, whereas NO_DIALOG will have no effect at all.

o In case XXL_FULL_API is called during background processing, it behaves as if both NO_DIALOG = u2018Xu2019 and NO_START = u2018Xu2019.

Thanks & Regards,

Muthu.

Read only

Former Member
0 Likes
1,268

Hi divya

Try with GUI_DOWNLOAD

Read only

Former Member
0 Likes
1,268

Hi,

I am giving sample code..to replace this function module.

  • CALL FUNCTION 'WS_DOWNLOAD'

  • EXPORTING

  • FILENAME = P_OUTFIL

  • FILETYPE = 'DAT'

  • TABLES

  • DATA_TAB = ITABCOMMA

  • EXCEPTIONS

  • FILE_OPEN_ERROR = 1

  • FILE_WRITE_ERROR = 2

  • INVALID_FILESIZE = 3

  • INVALID_TABLE_WIDTH = 4

  • INVALID_TYPE = 5

  • NO_BATCH = 6

  • UNKNOWN_ERROR = 7

  • GUI_REFUSE_FILETRANSFER = 8

  • OTHERS = 9.

NEW CODE:

DATA: V_FILENAME TYPE STRING.

V_FILENAME = P_OUTFIL.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

FILENAME = V_FILENAME

FILETYPE = 'DAT'

TABLES

DATA_TAB = ITABCOMMA

EXCEPTIONS

FILE_WRITE_ERROR = 1

NO_BATCH = 2

GUI_REFUSE_FILETRANSFER = 3

INVALID_TYPE = 4

NO_AUTHORITY = 5

UNKNOWN_ERROR = 6

HEADER_NOT_ALLOWED = 7

SEPARATOR_NOT_ALLOWED = 8

FILESIZE_NOT_ALLOWED = 9

HEADER_TOO_LONG = 10

DP_ERROR_CREATE = 11

DP_ERROR_SEND = 12

DP_ERROR_WRITE = 13

UNKNOWN_DP_ERROR = 14

ACCESS_DENIED = 15

DP_OUT_OF_MEMORY = 16

DISK_FULL = 17

DP_TIMEOUT = 18

FILE_NOT_FOUND = 19

DATAPROVIDER_EXCEPTION = 20

CONTROL_FLUSH_ERROR = 21

OTHERS = 22.

Instead of GUI_DOWNLOAD, you can use the METHOD from Cl_GuI_Frontendservices => GUI_DOWNLOAD.

If u hav any doubts, please revert back.

Regards

Sandeep Reddy

Read only

Former Member
0 Likes
1,268

Hi,

I gave you the code for WS_DOWNLOAD.

If u exactly tell me wat are the function modules you are using,

I will give you the respective sample code.

ws_upload or?

download or?

upload?............tell me exact one.

Regards

Sandeep Reddy

Read only

Former Member
0 Likes
1,268

dear friend

In a non-Unicode system, the data is read or written without conversion. In a Unicode system, the characters of the file are handled according to the non-Unicode codepage that would be assigned at the time of reading or writing in a non-Unicode system according to the entry in the database table TCP0C of the current text environment.

rewards expected.

vivek srivastava