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: 

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

0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Rafael Vives,

I had excecuted your above source code after removing the below line.

types truxs_t_text_data(4096) type c occurs 0.

and  its working perfectly by transferring the data from sap system to presentation server .

If you are still facing the problem then it might be because the MATERIAL NUMBER you are selecting does not have data in database table. So, First check data in the SE11 for corressponding table.

3 REPLIES 3

Former Member
0 Kudos

Hi Rafael Vives,

I had excecuted your above source code after removing the below line.

types truxs_t_text_data(4096) type c occurs 0.

and  its working perfectly by transferring the data from sap system to presentation server .

If you are still facing the problem then it might be because the MATERIAL NUMBER you are selecting does not have data in database table. So, First check data in the SE11 for corressponding table.

0 Kudos

Dear Shashank Singhal,

thank you very much for your input.

In fact I tried again with some other input an its working with original coding.

Thus original Code is correct,

but the tested materials did not have stocks.

I had not insisted on trying if I didn´t receive your input.

thankyou very much indeed.

Rafael

0 Kudos

Hi Rafael,

That is the reason one should cross check his code  with multiple enteries and not give up in initial phase.

Best of luck for  your future & keep doing good.