‎2008 Feb 15 4:59 AM
Hi Gurus,
i have used 'ALSM_EXCEL_TO_INTERNAL_TABLE' to upload data from excel to my internal table t_input.
Now i want to populate the data from the excel to proper fields in this internal table.the fields in excel are price ,amount ( till 7 fields). can u tell me how to put data properly into my internal table having 7 fields.
All relevant replies will be rewarded.
Thanks in advance,
Anand.
‎2008 Feb 15 5:01 AM
‎2008 Feb 15 5:10 AM
Hi Dude,
The key is, the structure of the internal table should match the structure of the excel-file's records.
types: begin of rec,
price type f,
amount type f,
........
end of rec.
data: it_rec type standard table of rec initial size 0 with header line.
See to that the attributes of the it_rec fields match with the
excel file fields records.
Specify it_rec in the TABLES parameter of the internal table.
Regards,
Lakshmanan
‎2008 Feb 15 5:20 AM
data: it_upload type table of ALSMEX_TABLINE.
use the FM 'ALSM_EXCEL_TO_INTERNAL_TABLE' .
contents r stored in row and column format so use the below logic to segregate that into ur intenal table format.
data: it_temp type (internal table with quantity fields.)
SORT it_upload BY row col.
Passing data from it_upload to respective fields of it_temp
LOOP AT it_upload INTO is_upload.
CASE is_upload-col.
WHEN '0001'.
is_temp-plant = is_upload-value.
WHEN '0002'.
is_temp-matnr = is_upload-value.
WHEN '0003'.
is_temp-monat = is_upload-value.
WHEN '0004'.
is_temp-quan = is_upload-value.
ENDCASE.
AT END OF row.
APPEND is_temp TO it_temp.
CLEAR is_temp.
ENDAT.
ENDLOOP.
this code servs ur pupose..
Regards........