11-20-2007 11:33 AM
Hi,
I am in Upgrade Project,
The Obsolete FM is UPLOAD
The exporting parameteras are
CodePage = IBM
FileType = BIn.
Then How to Replace this Obsolete FM.
Any Code would be highly appriciated.
Thanks in Advance
SriRam
11-20-2007 11:38 AM
11-20-2007 11:48 AM
I Know that I have to Use GUI_UPLOAD..
But what are the main Parameters to be taken care of ??
Thanks in Advance
Sriram
11-20-2007 11:59 AM
if u r in ecc versions, its always better to avoid function modules.
u will have to go with oops.
go as follows:
call method cl_gui_frontend_services=>gui_upload
exporting
filename = file_name
filetype = 'ASC'
HAS_FIELD_SEPARATOR = ' '
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = SPACE
CODEPAGE = SPACE
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
VIRUS_SCAN_PROFILE =
IMPORTING
FILELENGTH =
HEADER =
changing
data_tab = myexcel[]
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.
handle the sy-subrc part as u want.
lemme know u need any more.
reward, if helpful
11-20-2007 11:50 AM
Hi,
Use this
*--Call the function to get the file into an internal table.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = lv_file
filetype = 'ASC'
TABLES
data_tab = pr_eord
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.
File not found.
MESSAGE e503.
ELSE.
Reward Points
Regards,
Prashant
11-20-2007 2:05 PM
The File Type = BIN in Upload. In GUI_UPLOAD i have to use File Type = 'ASC' ??
Is this Correct ?
11-20-2007 2:06 PM
11-20-2007 12:32 PM
Hi
Check FM GUI_UPLOAD or look this class CL_GUI_FRONTEND_SERVICES
regards
Gregory