01-12-2010 4:15 PM
Hi Experts,
My requirement is to upload a file from presentation server and get the contents into an internal table then I need to update bespoke table based on the values of the internal table. I tried using both funtion module : WS_UPLOAD and GUI_UPLOAD but the data is not getting populated properly to the correct fields of the internal table.
Hence Could you please tell me the pre requisites which needs to be done before uploading the file.I mean the format of the file and the parameters to be passed to the funtion module.
I am also confused with the file extension( i.e of the input file name . Eg. Demo.txt ) with the Filetype ( DAT / BIN/ ASC ) option provided in the funtion modules for upload.
Thanks in advance.
Regards,
Srinivas
01-12-2010 5:44 PM
01-12-2010 4:21 PM
01-12-2010 5:44 PM
01-12-2010 5:59 PM
Satish Boguda - the threads you mentioned are rather old. A better way to upload Excel files is to use FM ALSM_EXCEL_TO_INTERNAL_TABLE
Rob
01-12-2010 8:16 PM
Refer to the program :FILA_HELP_UPLOAD_EXCEL_01/03 if it is excel, otherwise revert back with file format details. based on that I can provide the details or may be a sample code .
thks .
S
01-13-2010 8:09 AM
if it is .txt file follow below steps
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = gv_file
filetype = 'ASC'
TABLES
data_tab = gt_text_file
for this your text file should be
1234|field2| field3|.....
here field seperator is pipe symbol(|)
your internal table must be same as your text file
then use SPLIT command and append your internal table..
LOOP AT gt_text_file INTO wa_text_file.
CLEAR wa_text_table.
SPLIT wa_text_file-line AT gc_pipe INTO wa_text_table-objectid
wa_text_table-lifnr
.......
Append internal table...
endloop.
01-13-2010 11:59 PM
Try using this:
PARAMETERS: P_FILE LIKE RLGRAP-FILENAME OBLIGATORY.
DATA: T_INTERN TYPE STANDARD TABLE OF ALSMEX_TABLINE.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = P_FILE
I_BEGIN_COL = LC_BEGIN_COL " Begin Column in Excel File
I_BEGIN_ROW = LC_BEGIN_ROW " Begin Row in Excel File
I_END_COL = LC_END_COL " End Column in Excel File
I_END_ROW = LC_END_ROW " End Row in Excel File
TABLES
INTERN = T_INTERN
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3.
IF SY-SUBRC NE 0 OR T_INTERN[] IS INITIAL.
STOP.
ENDIF.
Cheers,
Pritam
02-02-2010 1:12 PM
Hi ,
My issue is resolved.I have used the funtion module : WS_UPLOAD and I have used the .Txt file which is of Tab delimited format.then its uploading the data's properly into the Internal table.
Thanks
Srinivas