Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Weird Error with open dataset

I am trying to read a .csv file using WS_upload. Please see the foll code:

IF FILE1+0(1) <> '\'.

CALL FUNCTION 'WS_UPLOAD'

EXPORTING

  • FILENAME = dataset

FILENAME = FILE1

  • FILETYPE = 'DAT'

FILETYPE = 'ASC'

TABLES

DATA_TAB = rec.

ENDIF.

OPEN DATASET FILE1 IN TEXT MODE for INPUT.

IF sy-subrc = 0.

DO.

READ DATASET FILE1 INTO rec2.

IF sy-subrc <> 0.

EXIT.

ELSE.

  • WRITE / rec2.

rec-INFO = rec2.

APPEND REC.

ENDIF.

ENDDO.

ENDIF.

The system is behaving different when I run in foreground on our test server and it gives error while running on produciton server. The open dataset block does not execute on the test server but on production server it does. And it ahs suddenly started doing it with any CSV file.. including the ones which earlier it did not ahve any problem with. Because the open dataset block executes on the production server it adds around 10000 lines to the file... the file ofcourse contain all garbage values for eg gwrd.exe, instance.lst , car.exe, dll etc. I have no clue why this has started happening suddenly when it was not happeing 1 hour before.

please help/

thanks.

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question