02-20-2008 12:37 PM
hi,
i am reading an excel sheet having seven fileds out of which 2 of them are price category and price type each of char 1.
the data in the excel sheet has values Quantiity based price(tcode EA90)for price category and block charge and such values for price type.in table epreih 0 1 2 are assigned to price category and in table eprei such char 1 values are assigned to price type.how can i seperate populate these fields in my internal table.
<REMOVED BY MODERATOR>
anand.
Edited by: Alvaro Tejada Galindo on Feb 20, 2008 11:08 AM
02-20-2008 12:46 PM
Hi,
When uploading data from excel sheet, upload into an internal table which has a single field of type STRING.
Now, create an internal table with the required field (one field per column of the excel sheet).
Split the STRING table work area into respective column as follows:
LOOP AT IT_UPLOAD INTO W_UPLOAD.
SPLIT W_UPLOAD-LINE
INTO
w_data-field1
w_data-field2
.
.
.
w_data-field7
AT CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
APPEND w_data TO it_data.
ENDLOOP.
The CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB is the representation of tab/column separator in excel.
Hope this help.
Cheers,
Aditya
02-20-2008 1:23 PM
Declare ur ITAB with all flds as CHAR type of length equal to their Data Elt length