End-of-line/end-of-file characters

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 Director

    By submitting your registration information to SearchSAP.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchSAP.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.


The 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