11-02-2005 5:44 PM
Hi,
sorry to bore you with this one:
I used METHOD cl_gui_frontend_services=>GUI_UPLOAD to get the contents of an ASCII file into an internal table with records of structure Text1000, (default) FILETYPE = 'ASC'.
My ASCII file was not fully loaded, only line 1 of my internal table got populated, LF not recognized.
I tried WS_UPLOAD with filetype = 'ASC' and got as many records as I really have in File.
I suppose it is something about the line-breaks in the file. It is exported from Navision Axapta and transported via ftp.
Still I don't know why the 'recommended' new method 'GUI_UPLOAD' does not work at all.
Any suggestions?
C.
11-03-2005 3:48 AM
Hi,
Check whether u have passed the parameters correctly
Uploading files from PC(Presentation Server)
There are also a number of other function modules which could be used for uploading/downloding files
between SAP and the presentation server.
* Retrieve data file from presentation server(Upload from PC)
DATA: i_file like rlgrap-filename value '/usr/sap/tmp/file.txt'.
DATA: begin of it_datatab occurs 0,
row(500) type c,
end of it_datatab.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = i_file
filetype = 'ASC'
TABLES
data_tab = it_datatab "ITBL_IN_RECORD[]
EXCEPTIONS
file_open_error = 1
OTHERS = 2.
11-03-2005 3:48 AM
Hi,
Check whether u have passed the parameters correctly
Uploading files from PC(Presentation Server)
There are also a number of other function modules which could be used for uploading/downloding files
between SAP and the presentation server.
* Retrieve data file from presentation server(Upload from PC)
DATA: i_file like rlgrap-filename value '/usr/sap/tmp/file.txt'.
DATA: begin of it_datatab occurs 0,
row(500) type c,
end of it_datatab.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = i_file
filetype = 'ASC'
TABLES
data_tab = it_datatab "ITBL_IN_RECORD[]
EXCEPTIONS
file_open_error = 1
OTHERS = 2.
11-03-2005 6:02 AM
Difference method 'GUI_UPLOAD' and function 'GUI_UPLOAD' is importing parameter.
Function's importing parameter has 'READ_BY_LINE', and default value is 'X'.
But 'READ_BY_LINE' is not parameter of method.
I think Function 'GUI_UPLOAD' default value not effected.
Please, Try Debug...
Thanks.
11-03-2005 8:05 AM
cross check your code
data: wa_file type string.
data: tab_file like table of wa_file,
pcount type i.
field-symbols <tab> type standard table.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES
exporting
DIRECTORY = 'C:\test'
FILTER = '.'
FILES_ONLY = 'X'
DIRECTORIES_ONLY
changing
FILE_TABLE = tab_file
count = pcount.
ASSIGN ('internal_table') TO <tab>.
loop at tab_file into wa_file.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
exporting
FILENAME = wa_file
changing
data_tab = <tab>.
endloop.
regards
11-03-2005 11:04 AM
07-24-2008 9:09 PM