Skip to Content
0
Apr 10, 2012 at 06:24 AM

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

33 Views

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