Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

'TEXT_CONVERT_XLS_TO_SAP' loads data twice

Hi,

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.

FORM EXCEL_UPLOAD_MODCASE.

CLEAR I_FILE_DATA.

REFRESH I_FILE_DATA.

CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'

EXPORTING

I_FIELD_SEPERATOR = 'X'

  • I_LINE_HEADER =

I_TAB_RAW_DATA = i_raw

I_FILENAME = p_file2

TABLES

I_TAB_CONVERTED_DATA = i_file_data[]

  • 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.

I am using excalty same code for second excel.

Any Suggestions are appreciated.

Regards,

DNP

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question