08-26-2009 9:00 AM
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
08-26-2009 9:55 AM
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
08-26-2009 9:48 AM
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
08-26-2009 10:41 AM
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.
08-26-2009 10:47 AM
link:[Upload excel to itab|http://www.sapdb.info/abap-programs-upload-excel-to-internal-table/]
08-26-2009 12:43 PM
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.
08-26-2009 9:48 AM
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
08-26-2009 9:55 AM
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
08-26-2009 12:53 PM