Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding Uplod file with Kingsoft Spreadsheet

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

0 Kudos

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

32 REPLIES 32

Former Member
0 Kudos

No there isn't.

0 Kudos

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

0 Kudos

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.

rosenberg_eitan
Active Contributor
0 Kudos

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.

0 Kudos

Hi Eitan,

Even i have save the file in .xls also,but data is not getting into internal table.

Thanks

0 Kudos

Hi,

Try program Y_R_EITAN_TEST_25_05 (attached) .

Regards.

Saving LibreOffice ods as xlsx file .

0 Kudos

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.

0 Kudos

Hi Eitan,

I have tried with your code,still not working,In my system MS Office is not there only Kingsoft is there.

Thanks

0 Kudos

Hi,

Is it possible to save from Kingsoft to xlsx ?

Like I do here in LibreOffice:

Also check the content of it_intern :

Regards.

0 Kudos

Hi,

Yes i have saved Kingsoft file to XLSX,still not getting.

Thanks

0 Kudos

Hi,

What about xls (the older format)

Regards.

0 Kudos

Hi,

I have tried with both formats XLS,XLSX,but not getting.

Thanks

0 Kudos

Hi,

Can you upload the XLS version.

Rename the file as .TXT

Regards.

0 Kudos

Hi,

I want to upload only Excel format only.

Thanks

0 Kudos

Sorry but I was not clear enough

I meant upload your Excel to SCN so I will try to figure the problem .

Regards.

0 Kudos

Hi,

I couldn't able to upload the images for upload file and data in internal table.

Thanks

0 Kudos

Try rename them with extension of .TXT

Create a sample file <  1.0 MB  .

Use advanced editor.

0 Kudos

Hi,

This is my file and data in internal table

0 Kudos

Please upload the file itself not the picture of the file .

I mean the XLS.

0 Kudos

Hi,

Here i am attaching my xls file data in text file.

Thanks

0 Kudos

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.

0 Kudos

Hi,

Yes,I have created kingsoft spredsheet and save as in .txt format.That's why it is showing like this.

Thanks

0 Kudos

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:

For SDN

0 Kudos

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.

Former Member
0 Kudos

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.

0 Kudos

Hi Amrutha,

It is working with MS Office xls file not for KingSoft Spreadsheet.

Thanks

0 Kudos

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>

Former Member
0 Kudos

Hi Sai Ganesha,

Please use  'TEXT_CONVERT_XLS_TO_SAP' function module..

Regards,

Venkat.

raymond_giuseppi
Active Contributor
0 Kudos

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

0 Kudos

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

0 Kudos

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

0 Kudos

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