Ws_download
WS_DOWNLOAD is OBSOLETE and currently suggested to use
GUI_DOWNLOAD.
(i)Still can we use WS_DOWNLOAD in 4.7, if not why? and
(ii)why its suggested to use GUI_DOWNLOAD in 4.7
thanks,
vamshi
use it
DATA: BEGIN OF E_DATA_TAB, "Estructura del Archivo
LINE(1000) TYPE C. "TYPE STRING.
DATA: END OF E_DATA_TAB.
FORM F_ENVIA_ARCHIVO_ERROR TABLES T_DATA_TAB STRUCTURE E_DATA_TAB
USING P_FILENAME LIKE RLGRAP-FILENAME.
CLEAR V_FILENAME.
IF NOT SY-BATCH IS INITIAL.
*** Abre Archivo
OPEN DATASET P_FILENAME FOR OUTPUT IN TEXT MODE ENCODING NON-UNICODE.
IF sy-subrc NE 0.
IF sy-batch EQ space.
MESSAGE I324(bf00) WITH P_FILENAME.
ELSE.
MESSAGE S324(bf00) WITH P_FILENAME.
ENDIF.
ENDIF.
*** Transfere Archivo para servidor
LOOP AT T_DATA_TAB.
TRANSFER T_DATA_TAB TO P_FILENAME.
ENDLOOP.
*** Cerra Archivo
CLOSE DATASET P_FILENAME.
ELSE.
MOVE P_FILENAME TO V_FILENAME.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = V_FILENAME
TABLES
DATA_TAB = T_DATA_TAB
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 I020 WITH V_FILENAME.
ENDIF.
ENDIF.
ENDFORM. " F_ENVIA_ARCHIVO_ERROR
GUI_DOWNLOAD it does not work in job process its work on line
Similar Messages
-
Filename in gui_download and ws_download
Hi Friends..
if i using like this..
concatenate 'C:\'
syst-date
'.xls'
into mc_filename.
in program and gave the mc_filname as a filename in the function module.its working fine in ws_download but it was not working in gui_download function module.
so please give your valuable suggetion regarding this..
Thanks
GowrishankarHi Gowrishankar,
In WS_DOWNLOAD Function module Filename type is char but
In GUI_DOWNLOAD Function module Filename type is string.
so it is going to dump. first change the type of filename in your program
Plzz reward if it is helpful,
Mahi. -
Gui_download and ws_download
Hi Guys,
What is the difference between <b>gui_download</b> and <b>ws_download</b>.Hi,
WS_DOWNLOAD is an outdate and obselete.
<u><b>Functionality of GUI_DOWNLOAD:</b></u>
File transfer from an internal table on the backend to a file on the
presentation server.
Storing SAP data in a file on the file system of the presentation
server.
The functionality is similar to that of module WS_DOWNLOAD. The
difference is that the DataProvider is used for downloading the data
instead of GMUX.
Example
1.) Binary download (not converted)
begin of itab,
raw(255) type x,
end of itab occurs 0.
CALL FUNCTION 'GUI_DOWNLOAD'
exporting
bin_filesize = 500
filetype = 'BIN'
filename = 'C:\DOWNLOAD.BIN'
tables
data_tab = itab.
loads 500 bytes of internal table itab into the file 'C:\DOWNLOAD.BIN'
on the frontend PC. The data transferred is not converted.
JLN -
WS_UPLOAD,WS_DOWNLOAD and GUI_UPLOAD,GUI_DOWNLOAD.
Hi,
Any one Explain difference between WS_UPLOAD,WS_DOWNLOAD and GUI_UPLOAD,GUI_DOWNLOAD.
Regards,
Mayahi maya,
ws_upload and gui_upload, will do the same funtionality.
ws_download and gui_download will do the same functionality.
but ws* are obsolete.
Regards....
Arun.
Reward points if useful. -
In WS_DOWNLOAD , FILETYPE = 'WK1'
Hi pals,
I am using WS_DOWNLOAD function module in 4.6c, with file type = 'WK1'. i am getting EXCEL(.XLS File) results with out lines(similar to EXCEL SHEET). I need to get excel format(boxes)by using same file type (WK1)
Can any body suggest me.
Thanks in advance.
Balaji.Ok, if you still need a solution. for this. This will work. This program uses the WS_DOWNLOAD function module(as you were) and then uses OLE to open the excel and put the grid lines in. The data is stored on the PC in a temp file, then is save to the real file name after adding the grid lines. The temp file is then deleted from the frontend.
report zrich_0002.
data: it001 type table of t001.
include ole2incl.
data: e_sheet type ole2_object.
data: e_appl type ole2_object.
data: e_work type ole2_object.
data: e_cell type ole2_object.
data: e_borders type ole2_object.
data: tmp_file type localfile value 'C:tmpfile.xls'.
parameters: p_file type localfile default 'C:Test.xls'.
start-of-selection.
select * into table it001
from t001.
call function 'WS_DOWNLOAD'
exporting
filename = tmp_file
filetype = 'WK1'
tables
data_tab = it001.
* Start the application
create object e_appl 'EXCEL.APPLICATION'.
set property of e_appl 'VISIBLE' = 0.
* Open the file
call method of e_appl 'WORKBOOKS' = e_work.
call method of e_work 'OPEN'
exporting
#1 = tmp_file.
get property of e_appl 'Cells' = e_cell.
call method of e_cell 'Select'.
*left
call method of e_cell 'BORDERS' = e_borders exporting #1 = '1'.
set property of e_borders 'LineStyle' = '1'.
set property of e_borders 'WEIGHT' = '2'. "4=max
free object e_borders.
* right
call method of e_cell 'BORDERS' = e_borders exporting #1 = '2'.
set property of e_borders 'LineStyle' = '2'.
set property of e_borders 'WEIGHT' = '2'.
free object e_borders.
* top
call method of e_cell 'BORDERS' = e_borders exporting #1 = '3'.
set property of e_borders 'LineStyle' = '3'.
set property of e_borders 'WEIGHT' = '2'.
free object e_borders.
* bottom
call method of e_cell 'BORDERS' = e_borders exporting #1 = '4'.
set property of e_borders 'LineStyle' = '4'.
set property of e_borders 'WEIGHT' = '2'.
** Close the file
get property of e_appl 'ActiveWorkbook' = e_work.
call method of e_work 'SAVEAS'
exporting
#1 = p_file
#2 = 1. " Don't ask me when closing
call method of e_work 'close'.
* Quit the file
call method of e_appl 'QUIT'.
* Free them up
free object e_borders.
free object e_cell.
free object e_work.
free object e_appl.
* Remove the tmp file from frontend
call function 'WS_FILE_DELETE'
exporting
file = tmp_file.
Please remember to award points for helpful answers and mark you post as solved when your problem is solved completely. Thanks.
Regards,
RIch Heilman -
Hi Guys,
I'm currently changing the programs that uses the obsolete function WS_DOWNLOAD with CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD, and I just want to ask what are the valid FILETYPE for GUI_DOWNLOAD and how can I use a WK1, XLS and DAT filetype in GUI_DOWNLOAD.Hi,
PARAMETERS p_file LIKE rlgrap-filename.
DATA lv_file TYPE string.
lv_file = p_file.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = lv_file
filetype = 'ASC'
write_field_separator = c_x
TABLES
data_tab = i_download
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 ne 0.
MESSAGE i000 WITH text-005. "Error in File downloded
ENDIF.
Instead of 'ASC', you can give 'WK1' or 'XLS' if you want. -
Is there any alternative to GUI_DOWNLOAD other than WS_DOWNLOAD?
Hi All,
Is there any alternative FM other than GUI_DOWNLOAD and WS_DOWNLOAD?I need to download a PDF file to a network drive.
Thanks in Advance,
AnjalyHi,
If u want to download a PDF file from application server...
u can use the transaction... <b>CG3Y</b> directlyy..
just check it and use it in ur program..
cheers,
Simha. -
Any alternative FM for GUI_DOWNLOAD other than WS_DOWNLOAD?
Hi All,
Is there any alternative FM other than GUI_DOWNLOAD and WS_DOWNLOAD?I need to download a PDF file to a network drive.
Thanks in Advance,
Anjalycheck this thread
ITS Upload / Download using CL_GOS_MANAGER
Raja -
Difference between ws_download and gui_download
Hi
Can anyone explain briefly the difference between ws_download and gui_download
Thanks in advance
sapienHai,
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 -
Internal tables in WS_download
HI
i have defined 2 internal tables one for invoice header details
and another for line item details.(both have different details) now i have to download this data to text file in this format
invno1 text....
line1 text...
line2 text..
invno2 text..
line1....
line2...
how to do this? if i use ws_download for 2 tables seperately i am getting following o/p.
invno1 text...
invno2 text....
line1 text...
line2 text....
line1 text....
line2 text...
any one plz help me...Hi Sravanthi,
Create a final internal table with the excat download strucutre and move the corresponding header and item data into it then only we will able to download the data in the required format.
say ur final internal table it_final
loop at header.
mpve-coressponding header to it_final.
loop at item where field1 = header-field1 .(field1 refres to invoice number)
mpve-coressponding item to it_final.
append it_final.
endloop.
endloop.
now call the download function with the it_final internal table -
WS_DOWNLOAD and line item with more than 1024 characters
I want to download a file with line size greater than 1024. I am in version 40B and when i use function module ws_download and it creates two lines instead of one. Is there a solution with another function module or something else?
Hi
Are you trying to download in binary format(filetype BIN) ?. Only binary format has length constraint of 1023 characters. Download in 'ASC' or 'DAT' format.
Also WS_DOWNLOAD is obsolete , use the methods of class CL_GUI_FRONTEND_SERVICES.
Regards
Pawan -
Problem with WS_DOWNLOAD (URGENT)
Hi All,
The WS_DOWNLOAD i am using is downloading the file to workstation SAP GUI640.
But when testing at client's side, It is coming out of the selection screen without download SAP GUI620.
Can any body help please ASAP.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
filename = v_fname
filetype = 'DAT'
TABLES
data_tab = i_csv[]
EXCEPTIONS
file_open_error = 1
file_write_error = 2
invalid_filesize = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
OTHERS = 10.Hi Kaleem,
As discussed, You can try following ..
1. Search on service.sap.com and findout reason. There is a SAP NOTE Explaining Similar Problem.
2. Remove filetype.
Hope it will work,
DARSHAN
**Reward Points if asnwer is helpful -
WS_DOWNLOAD..zero getting suppressed
I am facing a problem.
While extracting data from SAP system (Version 3.1I) and downloading to Excel file using function module WS_DOWNLOAD, the leading zeros are suppressed in numeric field.
But I need to have the leading zeros also in excel file.
If anybody has solution to this problem, please revert back at the earliestactually leading zeroes will be downloaded.but that is the concern with EXCEL. By default, EXCEL will not show any leading zeros for the values in the CELL.
if you open the file in NOTEPAD or any other word document file, you can see the LEADING ZEROS as well.
Regards
srikanth -
Formatting bug of WS_DOWNLOAD?
Hi,
I am using WS_DOWNLOAD to export the ALV list as flat file before it will be displayed. Dynamic table is used so that the file which will be generated will be the same as the ALV list generated. This works. However, when I view the file generated as excel file, the fields which have unit and curr data types with unit are not formatted correctly. For instance, in the ALV list, the field which has a UNIT type displays 15.985,89 but in the excel file, 15985,89 is displayed. For the field which has CURR data type, it displays 119000,000 in ALV. But in excel, 119,000,000 is displayed. Are there any workarounds here?!
Thanks!Hi,
Sorry for the typing error in the last result.
Use GUI_DOWNLOAD inplace of WS_DOWNLOAD with file_type = 'DAT'. This will take care of the Data Type of downloaded Excel File.
Regards
AJAY -
Dot - Comma problem in WS_download --
I have 3 fields in the internal table.
I want to download all those fields in to excel sheet based on the selection screen either dot or comma. I am using ws_download. I want to display all records in left side.
I have declared all 3 fields as characters.
Data: a, b,c type c.
If you select dot all the columns are displaying right side.(perfect)
Now if I select comma all the columns are displaying in right side.
Now I want to display all the records are right side even if its comma or dot.
Pl send me the sample code.HI!
It's not exactly an ABAP problem, but maybe an excel problem.
In ABAP you can remove all dots from a string with the following command:
REPLACE ALL OCCURRENCES OF '.' WITH '' IN column1.
In excel you can declare your cells as a text, or as a number. As text it is always aligned to the cell's left side, as a number it is aligned to the right side.
Select a few cells, then right click on them and choose cell properties.
The algnment of the texts, you can overrule with the manual align buttons (left, right, center...)
Regards
Tamá
Maybe you are looking for
-
How to view multiple files' info in a single window
I remember I can view multiple files' info in a single window before, but now I have to viewed multiple files' info in each their own window. It's very inconvenient to me, I want to get a solution to resolve it. Please do me favor, Many Thanks! Messa
-
Can i installed ios.6 on iphone 3gs
can i installed ios.6 on iphone 3gs
-
Formula field in Bex Query Desingner 7.0
Hi Everyone, I have two columns Accrued and Payment. Accrued is a simple formula and working fine. Payment is little complex basically I am saying if( Date B is greater then 0) then perform Date A is >= Date B then give me value of.... DATE((SU
-
Can't add content to ScrollPane immediatly after attachMovie
Hello, I've successfully attached a clip (identifier = "myPane_mc") which contains a ScrollPane (instance name = "myPane_sp") to the main Timeline from the Library. No problem. attachMovie("myPane_mc","myPane_mc_01",getNextHighestDepth()); However, I
-
Web Start Polluting Windows "Add / Remove Programs" List
I just had to go in and delete 30+ webstart demo programs from my "Add / Remove List". Is there a way to prevent Web Start from doing this?