cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP Webdynpro: Showing Junk while Downloading Japanese character to Excel

Former Member
0 Kudos

Hi All,

Can anyone tell me the exact procedure to download the Japanese characters into excel in ABAP WEBDYNPRO. Highly appreciate your feedback.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I have got the answer, we need to pass MIME TYPE  'APPLICATION/MSEXCEL; charset=utf-16le' and add 'FFFE' in starting of hexadecimal output that we get after processing  function module SCMS_STRING_TO_XSTRING

code is as below:

CALL FUNCTION 'SCMS_STRING_TO_XSTRING'

       EXPORTING

         text     = text

         mimetype = lv_mimetype

*     encoding = lv_encoding

       IMPORTING

         buffer   = lv_report_xstr

       EXCEPTIONS

         failed   = 1

         OTHERS   = 2.

     IF sy-subrc = 0.

       CONCATENATE cl_abap_char_utilities=>byte_order_mark_little

       lv_report_xstr

       INTO lv_report_xstr IN BYTE MODE.

     ENDIF.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Avinash,

Refer this : http://scn.sap.com/thread/843382

Thanks

Katrice

Former Member
0 Kudos

Hi katrice,

Thanks for your response, though i had already read the link that you have provided before posting my question on SCN.

In the link, they have discussed a temporary solution where user has to go to three manual steps to see the japanese characters.

Also, in SAP ABAP(not webdynpro) Its easily possible by passing encoding 4103 and file type ASC to FM GUI_DOWNLOAD.

I need this solution in webdynpro ABAP. I have tried passing different encoding but with no success. Any help or suggestion will be highly appreciated.

Anyways thanks once again Katrice.

PS: My code is pasted below

   CALL FUNCTION 'SCMS_STRING_TO_XSTRING'

     EXPORTING

       text   = lv_report_str

      encoding = lv_encode

     IMPORTING

       buffer = lv_report_xstr.

cl_wd_runtime_services=>attach_file_to_response(    i_filename  = lv_filename

                                                                              i_content   = lv_report_xstr

                                                                              i_mime_type = 'EXCEL' ).