Application Development 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: 

uploading data into internal table

Former Member
0 Kudos

hi all ,

i;m uploading the file using Function module ALSM_EXCEL_TO_INTERNAL_TABLE . problem now is when i given lower cae in excel it is not taking . when i use upper case then it is taking from excel and putting into internal table . now i need to take records from excel even it is lower case . can u pls suggest how to proceed and help . Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

filename = pa_f

i_begin_col = co_x " column num shd start take as 1

i_begin_row = co_y "row number shd start take based on the heading in excel sheet

i_end_col = co_n13 "end column is 13 here

i_end_row = co_50000 "endrow is 50000 here

TABLES

intern = ta_file

EXCEPTIONS

inconsistent_parameters = 1

upload_ole = 2

OTHERS = 3.

IF sy-subrc EQ 0.

LOOP AT ta_file INTO wa_file.

AT NEW row.

  • Clear the work area

CLEAR wa_file.

ENDAT.

  • Check the Columen numbers and move the file data in to work area of Task.

  • For Column One

IF wa_file-col = '1'.

MOVE wa_file-value TO wa_ztemp_employee-employeid.

ENDIF.

  • For Column Two

IF wa_file-col = '2'.

MOVE wa_file-value TO wa_ztemp_employee-employe_name.

ENDIF.

AT END OF row.

  • The Data Transfer from work area to Internal table

APPEND wa_ztemp_employee TO ta_ztemp_employee.

  • Clear the work area

CLEAR wa_ztemp_employee.

ENDAT.

ENDLOOP.

  • ELSE.

  • MESSAGE e004 DISPLAY LIKE 'I'.

try this code

u will get

Regards

Edited by: Rasheed salman on Nov 28, 2008 6:33 AM

3 REPLIES 3

Former Member
0 Kudos

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

filename = pa_f

i_begin_col = co_x " column num shd start take as 1

i_begin_row = co_y "row number shd start take based on the heading in excel sheet

i_end_col = co_n13 "end column is 13 here

i_end_row = co_50000 "endrow is 50000 here

TABLES

intern = ta_file

EXCEPTIONS

inconsistent_parameters = 1

upload_ole = 2

OTHERS = 3.

IF sy-subrc EQ 0.

LOOP AT ta_file INTO wa_file.

AT NEW row.

  • Clear the work area

CLEAR wa_file.

ENDAT.

  • Check the Columen numbers and move the file data in to work area of Task.

  • For Column One

IF wa_file-col = '1'.

MOVE wa_file-value TO wa_ztemp_employee-employeid.

ENDIF.

  • For Column Two

IF wa_file-col = '2'.

MOVE wa_file-value TO wa_ztemp_employee-employe_name.

ENDIF.

AT END OF row.

  • The Data Transfer from work area to Internal table

APPEND wa_ztemp_employee TO ta_ztemp_employee.

  • Clear the work area

CLEAR wa_ztemp_employee.

ENDAT.

ENDLOOP.

  • ELSE.

  • MESSAGE e004 DISPLAY LIKE 'I'.

try this code

u will get

Regards

Edited by: Rasheed salman on Nov 28, 2008 6:33 AM

0 Kudos

TEXT_CONVERT_XLS_TO_SAP use this function module

this store the data as it there in excel file i think this function module is better then what u r using now

Former Member
0 Kudos

hai..

I think the problem is not with FM.

Check your excel file format once. To do this....

open your excel file.... > click on format in menu bar.... > click on cells .... >

check the category... set it as 'general'.

hope this will solve your problem.

If not then send your code ok

Regards

Sekhar