01-21-2015 12:31 PM
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?
01-21-2015 12:38 PM
Hi Diogo,
Which data type did you use to read time field from FM TEXT_CONVERT_XLS_TO_SAP?
01-21-2015 12:44 PM
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...
01-21-2015 12:47 PM
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.
01-21-2015 1:00 PM
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.
01-21-2015 1:08 PM
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,
01-21-2015 2:48 PM
Hello Archana,
Thank you for the responses.
with this soluiton:
hora_leitura type char8
I get the same output: 0,825196
Doesn't work.
01-21-2015 12:49 PM
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.
01-21-2015 1:02 PM
01-21-2015 1:13 PM
01-21-2015 1:14 PM
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
01-21-2015 2:14 PM
hi diogo,
you have to remove : (colon) from time in the excel sheet.
without colon in time it works perfect. please try.
01-21-2015 2:49 PM
Hello Abdul,
I know, without : it work but i cant remove this from Excel. Must be automatic.
01-21-2015 3:08 PM
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.
01-21-2015 3:21 PM
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"...