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

Upgrade- Download function module

Former Member
0 Likes
688

Hi all,

I am working in an upgrade from 4.6C to ECC 6.0.

I came across one FM which is used in 4.6C.

CONSTANTS C_PRES_SERVER_TEMP_DIR LIKE RLGRAP-FILENAME VALUE 'c:\temp\'.
CONSTANTS C_PRES_FILE_MASK(62)
VALUE ',Data files *.csv  *.dat  *.txt,*.CSV;*.DAT;*.TXT,All files,*.'.
CONSTANTS C_EXCEL(4) VALUE '.xls'.

 CHECK NOT DOWNLOAD IS INITIAL.
  CHECK SY-BATCH = C_FALSE.
  M_SET_DEFAULT 'P' C_PRES_SERVER_TEMP_DIR WA_FILE-NAME C_EXCEL REPID.

  CALL FUNCTION 'DOWNLOAD'
       EXPORTING
*           BIN_FILESIZE        = ' '
*           CODEPAGE            = ' '
*           FILENAME            = ' '
            FILETYPE            = 'DAT'
*           ITEM                = ' '
*           MODE                = ' '
*           FILEMASK_TEXT       = ' '
            FILETYPE_NO_CHANGE  = C_TRUE
*           NO_AUTH_CHECK       = ' '
       IMPORTING
            ACT_FILENAME        = WA_FILE-NAME
            ACT_FILETYPE        = WA_FILE-TYPE
            FILESIZE            = WA_FILE-SIZE
            CANCEL              = WA_FILE-CANCEL
       TABLES
            DATA_TAB            = I_TAB_OUT
*           FIELDNAMES          =
       EXCEPTIONS
            INVALID_FILESIZE    = 1
            INVALID_TABLE_WIDTH = 2
            INVALID_TYPE        = 3
            NO_BATCH            = 4
            UNKNOWN_ERROR       = 5
            OTHERS              = 6.

While passing parameters i am facing difficulty.

Now i am using GUI_DOWNLOAD fm .file name is mandatory.

Under the file name parameter what i had to pass.

And also in the import parameters they passed a lot.

But in the GUI_DOWNLOAD import parameter only FILELENGTH is there.

Regards

Jai

7 REPLIES 7
Read only

former_member191735
Active Contributor
0 Likes
660

Replace function module with method

cl_gui_frontend_services=>gui_download

check documentation on the class as well as in the forum

Read only

Former Member
0 Likes
660

Hi,

Please check the class cl_gui_frontend_services for all file related activities. You can find lots of demo programs for upload and download functionality.

The upload and download FM's will give a pop up for the user to select the file path. Whereas, in gui_* FM's you can directly pass the file path.

Regards,

Nilesh.

Read only

0 Likes
660

Hi ,

The Function module which i posted in that they are not passing the file name as parameter.

But GUI_DOWNLOAD requires the file name as mandatory parameter.

In that case what i had to pass with respective to the parameter file name.

I need the parameters need to pass to GUI_DOWNLOAD with respective to the function module (DOWNLOAD) which i posted.

Hi Any clues from experts

Regards

Jai

Edited by: Jayanth16 on Nov 6, 2009 5:14 PM

Read only

0 Likes
660

>

> Hi ,

>

> The Function module which i posted in that they are not passing the file name as parameter.

> But GUI_DOWNLOAD requires the file name as mandatory parameter.

>

> In that case what i had to pass with respective to the parameter file name.

>

> I need the parameters need to pass to GUI_DOWNLOAD with respective to the function module (DOWNLOAD) which i posted.

>

> Hi Any clues from experts

>

> Regards

> Jai

>

> Edited by: Jayanth16 on Nov 6, 2009 5:14 PM

Just a file name which you can identify. It is a required field in GUI_DOWNLOAD.

Where is it downloading using DOWNLOAD? and what is the file name? Just use the same file name.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
660

Hello Jayanth,

This is because the FM: DOWNLOAD gives you a pop-up for file selection which is not available with GUI_DWONLOAD.

You can do this:

1. Use the FM: GUI_FILE_SAVE_DIALOG or the method CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG (whichever is OK for you).

2. Pass the selected filename to GUI_DOWNLOAD.

I am providing you the algo, for how-to-code SEARCH SDN !!!

BR,

Suhas

Read only

0 Likes
660

Hi Suhas,

That's enough of spoon feeding.

Regards,

Nilesh.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
660

>

> Hi Suhas,

> That's enough of spoon feeding.

>

> Regards,

> Nilesh.

Hello Nilesh,

If you check the OP's query his concern was the param FILENAME in DOWNLOAD is optional, but in GUI_DOWNLOAD it is not.

And no one seemed to address this

I wont call that spoon-feeding.

BR,

Suhas