Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

Converting Errors (type Time) in Excel Class ( cl_fdt_xl_spreadsheet )

$
0
0

Hey everybody,

 

i'm using the  cl_fdt_xl_spreadsheet class (SAP 7.3) to upload an excel sheet (xstring) to an internal table :

 

 

  DATA  lr_excel  TYPE REF TO cl_fdt_xl_spreadsheet.

  DATA  lr_data   TYPE REF TO data.

 

  CREATE OBJECT lr_excel

       EXPORTING

         document_name = ls_file_upload-file_name

         xdocument     = ls_file_upload-file_data.

 

   lr_data = lr_excel->if_fdt_doc_spreadsheet~get_itab_from_worksheet( lv_name ).

 

Now we get the excel sheet as itab in lr_data.

But after some test cases i noticed some issues.

The time changes in some cases wrong:

 

1. The time begins everytime with a whitespace for example: '13:12:00' converts to ' 13:12:00'

2. The time '14:00:00' converts to '13:60:00', '17:00:00' to '16:60:00' (every 3 hour)

3. '00:00:00' converts to '0' or '1900-01-01'

4. 1 second to 9 seconds changes it value to 10 to 90 seconds. That is the biggest problem. For example '13:12:02' converts to '13:12:20'

 

Some issues i can repair, but the issue with the changing seconds i can only fix between 6 and 9 seconds.

 

Does anyone now why this issue occurs ? Converting the time as 'Text' in excel helps, but this is not a possible solution.

Has somebody an idea how i could fix it ?

 

Thank you


Viewing all articles
Browse latest Browse all 8332

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>