2008 Jul 04 7:50 AM
hi,
i am facing a problem with function module GUI_UPLOAD.
when i am trying to upload a excel file using gui_upload,the data that gets uploaded to internal table is garbage (contains # etc)..
what can be the reason.
shailendra.
2008 Jul 04 7:52 AM
Try using these FMs
ALSM_EXCEL_TO_INTERNAL_TABLE instead of GUI_UPLOAD..
OR
'FAA_FILE_UPLOAD_EXCEL'
OR
'TEXT_CONVERT_XLS_TO_SAP'
Reward If helpful
Edited by: Sachin Mathapati on Jul 4, 2008 12:22 PM
hi,
i am facing a problem with function module GUI_UPLOAD.
when i am trying to upload a excel file using gui_upload,the data that gets uploaded to internal table is garbage (contains # etc)..
what can be the reason.
shailendra.
2008 Jul 04 7:52 AM
Try using these FMs
ALSM_EXCEL_TO_INTERNAL_TABLE instead of GUI_UPLOAD..
OR
'FAA_FILE_UPLOAD_EXCEL'
OR
'TEXT_CONVERT_XLS_TO_SAP'
Reward If helpful
Edited by: Sachin Mathapati on Jul 4, 2008 12:22 PM
2008 Jul 04 9:41 AM
Hi,
i think u can't use GUI_UPLOAD when ur calling xl file
on that time u have to use ALSM_EXCEL_TO_INTERNAL_TABLE .
and loop every field into ur internal table field
2008 Jul 04 9:47 AM
Hi ,
see the below codes...hope this will be helpfull to u.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = p_file.
DATA : l_filename LIKE rlgrap-filename,
l_begin_col TYPE i VALUE 1,
l_end_col TYPE i VALUE 10,
p_row_fr TYPE i VALUE 2,
p_row_to TYPE i VALUE 10000.
l_end_row type i value 10.
l_filename = p_filenm.
*Read the records from the file exporting number of rows and columns
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = l_filename
i_begin_col = l_begin_col
i_begin_row = p_row_fr
i_end_col = l_end_col
i_end_row = p_row_to
TABLES
intern = it_file
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE e899 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
reward points if helpfull.
Thanks & Regards,
Y.R.Prem Kumar
2008 Jul 04 10:01 AM
Hey !!
Use this function module.
ALSM_EXCEL_TO_INTERNAL_TABLE
Regards
Abhijeet Kulshreshtha
2008 Jul 04 11:17 AM
hi check this..
REPORT ZTESTPROG003.
TYPES:
BEGIN OF ty_upload,
matnr like mara-matnr,
meins like mara-meins,
mtart like mara-mtart,
mbrsh like mara-mbrsh,
END OF ty_upload.
DATA it_upload TYPE STANDARD TABLE OF ty_upload WITH header line.
DATA wa_upload TYPE ty_upload.
DATA: itab TYPE STANDARD TABLE OF alsmex_tabline WITH header line.
DATA itab TYPE STANDARD TABLE OF ty_upload WITH header line.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = 'C:\Documents and Settings\venkatapp\Desktop\venkat.xls'
i_begin_col = 1
i_begin_row = 1
i_end_col = 4
i_end_row = 65535
TABLES
intern = itab.
if not itab[] is initial.
loop at itab .
case itab-col.
when '0001'.
it_upload-matnr = itab-value.
when '0002'.
it_upload-meins = itab-value.
when '0003'.
it_upload-mtart = itab-value.
when '0004'.
it_upload-mbrsh = itab-value.
append it_upload.
clear it_upload.
clear itab.
endcase.
endloop.
endif.
loop at it_upload.
write:/ it_upload-matnr,it_upload-meins,it_upload-mtart,it_upload-mbrsh.
endloop.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |