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: 

TEXT_CONVERT_XLS_TO_SAP FM upload time cell format

0 Kudos

Hello Guys,

I am having issue where the FM TEXT_CONVERT_XLS_TO_SAP, don´t upload time cells correct from EXCEL.


The Excel Cell have for example: 19:48:17


After execute de FM TEXT_CONVERT_XLS_TO_SAP my the output is : 0,825196


Can u help?



14 REPLIES 14

archanapawar
Contributor
0 Kudos

Hi Diogo,

Which data type did you use to read time field from FM TEXT_CONVERT_XLS_TO_SAP?

0 Kudos

Hello Archana,

Im calling the FM this way:

call function 'TEXT_CONVERT_XLS_TO_SAP'

     exporting

*     I_FIELD_SEPERATOR    =

       i_line_header        = abap_true

       i_tab_raw_data       = l_t_tab_raw

       i_filename           = l_wr_file

     tables

       i_tab_converted_data = t_table_imp[]

     exceptions

       conversion_failed    = 1

       others               = 2.


My internal table t_table_imp gets this value 0,825196 instead 19:48:17.


All other cells are upload to internal table correctly unless this one...

0 Kudos

Hi Diogo,


Can you post your internal table t_table_imp declaration as well? I think there might something wrong with the field data type.

0 Kudos

Hello Archana,

I have this declaration:

data:

   begin of it_contadores occurs 0" Tabela Final BAPI

     matricula       type license_num,

     data_leitura    type sy-datum,

     "hora_leitura    type IMRG-ITIME,

     hora_leitura    type SY-UZEIT,

     leitura_kms     type imrc_cntrc,

     leitura_comb    type imrc_cntrc,

     leitura_val_liq type rimr0-recdc,

   end of it_contadores,


The field is hora_leitura. I try with  IMRG-ITIME and SY-UZEIT, both dont work.

0 Kudos

Hi Diogo,

As you can see the data type is 6 chars and it should be in format as displayed below:

Data Type : TIMS - Time field (hhmmss)

So, you should change your table field to char8 instead of IMRG-ITIME.

hora_leitura    type char8,

0 Kudos

Hello Archana,

Thank you for the responses.

with this soluiton:

hora_leitura    type char8


I get the same output: 0,825196


Doesn't work.

Former Member
0 Kudos

Hi Diogo,

In Excel adjust the cell of time field by doing formatting cell and select the format as hh:mm:ss

So that it would give correct values in the output.

Regards,

Chakradhar.

0 Kudos

Hello Chakri,

I already have that format:

former_member228514
Participant
0 Kudos

Even i feel check data type of time field.

VenkatRamesh_V
Active Contributor
0 Kudos

Hi,

Try,

Enter the time with   ' ' '   as like  19':48:'40 in Excel sheet.

After getting itab remove the    ' ' '   the using split statement.

Hope it helpful.

Regards,

Venkat.V

Former Member
0 Kudos

hi diogo,

you have to remove : (colon) from time in the excel sheet.

without colon in time it works perfect. please try.

0 Kudos

Hello Abdul,

I know, without : it work but i cant remove this from Excel. Must be automatic.

0 Kudos

Hello, thank your for posting.

I need to add ' before the value on Excell Cell like: '19:48:17 and import is correct.

Thanks a lot for your time and help.

Tomas_Buryanek
Active Contributor
0 Kudos

Type in SAP should be type T (sy-uzeit or so..).

Try debugg include LTRUXF01 - FORM: parse_table_line.

Breakpoint on:


perform input_data2sap_data using l_table-value

                                 changing <fs_struc_data> sy-subrc.

In l_table-value you should have value from excel. Then check what happens in that perform above.

It should identify field type as T and call function CONVERT_TIME_INPUT. Which has no problem converting excel value "19:48:17"...

-- Tomas --