Application Development 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: 

Russian characters are appearing as Garbage in Excel form

Former Member
0 Kudos

Hi All,

I am writing one file program where MBLNR header level & item level data can be written in Excel file.

form header data:-

Код вида операции:531

Дата документа:25.08.2014

first line is movement type and second line is document date. These data is appearing perfectly in excel file.

where as the problem occurs in the following lines

Организация: ÎÎÎ "Êåñêî Ôóä Ðóñ"

company code description ( Ru language ) is appearing as some unknown characters as mentioned above.

Магазин:7M01Ïëàíåðíàÿr. Ñàíêò-Ïåòåðáóðãóë. Ïëàíåðíàÿ, äîì 17 ëèòåð À

Werks details  ( Site name, Site city , Site street )

I am using  Call function 'GUI_DOWNLOAD'

                    EXPORTING

                       FILENAME = lv_filename

                       FILETYPE = 'ASC'

                       CODEPAGE = '1504'                            

                       WRITE_BOM = 'X'                  

                     TABLES

                       DATA_TAB = it_All_Data.

In SNLS transaction, the following has been configured

          Adj. DB according to country    -          Not completely installed

          System language (database)

          Database codepage                  -            Unicode

          Current Codepage of Appl. Server      -   4103

          Codepage of Front End                       -    4110  UTF-8 GUI

My SAPLOGON GUI code page properties :-

   Language - default

   Encoding -  Unicode (UTF-8)

Also one more observation from my side  :-


table TCP00 ( SAP code page catalog ) -

for code page 1504 -  Microsoft Windows 1251 mit kyrillisch ( CP Comment is defined )

Please help me

Regards,

Suman

1 ACCEPTED SOLUTION

Former Member
0 Kudos

This issue got fixed. we should change  regional language settings under control panel in windows.

Regards,

Suman

12 REPLIES 12

Former Member
0 Kudos

try thise


TYPES: BEGIN OF tlist,

          line(260),

          newp,

        END OF tlist.

DATA: glisttxt TYPE tlist OCCURS 0 WITH HEADER LINE      .

****************************

CALL FUNCTION 'ZZGUI_DOWNLOAD'

     EXPORTING

      filename                        = 'C:\1.txt'

      FILETYPE                        = 'ASC'

     TABLES

       data_tab                        = glisttxt

*   FIELDNAMES                      =

    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

             .

   IF sy-subrc <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

   ENDIF.



in my example i am copy GUI_DOWNLOAD in ZZGUI_DOWNLOAD and edit some code


ZZGUI_DOWNLOAD

*******************

* Filetype parameter valid ?

   CASE prc_filetype.

     WHEN 'BIN' OR 'ASC' OR 'DBF' OR 'WK1' OR 'VSS'. "--- New: VSS Format (JB/07-2006)

     WHEN 'ASC'.

       prc_filetype = 'ASC'.

       prc_codepage = '1504'.

     WHEN 'IBM'.

       prc_filetype = 'ASC'.

       prc_codepage = '1251'.

     WHEN OTHERS.

       MESSAGE ID 'FES' TYPE 'E' NUMBER '004' RAISING INVALID_TYPE.

   ENDCASE.


0 Kudos

Hi Sergey,

Actually all the Excel forms ( Zforms)  layouts in "Binary data for Web RFC application" under SMW0 transaction ( SAP Web repository ).

Regards,

Suman

GeorgeShlyakhov
Participant
0 Kudos

Hi Suman,

try to use 1503 codepage. On my project we use it like this:


  CALL FUNCTION 'GUI_DOWNLOAD'

    EXPORTING

      filename                = lv_path

      filetype                = 'ASC'

      codepage                = '1503'

    TABLES

      data_tab                = lt_tax_decl

    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.

ABAP source code in this document was coloured using the ABAP code lighter for SCN.

Best regards,

George Shlyahov

0 Kudos

Hi George

I have passed 1503 code page into GUI_DOWNLOAD FM. But no result.

Excel is showing some other garbage texts as follows

ŽŽŽ "Š¥áª® ”㤠ãá"

actually we are placing all the Z excel forms in SMW0 transaction and calling that z form using

call function ZWWW_OPENFORM

