Skip to Content
avatar image
-2
Former Member

UPLOAD_XLS_FILE_2_ITAB going into infinite loop

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

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

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

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 15, 2017 at 12:56 PM

    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?

    Add comment
    10|10000 characters needed characters exceeded

    • 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.

  • 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

    Add comment
    10|10000 characters needed characters exceeded

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

    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.

    Add comment
    10|10000 characters needed 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.