'TEXT_CONVERT_XLS_TO_SAP' loads data twice
I am using 'TEXT_CONVERT_XLS_TO_SAP' fm to upload excel data. My excel has 73 lines. This fm is uploading 146 lines into my internal table. It is uploading the data twice.
Interesting part is that later on again I am using the same FM to upload the data and it works fine. That excel has 26 lines.I don't know why it is behaving like this.
here is my code:
DATA: BEGIN OF i_file_data OCCURS 0,
col1 TYPE text30,
col2 TYPE text30,
col3 TYPE text30,
col4 TYPE text30,
END OF i_file_data.
data: i_raw TYPE truxs_t_text_data.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
I_FIELD_SEPERATOR = 'X'
I_TAB_RAW_DATA = i_raw
I_FILENAME = p_file2
I_TAB_CONVERTED_DATA = i_file_data
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.
I am using excalty same code for second excel.
Any Suggestions are appreciated.