‎2007 Jul 30 3:20 PM
Hi,
I am using the FM WS_UPLOAD in 4.6C to upload a txt file.But I am unable to do that .Can someone tell why??
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = VA_FILEPATH
FILETYPE = 'DAT'
HEADLEN = ' '
LINE_EXIT = ' '
TRUNCLEN = ' '
USER_FORM = ' '
USER_PROG = ' '
DAT_D_FORMAT = ' '
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = TB_DATA
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
OTHERS = 10
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
These are the parameters I am passing.
‎2007 Jul 30 3:53 PM
Rich,I have used WS_UPLOAD FM but I am unable to load it into the internal table?
I am giving File Type as DAT.
Message was edited by:
Sneha Singh
‎2007 Jul 30 3:23 PM
‎2007 Jul 30 3:24 PM
Hi Sneha,
Wen you say, you are not able to upload the text file, are you geting any errors or what exactly happens?
‎2007 Jul 30 3:25 PM
check in Debug mode --> whats the value of FILENAME = VA_FILEPATH.
regards
Peram
‎2007 Jul 30 3:25 PM
HI,
is your text file a tab delimited or comma seperated.. ensure that it is tab delimited.. and also ensure that the lenth of the fields in the internal table are correct.
Thanks
Mahesh
‎2007 Jul 30 3:33 PM
the File Path is correct.
I am not getting any error.But its taking some bogus data.
Its a .txt file.I am uploading the data as a dump into the internal table.
What could be the problem?
Message was edited by:
Sneha Singh
‎2007 Jul 30 3:37 PM
Not sure, but you shouldn't be using that function module anyway, use GUI_UPLOAD instead.
report zrich_0002.
data: itab type table of string with header line.
call function 'GUI_UPLOAD'
exporting
filename = 'c:test.txt'
tables
data_tab = itab.
loop at itab.
write:/ itab.
endloop.
Regards,
RIch Heilman
‎2007 Jul 30 3:43 PM
Hi,
if the filename is wrong then Use the following code to search filename before Start-of-selection:
PARAMETERS: p_file TYPE rlgrap-filename DEFAULT text-003,
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_file.
VA_FILEPATH = p_file.
Ashvender
‎2007 Jul 30 3:49 PM
I have to run the upload program in the background.
I saw a note in the net that when we schedule the job in the backgroung we use either WS_UPLOAD or OPEN DATA_SET according to the value of the system variable SY-BATCH.Is it true?
‎2007 Jul 30 3:50 PM
‎2007 Jul 30 3:53 PM
Rich,I have used WS_UPLOAD FM but I am unable to load it into the internal table?
I am giving File Type as DAT.
Message was edited by:
Sneha Singh
‎2007 Jul 30 3:55 PM