Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Excel upload to internal table & append data

Former Member
0 Likes
670

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.

3 REPLIES 3
Read only

Former Member
0 Likes
485

HI.

All field 's data type should be Char.

Regards.

Jay

Read only

Former Member
0 Likes
485

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

Read only

Former Member
0 Likes
485

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