cancel
Showing results for 
Search instead for 
Did you mean: 

Upload data from Excel to Itab

Former Member
0 Kudos

Dear All,

Suppose I have data in the form of a matrix and I need to upload the data into the database after validation. The excel sheet is of the format:

Emp Empdept E1 E2 E3 E4 E5 E6 E7 E8 E9

E1 MEC 0 2 3 4 5 6 6 5 7

E2 ELE 4 0 5 5 6 2 2 1 3

E3 ELE 4 4 0 6 1 4 7 8 9

E4 ECE 2 2 4 0 6 7 5 9 4

E5 CHE 7 8 9 5 0 5 6 1 3

E6 ELE 8 9 10 12 11 0 5 6 4

E7 MEC 4 5 4 6 7 6 0 5 7

E8 MEC 9 4 7 5 2 2 8 0 1

E9 ELE 1 5 2 4 2 6 4 6 0

The first column is the employee number

The second column is the employee department and

The matrix indicates the time taken by emplyee1 to be trained to handle position of employee E2 is 2 months (map using row of E1 and column of E2).

Similarly E9 to E8 is 6 months.

I have to get the above data into an internal table of the format

Emp_from Emp_to Duration

E1 E1 0

E1 E2 2

E1 E3 3

E1 E4 4

E1 E5 5

E1 E6 6

E1 E7 6

E1 E8 5

E1 E9 7

E2 E1 4

E2 E2 0

E2 E3 5

Points wil be rewarded.

Regards,

Shiva.

Accepted Solutions (0)

Answers (4)

Answers (4)

jj
Active Contributor
0 Kudos

declare an internal table it_excel with field

EMPno

EMPOdept

E1

E2

E3

E4

E5

E6

E7

E6

upload the data from excel to this internal table.

loop it_excel into wa_excel.

wa_output-emp_from = wa_excel-empno.

wa_output-emp_to = 'E1'.

wa_output-Duration = wa_excel-E1.

append wa_output to it_output.

wa_output-emp_from = wa_excel-empno.

wa_output-emp_to = 'E2'.

wa_output-Duration = wa_excel-E2.

append wa_output to it_output.

wa_output-emp_from = wa_excel-empno.

wa_output-emp_to = 'E3'.

wa_output-Duration = wa_excel-E3.

append wa_output to it_output.

-


-


so on

endloop.

try something like this

Former Member
0 Kudos

Hello shiv,

Use the FM 'TEXT_CONVERT_XLS_TO_SAP', this uploads the data from xls to an internal table.

Try it

Hope it hepls

Former Member
0 Kudos

Hi

Use the FM ALSM_EXCEL_TO_INTERNAL_TABLE.

Thanks

Vijay

PLZ reward pionts if helpful

Former Member
0 Kudos

Hi,

Use the FM <b>ALSM_EXCEL_TO_INTERNAL_TABLE.</b>

Thank you,

Reward points if found useful