Skip to Content
0
Nov 18, 2013 at 01:18 PM

Using Fn GUI_DOWNLOAD brings message "0 Bytes transferred, codepage 1160"

225 Views

I was scannig database for similar erros but did not find appropriate hints.

Maybe some expert knows a solution. Any suggestion will be appreciated, since I am at the very beginning of ABAP training.

My code is:

TABLES: MARD.

TYPES: begin of it_MARD,

MATNR like MARD-MATNR,

LABST like MARD-LABST,

end of it_MARD.

 

DATA: i_MARD type standard table of it_MARD,

wa_MARD type it_MARD.

 

types truxs_t_text_data(4096) type c occurs 0.

data: csv_converted_table type TRUXS_T_TEXT_DATA.

 

select-options: s_MATNR for MARD-MATNR.

 

select MATNR LABST from MARD into table i_MARD

where MATNR in s_MATNR.

 

* covert datatab into CSV with " " as separator

CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'

EXPORTING

I_FIELD_SEPERATOR = '"'

* seperator is not my choice, but needed by non SAP app.

* I_LINE_HEADER =

* I_FILENAME =

* I_APPL_KEEP = ' '

TABLES

I_TAB_SAP_DATA = I_MARD

CHANGING

i_tab_converted_data = csv_converted_table

EXCEPTIONS

CONVERSION_FAILED = 1

OTHERS = 2.

 

 

IF SY-SUBRC <> 0.

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

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

ENDIF.

 

 

 

*Download of data

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = '.\example.csv'

filetype = 'ASC'

*codepage =

*importing

tables

data_tab = csv_converted_table.