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

OPEN DATAST DUMP

Former Member
0 Likes
783

Hi,

i use this code for open dataset and i have dump in bold line

OPEN DATASET file_n FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

LOOP AT it_d INTO wa_it.

TRANSFER wa_it TO file_n.

ENDLOOP.

An exception occurred. This exception will be dealt with in more detail

below. The exception, assigned to the class 'CX_SY_FILE_OPEN_MODE', was not

caught, which

led to a runtime error. The reason for this exception is:

The system tried to access the file "C:\Documents and

Settings\user\Desktop\CSV\xx.TXT" but found that this file was

not opened. For this reason, it could not access the file.

what can be the problem?

Regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
740

You can't download in the local drive, you need to do it in the application server

5 REPLIES 5
Read only

Former Member
0 Likes
741

You can't download in the local drive, you need to do it in the application server

Read only

Former Member
0 Likes
740

For GUI operations, you must use GUI_UPLOAD

DATASET is used to read data from server...While GUI_UPLOAD is used to read data from Application Server.

Greetings,

Blag.

Read only

0 Likes
740

hi alvro ,

Thanks,

i try to write in gui download but the problem is

that when i open the file i have lot of space between rows of table

like line 50 empty rows and after anther line ,

becouse that the file is huge

how i can avoid that?

i think it because of table in bold.

TYPE-POOLS:truxs.

types truxs_t_text_data(4096) type c occurs 0.

DATA: da_tab TYPE truxs_t_text_data.

CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'

EXPORTING

i_field_seperator = ';'

i_appl_keep = 'X'

TABLES

i_tab_sap_data = it_d

CHANGING

i_tab_converted_data = da_tab

EXCEPTIONS

conversion_failed = 1

OTHERS = 2.

CALL METHOD cl_gui_frontend_services=>gui_download

EXPORTING

filename = file_n

filetype = 'BIN'

append = 'X'

codepage = 'UTF-8'

CHANGING

data_tab = da_tab

EXCEPTIONS

file_write_error = 1

no_batch = 2

Regards

Read only

0 Likes
740

CSV is a comma separated excel file?

If yes, you are using BIN in gui_download and should be ASC, is just a text file.

However my excel doesn't open files with ";" as a delimitator, only commas ","

Read only

Former Member
0 Likes
740

hi this is one best solution for writing the file ...

data: outrec(200) type c .

OPEN DATASET P_FILE FOR OUTPUT IN TEXT MODE encoding DEFAULT.

loop at it_final.

outrec+0(8) = it_final-pernr.

outrec+8(40) = it_final-nachn.

outrec+48(40) = it_final-vorna.

outrec+88(30) = it_final-usrid.

outrec+118(40) = it_final-usrid_long.

transfer outrec to p_file.

clear outrec.

endloop.

CLOSE DATASET OUTREC.

regards,

venkat.