Hi Revanth
Perhaps you could even populate the table structure once off in the same loop as you upload your records from excel instead of populating a structure with type CHAR. I hope i understand your requirement. Please check below:
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = lw_file
i_begin_col = '1'
i_begin_row = '2'
i_end_col = '19'
i_end_row = '9999'
TABLES
intern = it_data_file
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
*...sort table by rows and colums
SORT it_data_file BY row col.
*...get first row retrieved
READ TABLE it_data_file INTO lw_data_file INDEX 1.
*...Set first row retrieved to current row
lv_currentrow = lw_data_file-row.
LOOP AT it_data_file INTO lw_data_file.
*...reset values for next row
IF lw_data_file-row NE lv_currentrow.
lv_currentrow = lw_data_file-row.
ENDIF.
CASE lw_data_file-col.
WHEN lc_0001.
MOVE lw_data_file-value TO lw_data-ekorg.
WHEN lc_0002.
MOVE lw_data_file-value TO lw_data-werks.
ENDCASE.
APPEND lw_data to lt_data.
ENDLOOP.
regards
Prince Isaac