2012 Feb 20 6:25 AM
Experts,
I have an issue with excel upload. I am uploading excel which has a field of length 70. But the FM ALSM_EXCEL_TO_INTERNAL_TABLE has max field length as 50. So is tehre any other way to do this? please help..
Experts,
I have an issue with excel upload. I am uploading excel which has a field of length 70. But the FM ALSM_EXCEL_TO_INTERNAL_TABLE has max field length as 50. So is tehre any other way to do this? please help..
2012 Feb 20 6:44 AM
Hi Friend,
I hope the best way to upload the excel file is to save the file to save it in .CSV format and use GUI_UPLOAD function module to upload the file to itab. Here the field seperatos would be " , " .
I hope this will solve your problem.
NOTE: .CSV file can be created by below mentioned steps.
1).open the excel file.
2). Click on save as button in file menu.
3). In the save dialog box opening, save the file as <filename>.csv . In the file format drop down select (all files . )
4). Now use the FM "GUI_UPLOAD" to move the data from the file to itab.
Significance of this is you can use MS-Excel to create the file but need not worry about number of rows you have or the length of each column.
Please let me know for any questions.
Regards,
Praveenkumar T.
2012 Feb 20 6:52 AM
Hi,
check these links and FMs
'GUI_UPLOAD'
TEXT_CONVERT_XLS_TO_SAP
'KCD_EXCEL_OLE_TO_INT_CONVERT'
<link farm removed>
Edited by: Suhas Saha on Feb 20, 2012 1:06 PM
2012 Feb 20 6:57 AM
HI ,
Split the field length ( two having less than 50 ) and try to upload then concatenate these two.
Regards,
Sijin K P.
2012 Feb 20 7:13 AM
Hi,
Check the bellow link as per your requirement.
Regards,
Goutam Kolluru.
2012 Feb 20 8:40 AM
Hi,
Use Function Module TEXT_CONVERT_XLS_TO_SAP to upload data from excel to itab.
See the example code how to dupload data from excel to itab.
DATA: i_bill TYPE TABLE OF t_bill,
i_bill_line TYPE t_bill.
SELECTION-SCREEN: BEGIN OF BLOCK input WITH FRAME TITLE text-001.
PARAMETERS: p_file TYPE rlgrap-filename.
SELECTION-SCREEN: END OF BLOCK input.
DATA: i_tab_raw_data TYPE truxs_t_text_data.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
CHANGING
file_name = p_file.
START-OF-SELECTION.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_tab_raw_data = i_tab_raw_data
i_filename = p_file
TABLES
i_tab_converted_data = i_bill
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE 'Error while uploading data from excel file' TYPE 'E'.
ENDIF.
If any problem revert back.
Regards,
Supriya.
2012 Feb 20 10:54 AM
What this FM does is quite straightforward, you should be able to copy it into the Z-namespace and adjust it to allow longer field lengths, namely by copying and adjusting structure ALSMEX_TABLINE.
Thomas
2012 Feb 20 11:16 AM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |