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: 

frienda problen in bdc any one plz..?

Former Member
0 Kudos

friends ,

can any one tell me how to upload data from excel sheet into an internal table dynamically..plz.very arguent..

regards

varma

1 ACCEPTED SOLUTION

Former Member
0 Kudos

its very simple che3ck out my answer for ur question.whcih i have given earlier..but first u try and then do it..

6 REPLIES 6

former_member386202
Active Contributor
0 Kudos

Hi,

Use FM ALSM_EXCEL_TO_INTERNAL_TABLE

Regards,

Prashant

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

0 Kudos

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..?

Former Member
0 Kudos

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.

Former Member
0 Kudos

its very simple che3ck out my answer for ur question.whcih i have given earlier..but first u try and then do it..