12-05-2007 8:00 AM
friends ,
can any one tell me how to upload data from excel sheet into an internal table dynamically..plz.very arguent..
regards
varma
12-31-2007 12:18 PM
its very simple che3ck out my answer for ur question.whcih i have given earlier..but first u try and then do it..
12-05-2007 8:03 AM
12-05-2007 8:03 AM
Hi,
You can use Function module,
TEXT_CONVERT_XLS_TO_SAP,
ALSM_EXCEL_TO_INTERNAL_TABLE,
to get the data from excel to internal table,
Regards,
Samson Rodrigues.
12-05-2007 8:17 AM
Hi,
Try using this FM for getting the excel file value to internal table ...I have givent he code below use this type it will work.
INCLUDE BDCRECX1.
START-OF-SELECTION.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = 'C:\xl1.XLS'
I_BEGIN_COL = c1
I_BEGIN_ROW = r1
I_END_COL = ce
I_END_ROW = re
TABLES
INTERN = ITAB1
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
******************
Else try this FM also
********************
TYPE-POOLS: truxs.
DATA: it_raw TYPE truxs_t_text_data.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
I_FIELD_SEPERATOR =
i_line_header = 'X'
i_tab_raw_data = it_raw
i_filename = p_file1
TABLES
i_tab_converted_data = it_itab
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Thanks,
Sakthi
12-05-2007 9:15 AM
hai sakthi what ur cpassing for begin of column and end of column > what are those ce and re..? plz i want inmportantly that one ..plz reply soon..?
12-05-2007 11:42 AM
Hello,
To upload the Excel sheet data to internal Table will be done thru FM
ALSM_EXCEL_TO_INTERNAL_TABLE.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = 'file Path' type rlgrap-filename
i_begin_col =start col
i_begin_row =
i_end_col =
i_end_row =
tables
intern = ITAB
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
will work successfully.
Regards,
Srinivas.
12-31-2007 12:18 PM
its very simple che3ck out my answer for ur question.whcih i have given earlier..but first u try and then do it..