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

GUI_download error

Former Member
0 Likes
2,858

Hi Expert ,

I have the following code in my program:

Types : begin of ty_ascii,

data type string,

begin of ty_ascii.

Data : it_ascii type table of ty_ascii.

it_ascii contains may rows.. but if i want to use gui_downlaod : the fm makes in the file only 1 row

i call the fm like this:

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = wa_filenaam

filetype = 'ASC'

TABLES

data_tab = it_ascii[]

EXCEPTIONS

file_open_error = 1

file_read_error = 2

no_batch = 3

gui_refuse_filetransfer = 4

invalid_type = 5

no_authority = 6

unknown_error = 7

bad_data_format = 8

header_not_allowed = 9

separator_not_allowed = 10

header_too_long = 11

unknown_dp_error = 12

access_denied = 13

dp_out_of_memory = 14

disk_full = 15

dp_timeout = 16

OTHERS = 17.

anybody some suggestions?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,354

CRLF(2) type c.

CRLF = CL_ABAP_CHAR_UTILITIES=>CR_LF.

loop at it_ascii.

concatenate it_ascii-data CRLF into it_ascii-data .

modify it_ascii.

endloop.

Hi Expert ,

I have the following code in my program:

Types : begin of ty_ascii,

data type string,

begin of ty_ascii.

Data : it_ascii type table of ty_ascii.

it_ascii contains may rows.. but if i want to use gui_downlaod : the fm makes in the file only 1 row

i call the fm like this:

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = wa_filenaam

filetype = 'ASC'

TABLES

data_tab = it_ascii[]

EXCEPTIONS

file_open_error = 1

file_read_error = 2

no_batch = 3

gui_refuse_filetransfer = 4

invalid_type = 5

no_authority = 6

unknown_error = 7

bad_data_format = 8

header_not_allowed = 9

separator_not_allowed = 10

header_too_long = 11

unknown_dp_error = 12

access_denied = 13

dp_out_of_memory = 14

disk_full = 15

dp_timeout = 16

OTHERS = 17.

anybody some suggestions?

11 REPLIES 11
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
2,354

Hello,

Can you share the code for populating it_ascii[] ?

BR,

Suhas

Read only

Former Member
0 Likes
2,354

Hi...

check whether wa_filenaam is same type of filename exist in FM. it must be same. otherwise dump will occur.

Regards,

KP.

Read only

Former Member
0 Likes
2,354

HI,

Please try this,

i am getting two records in this................

Types : begin of ty,

data type string,

end of ty.

Data : itab type table of ty.

data: wa type ty.

wa-data = 'adfasfafasd'.

append wa to itab.

clear: wa.

wa-data = 'adfasadfdfasdfafafasd'.

append wa to itab.

clear: wa.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

  • BIN_FILESIZE =

filename = 'D:\new.txt'

FILETYPE = 'ASC'

  • APPEND = ' '

  • WRITE_FIELD_SEPARATOR = ' '

  • HEADER = '00'

  • TRUNC_TRAILING_BLANKS = ' '

  • WRITE_LF = 'X'

  • COL_SELECT = ' '

  • COL_SELECT_MASK = ' '

  • DAT_MODE = ' '

  • CONFIRM_OVERWRITE = ' '

  • NO_AUTH_CHECK = ' '

  • CODEPAGE = ' '

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • WRITE_BOM = ' '

  • TRUNC_TRAILING_BLANKS_EOL = 'X'

  • WK1_N_FORMAT = ' '

  • WK1_N_SIZE = ' '

  • WK1_T_FORMAT = ' '

  • WK1_T_SIZE = ' '

  • WRITE_LF_AFTER_LAST_LINE = ABAP_TRUE

  • SHOW_TRANSFER_STATUS = ABAP_TRUE

  • IMPORTING

  • FILELENGTH =

tables

data_tab = itab

  • 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.

Regards.

Venkatesh.

Read only

Former Member
0 Likes
2,354

Hi Venka,

I trying your code ..i get 1 row in the txt file

Im using a remote desktop connection but i don't think this is the problem.

Read only

Former Member
0 Likes
2,354

Hi,

Make sure that wa_filenaam is of type string.

Suppose there are 2 rows in it_ascii[].

Is both the rows are coming in file but in single row?

In this case append some CR/LF character at the end of each row in it_ascii[].

And in FM give WRITE_LF = 'X'.

Hope it helps u.

Read only

0 Likes
2,354

wa_filenaam is of type string.

Suppose there are 2 rows in it_ascii[].

Yes both the rows are coming in file but in single row.

I also tried write_lf = 'X'

but stil it doenst help.

Read only

0 Likes
2,354

But have you appended CR/LF character at end of each row?

Read only

0 Likes
2,354

Can you please explain how to append CR/LF character at end of each row?

Read only

Former Member
0 Likes
2,355

CRLF(2) type c.

CRLF = CL_ABAP_CHAR_UTILITIES=>CR_LF.

loop at it_ascii.

concatenate it_ascii-data CRLF into it_ascii-data .

modify it_ascii.

endloop.

Read only

0 Likes
2,354

It works thanks.

Read only

0 Likes
2,354

Please, check the note 1008705.

I had the same problem and I solved installing a new patch for SAP GUI.

Regard,

Anderson.