CALL FUNCTION 'ZWWW_OPENFORM'

     EXPORTING

       form_name         = 'Z_FORM1'

       file_name           = fname

       printdialog          = ''

       protect                = ''

       optimize              = 0

       debug_mode        = ''

       decimal_separator = ','

       close_form        = tmp_close_form

       delete_file       = ''

       langu             = lv_langu

     TABLES

       it_values         = it_val

     EXCEPTIONS

       printcancel       = 1

       OTHERS            = 2.



Inside this FM , am calling


Perform OpenForm

     using FILE_NAME

           FileType

           File_Text

           IT_VALUES[]

           OPTIMIZE

           PROTECT

           PRINTDIALOG

           DEBUG_MODE

           DECIMAL_SEPARATOR

           CLOSE_FORM

           DELETE_FILE

           CODEPAGE

           return_code.


here in this routine ,  based on the file type "EXCEL"


again calling one more FM


Call function 'ZWWW_FILLFORM'

         EXPORTING

           DOC       = Docs

           OPTIMIZE  = OPTIMIZE

           FILE_TYPE = FILETYPE

           DEBUG_MODE = DEBUG_MODE

*          CODEPAGE  = CODEPAGE

         TABLES

           IT_VALUES = IT_VALUES.


in this function module , the following code written based on sorting


Case FILE_TYPE.

     when 'EXCEL'.

       If Cnt > Optimize.

         Perform RunExcelMacros

           using <it_SortVal>

                 Doc

                 DEBUG_MODE

                 CODEPAGE.


FORM RUNEXCELMACROS

         USING IT_BOOKMARKS TYPE tt_Values "TABLE

         WORKBOOKS    TYPE OLE2_OBJECT

         DEBUG_MODE

         CODEPAGE.


   DATA:

     FILE_MACROS TYPE RLGRAP-FILENAME,

     MACROSNAME  TYPE RLGRAP-FILENAME,

     FILE_DATA   TYPE RLGRAP-FILENAME,

     WORKBOOK    TYPE OLE2_OBJECT,

     MACROBOOK   TYPE OLE2_OBJECT,

     APP         TYPE OLE2_OBJECT.


   PERFORM DOWNLOADMACROS

     USING IT_BOOKMARKS 'ZWWW_MACROS' CODEPAGE

     CHANGING FILE_MACROS MACROSNAME FILE_DATA.


Inside the DOWNLOADMACROS routine ,  I am using GUI_DOWNLOAD FM as follows :-


IF P_LANGU = 'R'.

     data: lv_filename TYPE STRING.

     lv_filename = FILE_DATA.

     CALL FUNCTION 'GUI_DOWNLOAD'

        EXPORTING

           FILENAME = lv_filename

           FILETYPE = 'ASC'

           CODEPAGE = '1503'                         

        TABLES

           DATA_TAB = it_All_Data

        EXCEPTIONS

           file_write_error        = 1

           no_batch                = 2



Regards,

Suman

0 Kudos

In the it_All_Data , characters are appearing as


For example


In Excel file Russian text for 4th row ( company name , butxt )  are appearing as Garbage 

ŽŽŽ "Š¥áª® ”㤠ãá"


0 Kudos

Hi all,

Please help me to fix this issue.

thanks,

Suman

0 Kudos

Hi, Dear this is not the problem with excel or download function module. Russian language is not fully maintained in your system. Ask your basis consultant to maintain Russian language. if you have problem with numbers and numbers in words then maintain in T015Z table using SAP Note.

Former Member
0 Kudos

Have you tried to use codepage 4103 ?

Regards,

Felipe

0 Kudos

Hi Felipe,

I have already passed 4103 code page in GUI_DOWNLOAD FM.

I got some Visual basic pop-up message during opening Excel

" Run-time error '13"

Type mismatch

one more observation from my side :  In my SAP GUI , language settings maintained as Default

and upload/download encoding maintained as " UNICODE (UTF-8) ".

Regards,

Suman

0 Kudos

Which version of SAP GUI are you using? I remember a similar situation and when the SAP GUI was upgraded to a newer version the issue was solved, maybe you could try.

Regards,

Felipe

0 Kudos

Hi Felipe,

We are using SAP 7.30.

Regards,

Suman

Former Member
0 Kudos

This issue got fixed. we should change  regional language settings under control panel in windows.

Regards,

Suman