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

Call function GUI_DOWNLOAD

Former Member
0 Likes
1,760

hi,

I use the fm 'GUI_DOWNLOAD' to download some information in a file. Now I call the fm in my program:

    CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
      EXPORTING
*      BIN_FILESIZE            =
       FILENAME                =  p_file
       FILETYPE                = 'ASC'

*    IMPORTING
*      FILELENGTH              =
       CHANGING
       DATA_TAB                = tab[]

As importing-parameter I use following tab:

DATA: BEGIN OF st,
       line(1000),
      END OF st.

DATA: tab LIKE standard TABLE OF st WITH HEADER LINE.

Now if I call the fm like:


.....
DATA_TAB             = tab

I get an error. If I call it with "DATA_TAB = tab[]" -> there is no error --> why???

Thanks

markus

1 ACCEPTED SOLUTION
Read only

abdul_hakim
Active Contributor
0 Likes
1,206

because <b>tab</b> means header line not the internal table.

<b>tab[]</b> means internal table.you need to pass the internal table not the header line..

Cheers,

Abdul Hakim

7 REPLIES 7
Read only

Former Member
0 Likes
1,206

Hi,

The size of the field string used in Data_tab is 255 characters and you have declared the tab as 1000 characters. That is the reason for the problem.

Read only

Former Member
0 Likes
1,206

Hi,

U have to use FunctionModule GUI_DOWNLOAD to download data.

hope this helps,

priya

Read only

0 Likes
1,206

Nonsens. Regarding ERP 2005/2004 and Unicode you have to use Methods of the class cl_gui_frontend_services.

Read only

abdul_hakim
Active Contributor
0 Likes
1,207

because <b>tab</b> means header line not the internal table.

<b>tab[]</b> means internal table.you need to pass the internal table not the header line..

Cheers,

Abdul Hakim

Read only

Former Member
0 Likes
1,206

Markus,

That is because you have declared the table with header line. So, just tab means the header line and is nothing a single record. tab[] means the body of the table and that is what is expected in the parameter.

Regards,

Ravi

Note : Please mark the helpful answers

Read only

Former Member
0 Likes
1,206

Hi

when you r passing the parameter as tab the table is not inatializing properly so that you r getting the error but when you are giving as tab[] the table is getting initialized and value is now store in the fields of the table so it is not giving the error.

I hope this will help you to solve your problem.

Thanks

Mrutyunjaya Tripathy

Read only

Former Member
0 Likes
1,206
DATA: ITAB like vbak occurs o with header line.
  CALL METHOD cl_gui_frontend_services=>gui_download
    EXPORTING
      filename              = pc_filename
      filetype              = 'ASC'
      write_field_separator = 'X'
      append                = 'X'
    CHANGING
      data_tab              = ITAB[]
    EXCEPTIONS
      OTHERS                = 1.

Regards

vijay