06-24-2014 8:25 AM
Hi,
I am trying to upload file with Kingsoft Spreadsheet using ' ALSM_EXCEL_TO_INTERNAL_TABLE ', 'GUI_UPLOAD',' TEXT_CONVERT_XLS_TO_SAP ' function modules,but data is not getting into internal table.Is t here any function module to upload Kingsoft Spreadsheet file.
Thanks
11-14-2014 12:26 PM
Dear team,
kindly try below function module copy from original to zee program and change as per below:
FM: ALSM_EXCEL_TO_INTERNAL_TABLE
The above funciton module change like this:
CREATE OBJECT application 'Ket.Application'. instead of excel.application.
if any please contact.
regards,
PHANI & SATISH
<private information removed by moderator>
Message was edited by: Manish Kumar
06-24-2014 8:47 AM
11-16-2014 7:05 AM
Dear Manish,
Could you please change the code in ALSM_EXCEL_TO_INTERNAL_TABLE to ZEE programe function module and change the object to KET.applicaiton instead of EXCEL.application.
then try it is working fine.
regards,
satish kumar
11-16-2014 7:38 AM
It is ok. I believe you. It is fundamentally possible to achieve automation using custom development and OLE objects. Copying the FM sped up your development.
06-24-2014 9:28 AM
Hi,
From: http://kingsoft-office.joydownload.com/
"Kingsoft Office is compatible with most of the popular formats like .doc, .docx, .rtf, .txt, .ppt, .pps, .pot, .xls, .xlt, .dbf, .txt, .csv, .xlsx. It supports PDF files, OLE objects and many other interesting formats"
Maybe you thought about it already: Save the Spreadsheet as .xls.
Regards.
06-24-2014 10:11 AM
Hi Eitan,
Even i have save the file in .xls also,but data is not getting into internal table.
Thanks
06-24-2014 10:19 AM
Hi,
Try program Y_R_EITAN_TEST_25_05 (attached) .
Regards.
Saving LibreOffice ods as xlsx file .
06-24-2014 10:25 AM
For xls file use.
DATA: it_type TYPE truxs_t_text_data,
p_file TYPE rlgrap-filename.
* it_upload is the structure of your excel file.
* Uploading the data file into internal table
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_field_seperator = 'X'
i_line_header = 'X'
i_tab_raw_data = it_type
i_filename = p_file
TABLES
i_tab_converted_data = it_upload[]
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. " IF sy-subrc NE 0.
06-24-2014 10:44 AM
Hi Eitan,
I have tried with your code,still not working,In my system MS Office is not there only Kingsoft is there.
Thanks
06-24-2014 11:42 AM
Hi,
Is it possible to save from Kingsoft to xlsx ?
Like I do here in LibreOffice:
Also check the content of it_intern :
Regards.
06-24-2014 1:33 PM
Hi,
Yes i have saved Kingsoft file to XLSX,still not getting.
Thanks
06-24-2014 3:02 PM
06-25-2014 5:34 AM
Hi,
I have tried with both formats XLS,XLSX,but not getting.
Thanks
06-25-2014 5:36 AM
Hi,
Can you upload the XLS version.
Rename the file as .TXT
Regards.
06-25-2014 7:03 AM
06-25-2014 7:08 AM
Sorry but I was not clear enough
I meant upload your Excel to SCN so I will try to figure the problem .
Regards.
06-25-2014 7:26 AM
Hi,
I couldn't able to upload the images for upload file and data in internal table.
Thanks
06-25-2014 7:31 AM
Try rename them with extension of .TXT
Create a sample file < 1.0 MB .
Use advanced editor.
06-25-2014 7:33 AM
06-25-2014 7:39 AM
Please upload the file itself not the picture of the file .
I mean the XLS.
06-25-2014 7:47 AM
06-25-2014 8:02 AM
Hi,
If this is the file created from Kingsoft Spreadsheet using "save as excel file" then I have a surprise for you:
The file is not a native binary excel it is a plain tab separator text file (Try some text editor on the file.)
Function ALSM_EXCEL_TO_INTERNAL_TABLE is for real excel files .
Regards.
06-25-2014 10:24 AM
Hi,
Yes,I have created kingsoft spredsheet and save as in .txt format.That's why it is showing like this.
Thanks
06-25-2014 10:32 AM
Hi,
I ask for the xls .
Can you load this ? I want to see the problem on my machine .
SAP will not allow XLS files so If you use google drive or somthing like that put it there and post the link .
I used this method here:
06-26-2014 5:39 AM
Hi,
How about using the those files as input for sap upload .
You can use the
CALL METHOD cl_gui_frontend_services=>gui_upload and based on the tabs you will have your internal table .
Regards.
06-24-2014 10:33 AM
Hi,
You can refer this.
data : it_raw type truxs_t_text_data,
it_itab type data_table,
wa_itab like line of it_itab.
parameter p_file type rlgrap-filename.
at selection-screen on value-request for p_file.
call function 'F4_FILENAME'
exporting
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = 'P_FILE'
importing
file_name = p_file.
start-of-selection.
call function 'TEXT_CONVERT_XLS_TO_SAP'
exporting
i_field_seperator = 'X'
i_line_header = 'X'
i_tab_raw_data = it_raw
i_filename = p_file
tables
i_tab_converted_data = it_itab
exceptions
conversion_failed = 1
others = 2.
if sy-subrc <> 0.
*MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4
endif.
Loop at it_itab into wa_itab.
"Move work area data to the table in which you want data, and append it.
endloop.
06-24-2014 10:49 AM
Hi Amrutha,
It is working with MS Office xls file not for KingSoft Spreadsheet.
Thanks
11-14-2014 12:26 PM
Dear team,
kindly try below function module copy from original to zee program and change as per below:
FM: ALSM_EXCEL_TO_INTERNAL_TABLE
The above funciton module change like this:
CREATE OBJECT application 'Ket.Application'. instead of excel.application.
if any please contact.
regards,
PHANI & SATISH
<private information removed by moderator>
06-24-2014 1:42 PM
Hi Sai Ganesha,
Please use 'TEXT_CONVERT_XLS_TO_SAP' function module..
Regards,
Venkat.
06-24-2014 1:45 PM
Most SAP standard tools are either able to read flat file type (csv, delimited and the like) or call Excel thru OLE to access the data. If Excel is not installed on your terminal forget this last option, and start finding documentation on OLE functions in Kingsoft application...
or ... look at abap2xlsx. (not yet a standard tool)
Regards,
Raymond
11-14-2014 12:26 PM
Dear team,
kindly try below function module copy from original to zee program and change as per below:
FM: ALSM_EXCEL_TO_INTERNAL_TABLE
The above funciton module change like this:
CREATE OBJECT application 'Ket.Application'. instead of excel.application.
if any please contact.
regards,
PHANI & SATISH
<private information removed by moderator>
Message was edited by: Manish Kumar
11-15-2014 4:36 AM
Hi Phani,
Thanks for your reply,I have copied ALSM_EXCEL_TO_INTERNAL_TABLE to Zfunction module. In where i have to change CREATE OBJECT application 'Ket.Application'. instead of excel.application.
Thanks
11-15-2014 4:51 AM
Dear Ganesh,
if it is working fine, kindly change the status and assign best marks <close discussion by marking correct answer>. This is long pending and new solution we resolved.
regards,
satish kumar
Message was edited by: Manish Kumar