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: 

Uploading latest value of Excel sheet?

Former Member
0 Kudos

Hi,

I have got a task to write my BDC program such tht my end user will update the excel sheet using BDC program Txcode as and when he gets his data in his local machine EXCEL sheet.

For this the logic that i have used is i have selected my maximum value from my table and that i have holded i a local variable and that local variable i have assigned in my begin of row. But it is taking me to RUN time error.

My code...

data: SL TYPE I,

S TYPE I.

SL = 0.

S = 0.

SELECT MAX( FASLN ) INTO S FROM ZRPFORMA1.

SL = S + 1 .

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

filename = P_FNAME

i_begin_col = 1

i_begin_row = SL

i_end_col = 44

i_end_row = 5

TABLES

intern = IT_FILE_UPLOAD

.

where u can see i have assigned SL in the begin of my row, i want to know whether this is correct or wrong.

Thks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hey here i found some error in ur code.

SELECT MAX( FASLN ) INTO S FROM ZRPFORMA1.

SL = S + 1 .

Suppose this returns 15 into SL.

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

filename = P_FNAME

i_begin_col = 1

i_begin_row = SL -- here 15 is begin row

i_end_col = 44

i_end_row = 5 -- end row is 5 which is less than 15 -- ERROR

TABLES

intern = IT_FILE_UPLOAD

if your intention is to read next 5 rows from 15th row thn make i_end_row = SL + 5.

or give whtever you need

6 REPLIES 6

Former Member
0 Kudos

Hey here i found some error in ur code.

SELECT MAX( FASLN ) INTO S FROM ZRPFORMA1.

SL = S + 1 .

Suppose this returns 15 into SL.

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

filename = P_FNAME

i_begin_col = 1

i_begin_row = SL -- here 15 is begin row

i_end_col = 44

i_end_row = 5 -- end row is 5 which is less than 15 -- ERROR

TABLES

intern = IT_FILE_UPLOAD

if your intention is to read next 5 rows from 15th row thn make i_end_row = SL + 5.

or give whtever you need

0 Kudos

Hello i have correct my mistake but still it is taking me dump error.

Thks

0 Kudos

Hi Balu,

Whats the short dump you are getting??

Regards

Pavan

0 Kudos

Hi today i have been working for another client i can post you my error tomorrow.

But the error i remember is like at the begin of my column i have give my local variable name which is holding my row number in my excel sheet.

Actually i_begin_row is of type I in the function model.

But the Primary key value in my table is of NUMC there it is trrowing error you cannot use with TYPE difference. I have tried to change my data type of my promary key to INT2 but still it is not working.

Have got my error.

Thks

Former Member
0 Kudos

Hi

This post is Closed i solved my issue.

Former Member
0 Kudos

Answered