Skip to Content
-2

UPLOAD_XLS_FILE_2_ITAB going into infinite loop

Sep 14, 2017 at 11:55 AM

94

avatar image
Former Member

I am writing one program to upload data from excel file which is having NUMC, CHAR and DATS form of data. When I try to upload data using

UPLOAD_XLS_FILE_2_ITAB

It is going into infinite loop. Though excel file is having single row it is going into adding multiple rows which don't have any data. I seen in debugging it keeps adding blank records and not coming out of DO ENDDO. Please help.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Best Answer
avatar image
Former Member Sep 19, 2017 at 02:10 PM
0

Issue reolved. Changed internal table structure fields to type char.

Share
10 |10000 characters needed characters left characters exceeded
Raymond Giuseppi
Sep 15, 2017 at 12:56 PM
1

Be aware that blank cells are not always empty cells in your sheet. Open the Excel sheet and click on Ctrl+End, which row is the cursor?

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

It is on last column of last row in excel file.

0

Hello,

Your fields in your file probably contain "space". I guess it is created from an application or a macro.

If you can't change the generator or reprocess your file before calling UPLOAD_XLS_FILE_2_ITAB you may copy this FM in a ZUPLOAD_XLS_FILE_2_ITAB and change exit condition.

0
Varun Kumar Sahu Sep 15, 2017 at 11:18 AM
-1

Hi Prakash,

Why are you calling the FM in a DO ENDDO loop? You have inserted a infinite loop!

Cheers,

Varun

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

I am not calling this FM in DO ENDDO loop. It is there in this FM.

0
avatar image
Former Member Sep 15, 2017 at 12:24 PM
0

Hi,

The DO ... ENDDO in this FM exits when :

CHECK lgc_empty_rows > 4 OR lsc_content[] IS INITIAL.
EXIT.

Maybe you excel has not got 4 emprty rows.... so SAP doesn't know when stop to read.

Best regards.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member
Though I am having blank entries in Excel It is not increasing LGC_EMPTY_ROWS. It keeps adding empty records as well.
0