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

BDC upload from excel

Former Member
0 Likes
486

Hi Experts,

Please put some light on how to program for a BDC upload from an Excel file using session method and also to capture error records.

Thanks,

Rahul.

3 REPLIES 3
Read only

Former Member
0 Likes
467

Dear Rahul,

for uploading data from excel file use fm 'ALSM_EXCEL_TO_INTERNAL_TABLE'

you will get data into internal table,

error messages will be automatically made in SM35 where you process your session.

reward if it helps,

regards,

Talwinder

Read only

Former Member
0 Likes
467

Upload file from excel to abap prg using 'TEXT_CONVERT_XLS_TO_SAP' this FM

TYPE-POOLS: truxs.

DATA: it_raw TYPE truxs_t_text_data.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

CALL FUNCTION 'F4_FILENAME'

EXPORTING

field_name = 'P_FILE'

IMPORTING

file_name = p_file.

  • Upload Excel file

CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'

EXPORTING

I_FIELD_SEPERATOR =

i_line_header = 'X'

i_tab_raw_data = it_raw

i_filename = p_file

TABLES

i_tab_converted_data = i_XCEL[]

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.

and create session using bdc_open_group, bdc_insert, bdc_close_group.

in sm35 u can run the session and u can analyse the error log,

other wise by using RSBDCSUB u can schedule background run also

Regards

Madhavi

Read only

Former Member
0 Likes
467

Hi ,

Use the FM :ALSM_EXCEL_TO_INTERNAL_TABLE to get the data into internal table from excel. You will get the error log in session log, through program you can not display the errors.

Rajesh.