This is similar to the question posted on Jan. 15, dealing with
end-of-line/end-of-file characters. One thing I forgot to mention: the
file was apparently downloaded to our PC, and then uploaded to SAP through
calling Ws_Upload function. What do we need to adjust with Ws_upload
function to handle the new file format, which no longer has end-of-line or
End-of-file control characters...
Requires Free Membership to View
When you register, you will start receiving targeted emails from my award-winning team of editorial writers. Our goal is to keep you informed on the hottest topics and biggest challenges faced by SAP professionals today.
Hannah Smalltree, Editorial DirectorThe current ABAP code, that handles the old file format(which has end-of-line and end-of-file characters):
FORM UPLOAD_INPUT.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
CODEPAGE = ''
FILENAME = IN_FILE
FILETYPE = 'ASC'
IMPORTING
FILELENGTH = FLENGTH_IN
TABLES
DATA_TAB = IN_TBL
EXCEPTIONS
CONVERSION_ERROR = 1
INVALID_TABLE_WIDTH = 2
INVALID_TYPE = 3.
Without having your file to test, this is a little difficult to diagnose. Have a look at the documentation for WS_UPLOAD (one of the few function modules to have documentation!). You can use FILETYPE 'BIN' which might fix your problems. Otherwise, copy to your application server, and use OPEN DATASET instead - you have far more control with this.
This was first published in February 2002