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: 

The SAP Standard Function 'GUI_UPLOAD' not returning the full records in the file

venkatasap
Participant
0 Kudos

Hi SapAll.

i have got a situation where in my program iam using the SAP Standard Function Module 'GUI_UPLOAD' , but  when iam running my program to get the filedata iam only getting '5833' records int he INternal table where the actual file got '5837' records in it .i have tried by splitting the File into 2 halfs and tested again and in this case the FM''GUI_UPLOAD' had returned the correct no of records in the internal table.

so my question is why the SAP FM'GUI_UPLOAD' had given me 4 records less count out of the actual file when i tested with single file where as it returned me the correct count when i tested  two times by splitting the actual file into 2 halfs.

the source sode is as follows :

CALL FUNCTION 'GUI_UPLOAD'

    EXPORTING

      filename                      = l_fname

*   FILETYPE                      = 'ASC'

*   HAS_FIELD_SEPARATOR           = ' '

*   HEADER_LENGTH                 = 0

*   READ_BY_LINE                  = 'X'

*   DAT_MODE                      = ' '

*   CODEPAGE                      = ' '

*   IGNORE_CERR                   = ABAP_TRUE

*   REPLACEMENT                   = '#'

*   CHECK_BOM                     = ' '

*   VIRUS_SCAN_PROFILE            =

*   NO_AUTH_CHECK                 = ' '

* IMPORTING

*   FILELENGTH                    =

*   HEADER                        =

    TABLES

      data_tab                      = intab.

* EXCEPTIONS

*   FILE_OPEN_ERROR               = 1

*   FILE_READ_ERROR               = 2

*   NO_BATCH                      = 3

*   GUI_REFUSE_FILETRANSFER       = 4

*   INVALID_TYPE                  = 5

*   NO_AUTHORITY                  = 6

*   UNKNOWN_ERROR                 = 7

*   BAD_DATA_FORMAT               = 8

*   HEADER_NOT_ALLOWED            = 9

*   SEPARATOR_NOT_ALLOWED         = 10

*   HEADER_TOO_LONG               = 11

*   UNKNOWN_DP_ERROR              = 12

*   ACCESS_DENIED                 = 13

*   DP_OUT_OF_MEMORY              = 14

*   DISK_FULL                     = 15

*   DP_TIMEOUT                    = 16

*   OTHERS                        = 17  .

  IF sy-subrc <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

  ENDIF.

will be waiting for your response.

regards.

Varma

9 REPLIES 9

ankit_doshi
Participant
0 Kudos

Hi,

can you try the OO version of this ,

CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD

0 Kudos

Hi Ankith.

i have tried but still i can the same output in the Internal table while debugging.

regards.

Varma.

Private_Member_49934
Contributor
0 Kudos

Any chance of uploading the file here. I suspect some special character ( an EOF? ) Is present at line 5833 which might be causeing the problem.

Other thing you can try. Make a copy of original file. Delete Line 5833 and 5834 and then try uploading.

0 Kudos

Hi Kumar.

please find the attachend file.

regards.

Varma

0 Kudos

Check out your attached file. It has only 5834 Line and last line balnk. I am still sure that is some special character herewith. at line 5833/34

0 Kudos

There is no problem with the FM. The File has some grbage data in the file and it needs to be corrected. Open the file with some hex editor like editpad and try to see what content is there at line 5833 ( which are generally invisible ).

Former Member
0 Kudos

Varma,

Can you pl paste the line, how you declared internal tbl  intab ?

Thanks

Sridhar

0 Kudos

Hi Sridhar.

i have declared the Internal table in the source code as below

TYPES:   BEGIN OF gty_intab,

          txt(400),

         END OF gty_intab.

DATA: intab TYPE STANDARD TABLE OF gty_intab.

regards.

Varma.

0 Kudos

Hi Venkat,

I've Seen you file and the problem is with the file only.

What you can do open the file in excel and save and save it again you problem will be solved.

I've tested with ur file first I was facing the same problem as your and after correcting the file it worked.

Regards,

Rakesh.