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

issue using DOWNLOAD

Former Member
0 Likes
504

Hi

my code follows

CALL FUNCTION 'DOWNLOAD'

EXPORTING

FILENAME = 'C:\'

FILETYPE = 'WK1'

FILEMASK_MASK = '*.XLS'

FILETYPE_NO_CHANGE = '0'

TABLES

DATA_TAB = PEND_TAB

EXCEPTIONS

INVALID_TABLE_WIDTH = 2

INVALID_TYPE = 3

NO_BATCH = 4

UNKNOWN_ERROR = 5

GUI_REFUSE_FILETRANSFER = 6

OTHERS = 7 .

It is throwing dump in WS_DOWNLOAD program

What happened?

Error in ABAP application program.

The current ABAP program "SAPLGRAP" had to be terminated because one of the

statements could not be executed.

This is probably due to an error in the ABAP program.

Error analysis

The statement

"DESCRIBE"

contains an argument "<F>" in which only character-type data objects

and not strings (STRING or XSTRING) are allowed.

In this case, the operand "<F>" has the type "P".

383 ASSIGN COMPONENT SY-INDEX OF STRUCTURE DATA_TAB TO <F>

384 IF SY-SUBRC NE 0. EXIT. ENDIF.

385

386 IF SY-INDEX > WK1_MAX_COL. EXIT. ENDIF.

387

>>>>> DESCRIBE FIELD <F> LENGTH SIZE in character mode.

389 DESCRIBE FIELD <F> TYPE TYP.

390 CASE TYP.

391 WHEN 'C'. "// character

392 IF WK1_T_SIZE NE SPACE.

This is standard code. i can not edit, is there any thing

xtra parameters do i need to supply.

Thanks & Regards

Abhimanyu.L

1 ACCEPTED SOLUTION
Read only

dani_mn
Active Contributor
0 Likes
463

HI,

I think in your internal table 'PEND_TAB' there is a field with type string which in not allowed.

Try using 'GUI_DOWNLOAD' which is new FM.

example

<b>

  call method cl_gui_frontend_services=>gui_download

    exporting    filename                = 'C:'
                  WRITE_FIELD_SEPARATOR = 'X'

     changing    data_tab                = itab.

</b>

Regards

4 REPLIES 4
Read only

Former Member
0 Likes
463

Hi,

Pass File name & File type parameter and check, pass the File type parameter with value 'ASC',

Rgds,

Read only

dani_mn
Active Contributor
0 Likes
464

HI,

I think in your internal table 'PEND_TAB' there is a field with type string which in not allowed.

Try using 'GUI_DOWNLOAD' which is new FM.

example

<b>

  call method cl_gui_frontend_services=>gui_download

    exporting    filename                = 'C:'
                  WRITE_FIELD_SEPARATOR = 'X'

     changing    data_tab                = itab.

</b>

Regards

Read only

Former Member
0 Likes
463

FILETYPE = 'WK1'

just comment this line

or it is better that u use <b>gui_download</b> fm.

Read only

Former Member
0 Likes
463

Hi,

The Error is not in DOWNLOAD function module. Chk the describe statment in your code line no 388.

Regards,

Senthil