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: 

BDC method (excel file row and colums are not constant_

Former Member
0 Kudos

Hi Experts,

I am uploading data from flat file to sap application by using bdc method. My flat file is in excel format.

Now my problem is the no. of rows and cloums are not constant in my excel file.when i am using ALSM_EXCEL_TO_INTERNAL_TABLE functional module i need to pass values to i_begin_col, i_begin_row, i_end_col and i_end_row parameters.how can i change the no.of rows and colums dynamically in my program based on exel file.

will you suggest me with coding.

Thanks in advance,

Mythily

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Mythily,

Use Function Module TEXT_CONVERT_XLS_TO_SAP for uploading excel file.

It doesnt have any parameters to restrict the size of excel file.

Hope it resolves ur problem,

Pratik Vora

7 REPLIES 7

Former Member
0 Kudos

Hi Mythily,

I think no of column should be constant but you may have no. of row variable in that case you can assign max rows there.

there will not be any problem.

i_begin_col = '1'

i_begin_row = '1'

i_end_co = Any number

i_end_row = '65000'

Feel free to ask if any doubt.

Regards,

Vijay

0 Kudos

Hi,

i_end_co = Any number

i_end_row = '65000'

i_end_row is not constant in my flat file.The flat file may consists 1000 or 2000 or 3000 etc. rows.

0 Kudos

link:[Upload excel to itab|http://www.sapdb.info/abap-programs-upload-excel-to-internal-table/]

0 Kudos

hi

i am uplaoding the data by using ALSM_EXCEL_TO_INTERNAL_TABLE functional module.but this F.M

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

filename = p_file

i_begin_col = 1

i_begin_row = 2

i_end_col = 18

i_end_row = 5000

TABLES

intern = i_exceltab

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.

but here i am getting sy-subrc check 2 means upload_ole = 2

what is my mistake exactly. what to do to rectify it.

Former Member
0 Kudos

Hi Mythily,

I think no of column should be constant but you may have no. of row variable in that case you can assign max rows there.

there will not be any problem.

i_begin_col = '1'

i_begin_row = '1'

i_end_co = Any number

i_end_row = '65000'

Feel free to ask if any doubt.

Regards,

Vijay

Former Member
0 Kudos

Hi Mythily,

Use Function Module TEXT_CONVERT_XLS_TO_SAP for uploading excel file.

It doesnt have any parameters to restrict the size of excel file.

Hope it resolves ur problem,

Pratik Vora

kesavadas_thekkillath
Active Contributor
0 Kudos

check filename = p_file

p_file - check the value