‎2008 Aug 13 6:43 AM
Hi,
i want to upload the data through excel into sap suggest me with function module,
if there is any error occurs while uploading need to handle and download the errors into excel file.
thanks in advance,
‎2008 Aug 13 6:52 AM
Hi,
for uploading data from excel file...You can go with function module
ALSM_EXCEL_TO_INTERNAL_TABLE
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_file
i_begin_col = 1
i_begin_row = 1
i_end_col = 5
i_end_row = 4
TABLES
intern = t_tab
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.
LOOP AT t_tab.
ASSIGN COMPONENT t_tab-col OF STRUCTURE _mara TO <fs_mara>.
WRITE t_tab-value TO <fs_mara>.
AT END OF row.
APPEND t_mara.
ENDAT.
ENDLOOP.If any errors in the bdc... capture them into table of type BDCMSGCOLL and then download it using
GUI_DOWNLOAD.
regards
padma
‎2008 Aug 13 6:52 AM
Hi,
for uploading data from excel file...You can go with function module
ALSM_EXCEL_TO_INTERNAL_TABLE
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_file
i_begin_col = 1
i_begin_row = 1
i_end_col = 5
i_end_row = 4
TABLES
intern = t_tab
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.
LOOP AT t_tab.
ASSIGN COMPONENT t_tab-col OF STRUCTURE _mara TO <fs_mara>.
WRITE t_tab-value TO <fs_mara>.
AT END OF row.
APPEND t_mara.
ENDAT.
ENDLOOP.If any errors in the bdc... capture them into table of type BDCMSGCOLL and then download it using
GUI_DOWNLOAD.
regards
padma
‎2008 Aug 13 6:53 AM
‎2008 Aug 13 8:02 AM
Hi,
Use 'ALSM_EXCEL_TO_INTERNAL_TABLE' to upload the data from excel format.
and capture the errors into an internal table and download using gui_download.
Hope this helps,
Vijay