Problem solve Get help with specific problems with your technologies, process and projects.

End-of-line and End-of-File characters

How does ABAP handle End-of-line and End-of-File characters?

We currently receive standard data files (SDF) from Diners Club. The file contains End-Of-line carriage return line feed, and an End-of-file character. We have an ABAP program that reformats the SDF file to an input file for SAP. Currently, We do not need to deal with the End-of-line or End-of-file characters. ABAP seems to be able to pick up end-of-line character as end-of-record, and end-of-file character as end-of-file.

We are not certain as to what will happen when the SDF file, which we get from Diners Club, no longer contains End-of-file and end-of-line characters. What changes do we need for the ABAP program that reformats the diners club input file, in order to recognize end-of-record and end-of-file?

If you wish to read a file which does not have End-of-file markers, you need to use the IN BINARY MODE addition to the OPEN DATASET command. (In fact IN BINARY MODE is the default, so I assume you are currently using IN TEXT MODE). You will also need to use the TYPE addition to specify record length etc. The format of the TYPE parameter depends on the operating system you are running.

Dig Deeper on SAP ABAP