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

EXCEL

Former Member
0 Likes
721

hi experts,

how to transfer the data which is in EXCEL sheet using BDC session method.

if it is with DAT file i can able to transfer.

explaine me with example.

thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
691

Hi Surendra,

TRY this FM to do: TEXT_CONVERT_XLS_TO_SAP.

Example:

CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'

EXPORTING

I_FIELD_SEPERATOR = 'X'

I_LINE_HEADER = 'X'

i_tab_raw_data = itab

i_filename = 'C:\My Docs\Testing Files\demo.xls'

tables

i_tab_converted_data = it_student

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.

  • ENDIF.

LOOP AT it_student into it_student_wa.

Write: / it_student_wa-ID, it_student_wa-Name,

it_student_wa-ADDRESS,it_student_wa-STATE,

it_student_wa-CITY.

ENDLOOP.

<b>Kindly Reward points if you found this reply helpful</b>,

Cheers,

Chaitanya.

5 REPLIES 5
Read only

Former Member
0 Likes
691

Use FM,

<b>'ALSM_EXCEL_TO_INTERNAL_TABLE'.</b>

Check this link for sample program.

Regards,

Maha

Read only

0 Likes
691

thanks u mahalakshmi.

Read only

Former Member
0 Likes
692

Hi Surendra,

TRY this FM to do: TEXT_CONVERT_XLS_TO_SAP.

Example:

CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'

EXPORTING

I_FIELD_SEPERATOR = 'X'

I_LINE_HEADER = 'X'

i_tab_raw_data = itab

i_filename = 'C:\My Docs\Testing Files\demo.xls'

tables

i_tab_converted_data = it_student

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.

  • ENDIF.

LOOP AT it_student into it_student_wa.

Write: / it_student_wa-ID, it_student_wa-Name,

it_student_wa-ADDRESS,it_student_wa-STATE,

it_student_wa-CITY.

ENDLOOP.

<b>Kindly Reward points if you found this reply helpful</b>,

Cheers,

Chaitanya.

Read only

0 Likes
691

thanks chaitanya,

where r u from?

Read only

0 Likes
691

i am from orissa