Gui_upload and ws_upload
hi friends,
i have a small doubt i just want to know the difference betweeen
GUI_UPLOAD and WS_UPLOAD which one i have to use.
which function module is useful and most preferred.
regards
srinivas
WS_UPLOAD and WS_DOWNLOAD, the function modules used until now are not part of the standard set of ABAP commands. They are used to display the file interface on the presentation server. WS_UPLOAD and WS_DOWNLOAD are not compatible with USs and have been replaced by GUI_UPLOAD and GUI_DOWNLOAD.
The new function modules, GUI_UPLOAD and GUI_DOWNLOAD, have an interface that also allows you to write Unicode format to the local hard drive. For a description of these interfaces, refer to the documentation for each function module, available under SAP Easy Access " Development " Function Builder " Goto " Documentation.
Similar Messages
-
Difference between GUI_UPLOAD and WS_UPLOAD
Hi,
Please make me clear about the difference between GUI_UPLOAD and WS_UPLOAD. In which cases we need to use these modules...??
Thanks,
SatishI would suggest to always use the GUI_UPLOAD. I say this because this is the function module which is used in the GUI_UPLOAD method of the class CL_GUI_FRONTEND_SERVICES. Really, you should probably use the class/method instead of the function module.
data: filename type string.
filename = p_file.
call method cl_gui_frontend_services=>gui_upload
exporting
filename = filename
filetype = 'ASC'
changing
data_tab = iflatf
exceptions
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
no_authority = 6
unknown_error = 7
bad_data_format = 8
unknown_dp_error = 12
access_denied = 13
others = 17.
Regards,
Rich Heilman -
About UPLOAD, GUI_UPLOAD and WS_UPLOAD
Hello Experts,
What is the difference between UPLOAD, GUI_UPLOAD and WS_UPLOAD function modules. Please send me brief answer about this on following mail id
"[email protected]"
Reward for useful answer
Thanx and regards,
Rahul TaleleI would suggest to always use the GUI_UPLOAD. I say this because this is the function module which is used in the GUI_UPLOAD method of the class CL_GUI_FRONTEND_SERVICES. Really, you should probably use the class/method instead of the function module.
data: filename type string.
filename = p_file.
call method cl_gui_frontend_services=>gui_upload
exporting
filename = filename
filetype = 'ASC'
changing
data_tab = iflatf
exceptions
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
no_authority = 6
unknown_error = 7
bad_data_format = 8
unknown_dp_error = 12
access_denied = 13
others = 17.
Regards,
Rich Heilman -
Diff between gui_upload &? ws_upload
can any one tell me what is the difference between gui_upload and ws_upload.
Hi harish
WS_UPLOAD function module is now obsolete
from 4.7 ,gui_upload is used., this supports OOPs.
check this
WS_UPLOAD and WS_DOWNLOAD, the function modules used until now are not part of the standard set of ABAP commands. They are used to display the file interface on the presentation server. WS_UPLOAD and WS_DOWNLOAD are not compatible with USs and have been replaced by GUI_UPLOAD and GUI_DOWNLOAD.
The new function modules, GUI_UPLOAD and GUI_DOWNLOAD, have an interface that also allows you to write Unicode format to the local hard drive.
Instead of using the function modules, you can use the static methods GUI_UPLOAD and GUI_DOWNLOAD of the global class CL_GUI_FRONTEND_SERVICES.
These classes are used to convert ABAP data from the system format to external formats and vice versa. During this conversion process, character-type data may be converted to another character set, while numeric-type data may be converted to another byte order (or endian format). You must use a container of type X or XSTRING for data in an external format.
Character sets and endian formats are also converted by the file interface (OPEN DATASET with new additions), RFCs, and the function modules GUI_DOWNLOAD and GUI_UPLOAD. The classes described below are available for those special cases where the possibilities offered by conversion are insufficient. Since these classes work with containers of types X and XSTRING, these containers can be copied unconverted by the file interface (OPEN DATASET with new additions), RFCs, and the function modules GUI_DOWNLOAD and GUI_UPLOAD. These classes replace the following two statements:
TRANSLATE c ...FROM CODE PAGE g1 ... TO CODE PAGE g2
TRANSLATE f ...FROM NUMBER FORMAT n1 ... TO NUMBER FORMAT n2
For a detailed description, see the class documentation in the Class Builder. The following classes are available:
CL_ABAP_CONV_IN_CE
Reads data from a container and converts it to the system format. You can also fill structures with data.
CL_ABAP_CONV_OUT_CE
Converts data from the system format to an external format and writes it to a container.
CL_ABAP_CONV_X2X_CE
Converts data from one external format to another.
These classes are used to convert ABAP data from the system format to external formats and vice versa. During this conversion process, character-type data may be converted to another character set, while numeric-type data may be converted to another byte order (or endian format). You must use a container of type X or XSTRING for data in an external format.
Character sets and endian formats are also converted by the file interface (OPEN DATASET with new additions), RFCs, and the function modules GUI_DOWNLOAD and GUI_UPLOAD. The classes described below are available for those special cases where the possibilities offered by conversion are insufficient. Since these classes work with containers of types X and XSTRING, these containers can be copied unconverted by the file interface (OPEN DATASET with new additions), RFCs, and the function modules GUI_DOWNLOAD and GUI_UPLOAD. These classes replace the following two statements:
TRANSLATE c ...FROM CODE PAGE g1 ... TO CODE PAGE g2
TRANSLATE f ...FROM NUMBER FORMAT n1 ... TO NUMBER FORMAT n2
For a detailed description, see the class documentation in the Class Builder. The following classes are available:
CL_ABAP_CONV_IN_CE
Reads data from a container and converts it to the system format. You can also fill structures with data.
CL_ABAP_CONV_OUT_CE
Converts data from the system format to an external format and writes it to a container.
CL_ABAP_CONV_X2X_CE
Converts data from one external format to another.
Minimal demo report for Virus Scan Interface.
For a functionally more complete example see report RSVSCANTEST.
REPORT zvscandemo.
Selection screen
PARAMETERS:
profile TYPE vscan_prof-profile,
file TYPE localfile.
Events
AT SELECTION-SCREEN ON VALUE-REQUEST FOR file.
PERFORM file_f4.
START-OF-SELECTION.
PERFORM main.
Main program
FORM main.
IF file IS INITIAL.
MESSAGE s058(vscan) DISPLAY LIKE 'E'.
EXIT. " =================== EXIT =====================
ENDIF.
Access file and create XSTRING
TYPES:
ty_xline(1024) TYPE x.
DATA:
lf_file TYPE string,
lf_filelength TYPE i,
lt_datatab TYPE STANDARD TABLE OF ty_xline.
lf_file = file.
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = lf_file
filetype = 'BIN'
IMPORTING
filelength = lf_filelength
CHANGING
data_tab = lt_datatab
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
DISPLAY LIKE 'E'
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT. " =================== EXIT =====================
ENDIF.
Recombine binary data
DATA:
lf_tabline TYPE ty_xline,
lf_data TYPE xstring.
LOOP AT lt_datatab INTO lf_tabline.
CONCATENATE
lf_data
lf_tabline
INTO
lf_data
IN BYTE MODE.
ENDLOOP.
lf_data = lf_data(lf_filelength).
Get scanner instance
DATA:
lo_vsi TYPE REF TO cl_vsi.
CALL METHOD cl_vsi=>get_instance
EXPORTING
if_profile = profile
IMPORTING
eo_instance = lo_vsi
EXCEPTIONS
configuration_error = 1
profile_not_active = 2
internal_error = 3
OTHERS = 4.
CASE sy-subrc.
No error.
WHEN 0.
" Nothing to do
Profile not active. For this report, this is an information message.
WHEN 2.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
DISPLAY LIKE 'I'
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT. " =================== EXIT =====================
All other exceptions are issued as errors.
WHEN OTHERS.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
DISPLAY LIKE 'E'
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT. " =================== EXIT =====================
ENDCASE.
Perform virus scan
DATA:
lf_scanrc TYPE vscan_scanrc.
CALL METHOD lo_vsi->scan_bytes
EXPORTING
if_data = lf_data
IMPORTING
ef_scanrc = lf_scanrc
EXCEPTIONS
not_available = 1
configuration_error = 2
internal_error = 3
OTHERS = 4.
All exceptions here are errors
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
DISPLAY LIKE 'E'
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT. " =================== EXIT =====================
ENDIF.
Print return code and text
DATA:
lf_text TYPE string.
lf_text = cl_vsi=>get_scanrc_text( lf_scanrc ).
WRITE: / 'Result of virus scan: ', lf_scanrc, '(', lf_text, ')'.
IF lf_scanrc = cl_vsi=>con_scanrc_ok.
WRITE: / 'File is clean'.
ELSE.
WRITE: / 'File was either infected',
'or could not be scanned',
'or was ignored'.
'Or another problem occurred'.
ENDIF.
ENDFORM.
F4-help for filename
FORM file_f4.
DATA:
lt_filetable TYPE filetable,
lf_rc TYPE i.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
multiselection = abap_false
CHANGING
file_table = lt_filetable
rc = lf_rc
EXCEPTIONS
file_open_dialog_failed = 1
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
DISPLAY LIKE 'E'
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ENDIF.
Number of selected filed must be equal to one.
CHECK lf_rc = 1.
Access selected file
DATA:
ls_file TYPE file_table.
READ TABLE lt_filetable INTO ls_file INDEX 1.
CHECK sy-subrc = 0.
file = ls_file-filename.
ENDFORM. -
Difference of gui_upload and upload
difference of <b>gui_upload</b> and <b>upload</b> and <b>ws_upload</b>
hi
good
There is no difference from functionality point of view.
But when the new versions of SAP comes into picture certain objects(fun modules,tables,fields etc) will become Obsolete and the new Objects will come into picture in the place of Obsolete Fun modules and other objects
So GUI_Upload and GUI_DOWNLOAD are the newversion of function modules which are the replacement for the UPLOAD and DOWNLOAD fun modules
So we should use the New one.
So it depends on the SAP Version on which you are working
If you are still working in the Older versions of SAP like 4.0 like thing then you can use the DOWNLOAD and UPLOAD.
But if you are working on the latest versions like ECC5.0 and ECC6.0 you have to use GUI_download and GUI_UPLOAD fun modules only
reward point if helpful.
thanks
mrutyun^ -
Purpose each of these is: Gui_upload and upload
Hi Friends,
Kindly let me know what the Exact Purpose each of these is: Gui_upload and upload
What is the difference between those two?
Akshitha.Hi,
UPLOAD fm is the old function module which is now obsolete. From 4.6C onwards SAP has delivered new FM's for uploading and that is GUI_UPLOAD.
the diff is UPLOAD pops up a box during runtime to accept the file path the GUI_UPLOAD does not pop up any box during runtime instead takes the path as a paramter.
This is what SAP HELP SAYS
Files on the Presentation Server
WS_UPLOAD and WS_DOWNLOAD, the function modules used until now are not part of the standard set of ABAP commands. They are used to display the file interface on the presentation server. WS_UPLOAD and WS_DOWNLOAD are not compatible with USs and have been replaced by GUI_UPLOAD and GUI_DOWNLOAD.
The new function modules, GUI_UPLOAD and GUI_DOWNLOAD, have an interface that also allows you to write Unicode format to the local hard drive. For a description of these interfaces, refer to the documentation for each function module, available under SAP Easy Access " Development " Function Builder " Goto " Documentation.
Instead of using the function modules, you can use the static methods GUI_UPLOAD and GUI_DOWNLOAD of the global class CL_GUI_FRONTEND_SERVICES.
Cheers
VJ
Message was edited by:
Vijayendra Rao -
What is the difference between UPLOAD and WS_UPLOAD?
Hi,
What is the difference between UPLOAD and WS_UPLOAD?
Best Regards,
GopalHi,
Both upload and ws_upload does the same functionality, that is transfere data from presentation server to application server or from PC to SAP system(to an internal table).
There are very few difference between the two.
1 Upload requires a User Interaction for uploading i.e., user has to respond to the dialog boxes that appear WS_Upload does not. You just need to specify the file location in the function input parameters itself.
2 upload - u can give the file in run time wsupload - u have to give in Function module
3 upload is meant to be used by abappers. ws_upload is meant to be called by SAP. It is not a standard ABAP command.
4 ws_upload is Obsolete : No longer supported by SAP. Use GUI_UPLOAD instead.
The fm WS_UPLOAD was the first version of fm to get a file from presentation server, now from 4.6 it's obsolete, the new fm is GUI_UPLOAD.
The fm UPLOAD is the fm used in several applications, like ABAP editor, to upload the file.
In the some versions (it depends on patch level) UPLOAD can call WS_UPLOAD (or GUI_UPLOAD).
Last but not the least, 'upload' internally calls 'ws_upload', that's the difference.
Hope this would be helpful.
regards,
Varun. -
FM GUI_UPLOAD and GUI_DOWNLOAD.
Hi,
I am new to ABAP world.I hve been given a task to use FM GUI_UPLOAD and GUI_DOWNLOAD.Plz tell me what these functions do , i mean what's there purpose and how to use them in abap code.Plz provide some easy code so that i can understand them properly.
Points will be rewarded for useful answeres.
Thanks.Hi Amardeep,
FM GUI_UPLOAD is used for uploading the file and GUI_DOWNLOAD is used fot downloading the file. For using these FM you need to first create internal table of all fields with character type. While downloading the file, file will be created in exact format of that of internal table and while uploading the file, you need to created the internal table with same structure as that of the original file.
eg:
DATA: BEGIN OF T_DATA OCCURS 0,
SERIAL_NO(18) TYPE C,
COMP1(18) TYPE C,
COMP2(18) TYPE C,
MOTOR1(18) TYPE C,
MOTOR2(18) TYPE C,
CONTROLLER_NO(18) TYPE C,
REF_NO(18) TYPE C,
BODY_NO(18) TYPE C,
PLANT(4) TYPE C,
PROD_VERSION(4) TYPE C,
PROD_DATE(8) TYPE C,
END OF T_DATA.
DATA: BEGIN OF T_ERR_DOWNLOAD OCCURS 0.
INCLUDE STRUCTURE T_DATA.
DATA: MSG(60) TYPE C.
DATA: END OF T_ERR_DOWNLOAD.
SELECTION-SCREEN BEGIN OF BLOCK BK1 WITH FRAME TITLE TEXT-001.
PARAMETERS: P_FLNM LIKE RLGRAP-FILENAME OBLIGATORY MEMORY ID M1.
SELECTION-SCREEN END OF BLOCK BK1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FLNM.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
IMPORTING
FILE_NAME = P_FLNM.
START-OF-SELECTION.
PERFORM UPLOAD_FILE.
PERFORM PREPARE_ITAB.
PERFORM DISP_ERROR.
*& Form UPLOAD_FILE
text
--> p1 text
<-- p2 text
FORM UPLOAD_FILE .
L_FLNM = P_FLNM.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = L_FLNM
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
TABLES
DATA_TAB = T_DATA
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
OTHERS = 17.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " UPLOAD_FILE
*& Form DISP_ERROR
text
--> p1 text
<-- p2 text
FORM DISP_ERROR .
DATA: L_CNT TYPE N.
CLEAR: L_FLNM, L_CNT.
IF NOT T_ERROR[] IS INITIAL.
CONCATENATE 'C:\Barcode\' SY-DATUM '_' SY-UZEIT '.xls' INTO L_FLNM.
DESCRIBE TABLE T_ERROR LINES L_CNT.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = L_CNT
IMPORTING
OUTPUT = L_CNT.
WRITE:/ 'Error occured in ', L_CNT, ' Records'.
SKIP.
WRITE:/ 'Error file:', L_FLNM.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
FILENAME = L_FLNM
FILETYPE = 'ASC'
APPEND = ' '
WRITE_FIELD_SEPARATOR = 'X'
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_ERR_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
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ELSE.
MESSAGE S000 WITH TEXT-008.
ENDIF.
ENDFORM. " DISP_ERROR
**Reward points if useful
Regards,
Archana -
Hi,
I wrote a program which used GUI_UPLOAD functionality. Now the security guy says that this is not allowed as per SOX and we need to find a alternate way for uploading data.
Can you please suggest me what options do I have.
Regards
VijayHi,
you can use ws_upload and upload functional modules.anyways ws_upload became obsolete.so you can try using upload.
regards,
deepthi reddy -
i want to upload some records from the flat file to internal table. when i use GUI_UPLOAD function module in tables parameter i have given the work area. but when i use CL_GUI_FRONTEND_SERVICES-=>FILE_OPEN_DIALOG and then CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD i have given the internal table body in the changing parameters. my doubt is we have used GUI_UPLOAD in both occassions but when we use GUI_UPLOAD alone we are giving the internal table workarea but when we use it along with class CL_GUI_FRONTEND_SERVICES we are giving the internal table body. whats is the reason or logic behind this?.
Hi guys -- the answers you've given are correct but an example IMO is 100% better
go_guiobj type ref to cl_gui_frontend_services., "For Windows file dialog
form load_data using e_file type string
e_table.
field-symbols <int_table> type standard table.
assign e_table to <int_table>.
if go_guiobj is initial.
create object go_guiobj.
endif.
call method go_guiobj->gui_download
exporting
filename = e_file
filetype = 'ASC'
write_field_separator = 'X'
changing
data_tab = <int_table>.
endform
* For Directory look up service (Windows)
at selection-screen
on value-request for p_direct.
search_path = p_direct.
perform directory_lookup using search_path.
if not gv_folder is initial.
p_direct = gv_folder.
endif.
form directory_lookup using directory type string.
if go_guiobj is initial.
create object go_guiobj.
endif.
call method go_guiobj->directory_browse
exporting
window_title = 'Select Directory'
initial_folder = directory
changing
selected_folder = gv_folder.
endform. "directory_lookup
Cheers
jimbo -
GUI_UPLOAD and UNICODE or UTF-8
Hello,
I wanted to convert some files in SAP, i.e. :
- data is processed in MS Excell and saved as Unicode file
- I read the file into SAP, process the strings and write it back
The problem is that there are some special polish characters in the file. I read the file using GUI_UPLOAD FM, but I didn't manage not to have these special characters replaced (by # by default).
Anyone came across this problem before?
Regards,
MichalHello Satya,
Actually I forgot to write that I used the CODEPAGE parameter... I tried two cases:
1. Save as Unicode (in Excel or Notepad) and than use CODEPAGE = "4103"
2. Save as UTF-8 in Notepad and use CODEPAGE = "4110"
In both cases the polish caracters are replaced by '#'.
In fact I tried many other code pages (all from tcp00a), but all other combinations return an error.
Regards,
Michal -
GUI_UPLOAD and OPEN DATASET
Hi,
My code takes data from a file.
I want to have an option of loading file from presentation server as well as application server (in case of background).
For this I am using a checkbox and depending on its value I call the FM GUI_UPLOAD (presentation server) or OPEN DATASET (for app server).
Is this the right approach or there is a single FM available which can be used to upload file in both the scenarios.
Thank you,
CDHi
You're right, I don't believe there's a std fm to do that.
Anyway try to check the function group like C13Z
Max -
Hi,
I want to use GUI_UPLOAD to load an ASCII file with Czech Characters. I try to save my file in .txt format UTF-8. If i read the file with notepad then i have all my characters but when i load in SAP I lost some characters - Who have a solution - I'm in 4.6C - I put in SAPlogon page code 1404 and language CS .
DATA: BEGIN OF f1 OCCURS 0,
altkn(10) TYPE c,
bldat(10) TYPE c, "tt.mm.jj
rart(15) TYPE c,
insert michel
zuonr(18),
xblnr(20) TYPE c,
name1(40) TYPE c,
waers(5) TYPE c,
brutt(13) TYPE c,
fwbtr(13) TYPE c,
faedt(10) TYPE c,
zterm(4) TYPE c,
kunnr(10) TYPE c,
sgtxt(49) TYPE c, => i can find VANĚK
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = pcfil
FILETYPE = 'BIN'
has_field_separator = fsepa
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = 'UTF8'
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = 'X'
IMPORTING
filelength = rc
HEADER =
TABLES
data_tab = f1
EXCEPTIONS
file_open_error = 1
ThanksSame problem - To keep all the accents, i must save in UTF-8 and i have the same problem with gui_upload.I've just seen that my function GUI_UPLOAD in this system (4.6C) is not the same than in 4.7 - Only these parameters for export -
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME =
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = ' '
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
I don't have the possibility to choose the codepage. Perhaps it's the reason ? -
hi all
i am using the function module GUI_UPLOAD in my code , i want to know as this FM takes file from presentation server and uploads it to application server, so on presentation server is thr any relation between OS or any files from OS are related for this FM?
Regards
Martinhi martin,
just try this code which can save ur presentation server file to the application server,
REPORT zbdc_test_open_data_set.
PARAMETERS: file(200) TYPE c.
DATA: BEGIN OF g_itab OCCURS 0,
kunnr TYPE kunnr,
land1 TYPE land1_gp,
name1 TYPE name1_gp.
DATA: END OF g_itab.
SELECT kunnr
land1
name1
FROM kna1
INTO TABLE g_itab.
OPEN DATASET file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
LOOP AT g_itab FROM 1 TO 3.
TRANSFER g_itab TO file.
ENDLOOP.
CLOSE DATASET file.
save and excute..
then go to t.code. al11 ->,
select home in that ->,
find ur file name(which u have given in the parameter input of the report) and double click on that, u can see details of the file..
regards.
seshu... -
Can't we use GUI_UPLOAD and scshedule in background
Hi,
I have a program which uploads a comma delimted text file and updates custom table.
.It works fine in when I run online but when I schedule it background it fails.
I used GUI_UPLOAD to upload the text file.
FORM file_upload.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file
* FILETYPE = 'ASC
* has_field_separator = ',' <-- Comment this
* HEADER_LENGTH = 1
* READ_BY_LINE = 'X'
* IMPORTING
* FILELENGTH =
* HEADER = 'X'
TABLES
data_tab = i_datatab
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.
LOOP AT i_datatab INTO x_datatab .
IF sy-tabix GT '1'.
SPLIT x_datatab-line AT ',' INTO wa_tab-zdate
wa_tab-empid wa_tab-lname wa_tab-fname wa_tab-cycle wa_tab-branch
wa_tab-job wa_tab-phase wa_tab-pdept wa_tab-ptype wa_tab-zhour .
APPEND wa_tab TO i_tab.
ENDIF.
ENDLOOP.fm GUI_UPLOAD will not work in background
you need to use
lv_filename = <input file path> " app server path
open dataset lv_filename for input in text mode encoding default.
if sy-subrc = 0.
do.
read dataset lv_filename into gs_input-wa_string.
if sy-subrc eq 0.
append gs_input to gt_input.
else.
exit.
endif.
enddo.
close dataset lv_filename.
endif.
a®
Maybe you are looking for
-
Hi guys, Regards.We got a requirement: 1).The user inputs the "No. of Days since consumed" and the Customer exit code would calculate the "Result Variable from Current Date" and populate "SLOWMOVDATE". 2).We want the Stockvalue against th
-
Just erased and reinstalled the OS (Tiger OS X v10.4) on my old iBook G4 so I could give a wiped clean laptop to my young son. At the point in the reinstall process where I Select a Wireless Service. When I enter the correct password for my correctly
-
Second MAC computer as remote Airport Speaker for iTunes?
Hello all, On our MacBook, iTunes is playing all our favorites. Does anybody know whether it is possible to set up another Mac in the same Network as a remote speaker for iTunes? I know about AirFoil but I would prefer something like the "client part
-
I just bought a WRT54G and it has already "bricked" :/
I just got this thing a week ago and last night it suddenly stopped working. I rebooted it, everything was fine. About 30 minutes later it freezes again. I reboot it again. This time it lasts about 5 minutes, and after another reboot it comes back wi
-
PRIORITY OF BANK WHILE MAKING PAYMENT-REG
Dear Friends, The details of Bank are being furnished in 1. Vendor Master, 2. In PO and While making the Payment. Which one has got priority while making payment. Thanks and Regards, C.M.SATHISH KUMAR