Application Development 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: 

Difference between ws_download and gui_download

Former Member
0 Kudos

Hi

Can anyone explain briefly the difference between ws_download and gui_download

Thanks in advance

sapien

14 REPLIES 14

Former Member
0 Kudos

both are same but ws_download is obsolete and gui_download is the one whicj is used now

Former Member
0 Kudos

Hi,

WS_DOWNLOAD is obsolete now,its recommended to use CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD(when background processing is required)

For your info:

GUI_* and WS_* function modules do not work in background

Chk this link for some sample programs:

http://www.sapdevelopment.co.uk/file/file_updown.htm

Regards,

Anjali

0 Kudos

Hi ,

the difference is ws_* is used in Older versions. and also it is Obsolete. so you should go For GUI_* or

CL_GUI_FRONTEND_SERVICES=>GUI_UP/DOWNLOAD methods.

Regards

vijay

Former Member
0 Kudos

Hai,

in ws_download is Obsolete in Higher Versions

file type is as follows

PARAMETERS: P_FILE LIKE RLGRAP-FILENAME. "local file with contracts

CALL FUNCTION 'DOWNLOAD'

EXPORTING

FILENAME = ' '

FILETYPE = I_TYPE

TABLES

DATA_TAB = T_DOWNLOAD

EXCEPTIONS

INVALID_FILESIZE = 1

INVALID_TABLE_WIDTH = 2

INVALID_TYPE = 3

NO_BATCH = 4

UNKNOWN_ERROR = 5

GUI_REFUSE_FILETRANSFER = 6

OTHERS = 7.

in gui_download -->is using instead of 'ws_upload'

file type is as follows

PARAMETERS: P_FILE LIKE STRING. "local file with contracts

DATA: D_FILENAME TYPE STRING,

D_FILEPATH TYPE STRING,

D_FULLPATH TYPE STRING,

L_FILETYPE TYPE CHAR10.

IF L_FILETYPE = 'ASC'.

L_FILETYPE = 'ASC'.

ELSE.

L_FILETYPE = 'DAT'.

ENDIF.

CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG

  • EXPORTING

  • WINDOW_TITLE =

  • DEFAULT_EXTENSION =

  • DEFAULT_FILE_NAME =

  • FILE_FILTER =

  • INITIAL_DIRECTORY =

  • WITH_ENCODING =

  • PROMPT_ON_OVERWRITE = 'X'

CHANGING

FILENAME = D_FILENAME

PATH = D_FILEPATH

FULLPATH = D_FULLPATH

  • USER_ACTION =

  • FILE_ENCODING =

EXCEPTIONS

CNTL_ERROR = 1

ERROR_NO_GUI = 2

NOT_SUPPORTED_BY_GUI = 3

others = 4

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

IF NOT D_FULLPATH IS INITIAL.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

  • BIN_FILESIZE =

FILENAME = D_FULLPATH

FILETYPE = L_FILETYPE

  • 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 = ' '

  • IMPORTING

  • FILELENGTH =

TABLES

DATA_TAB = T_DOWNLOAD

  • 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

Former Member
0 Kudos

Please explain how to use cl_gui_frontend services,

I didn't find the difference between gui_download and cl_gui... I observered in that class-gui_download method contains same function module 'gui_download'.

Thanks

sapien

0 Kudos

Hi,

Its just the object oriented way of handling gui_download.

Regards,

Tanveer.

Former Member
0 Kudos

HI

GOOD

GUI_DOWNLOAD=>

GUI_DOWNLOAD Replaces WS_DOWNLOAD. Download table from the app server to presentation server

WS_DOWNLOAD=>

WS_DOWNLOAD Save Internal Table as File on the Presentation Server

EXAMPLE->

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

FILENAME = 'C:\Errors.Txt'

FILETYPE = 'ASC'

TABLES

DATA_TAB = E_INT_0015.

THANKS

MRUTYUN

0 Kudos

HI Tripaty,

I hope your statement about ws_download is wrong.

Both function modules are used for downloading data to presentation servers from internal table.

But ws_download is obsolete as the versions are upgraded.

Former Member
0 Kudos

I'm working with Unicode system I need to use cl_gui...instead of ws_upload.(filename, itab).

Please provide an idea how to it

thanks

0 Kudos

OK try the following..


  data: t_filetable type filetable,
        w_filetable like file_table-filename,
        w_subrc     type i.
  data: w_filename type string.
  constants: c_asc type char10 value 'ASC'.

  constants: c_title type string value 'Choose File'.       "#EC NOTEXT
  call method cl_gui_frontend_services=>file_open_dialog
    exporting
      window_title            = c_title
    changing
      file_table              = t_filetable
      rc                      = w_subrc
    exceptions
      file_open_dialog_failed = 1
      cntl_error              = 2
      error_no_gui            = 3
      not_supported_by_gui    = 4
      others                  = 5.

  case sy-subrc.
    when 0.
      read table t_filetable index 1 into w_filetable.
      move w_filetable to p_file.
  endcase.
  w_filename = p_file.
  call method cl_gui_frontend_services=>gui_download
    exporting
      filename                = w_filename
      filetype                = c_asc
    changing
      data_tab                = itab "your data tabe
    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
      not_supported_by_gui    = 17
      error_no_gui            = 18
      others                  = 19.
 

Regards,

Suresh Datti

Former Member
0 Kudos

Hi,

the basic difference is in one the parameters are defined in runtime while in the other they are defined in the function module.

for gui_download, the file name anf file type paramteres are passed during the runtime. they are not exported in the function module while in the ws_download, these two parameters need to be passed.

Regards

Aswin

0 Kudos

Which method or function module works in background? I've tried SCMS_DOWNLOAD, WS_DOWNLOAD and GUI_DOWNLOAD but doesn't work in background. Any sugestions?

0 Kudos

Any of this will not work in background. For background mode you need to use syntax


OPEN DATASET l_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

Please make a search before posting..

0 Kudos

Please don't bump old threads (unless there is a valid reason to do so) and use the search first if you suspect that the question has been asked before.

Thanks,

Julius