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

Problem in Function Module "ALSM_EXCEL_TO_INTERNAL_TABLE"

Former Member
0 Likes
927

Dear All,

In this function module we give the number of end rows to be picked from the excel sheet. So, please tell me what can be the maximum number, currently I have put 4000 end rows.

Thanx&Reg,

Nishu

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
854

Hai Nishu

&----


*& Report ZK_REPORT *

*& *

&----


*& *

*& *

&----


REPORT ZK_REPORT.

  • internal table declarations

DATA: BEGIN OF ITAB OCCURS 0,

NAME(20) TYPE C,

ADDR(20) TYPE C,

END OF ITAB.

DATA: ITAB1 LIKE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.

DATA: K1 TYPE I VALUE 1,

M1 TYPE I VALUE 1,

K2 TYPE I VALUE 100,

M2 TYPE I VALUE 9999.

****************************************

  • use FM for uploading data from EXCEL to internal table

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

FILENAME = 'C:\book1.xls'

I_BEGIN_COL = K1

I_BEGIN_ROW = M1

I_END_COL = K2

I_END_ROW = M2

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.

LOOP AT ITAB1.

WRITE:/ ITAB1.

ENDLOOP.

Thanks & regards

Sreeni

Dear All,

In this function module we give the number of end rows to be picked from the excel sheet. So, please tell me what can be the maximum number, currently I have put 4000 end rows.

Thanx&Reg,

Nishu

5 REPLIES 5
Read only

former_member480923
Active Contributor
0 Likes
854

The Last number of row number is 65536 allowable in Excel........ but there is no check in the FM for that

Hope that Helps

Anirban

Read only

Former Member
0 Likes
854

Its not a mandatory field, don't pass any value. let it take default value.

Read only

Former Member
0 Likes
855

Hai Nishu

&----


*& Report ZK_REPORT *

*& *

&----


*& *

*& *

&----


REPORT ZK_REPORT.

  • internal table declarations

DATA: BEGIN OF ITAB OCCURS 0,

NAME(20) TYPE C,

ADDR(20) TYPE C,

END OF ITAB.

DATA: ITAB1 LIKE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.

DATA: K1 TYPE I VALUE 1,

M1 TYPE I VALUE 1,

K2 TYPE I VALUE 100,

M2 TYPE I VALUE 9999.

****************************************

  • use FM for uploading data from EXCEL to internal table

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

FILENAME = 'C:\book1.xls'

I_BEGIN_COL = K1

I_BEGIN_ROW = M1

I_END_COL = K2

I_END_ROW = M2

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.

LOOP AT ITAB1.

WRITE:/ ITAB1.

ENDLOOP.

Thanks & regards

Sreeni

Read only

Former Member
0 Likes
854

Hi,

Chk this link for a sample program:

Hope it helps you.

Regards,

Anjali

Read only

Former Member
0 Likes
854

Hi,

For excel file Upload check this link...

http://www.sapdevelopment.co.uk/file/file_upexcel.htm

Regards

vijay