17.08.2013 Views

Data Interfaces

Data Interfaces

Data Interfaces

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Closing/Deleting a Sequential File<br />

© SAP AG<br />

CLOSE DATASET .<br />

DELETE DATASET .<br />

You use the CLOSE DATASET statement to close a sequential file explicitly.<br />

As with OPEN DATASET, errors are ignored.<br />

In a program, all opened files are implicitly closed each time the screen changes, and then reopened<br />

exactly as they were before when processing resumes.<br />

At the end of a program, all files are closed.<br />

Opening and closing files explicitly aids readability. Also, the advantage of using OPEN DATASET is<br />

that you can use the addition MESSAGE to avoid a programmed termination if an error occurs when<br />

opening the file (SY-SUBRC = 8). In addition, you should be aware that, in cases where a file is read,<br />

or generated and read, several times in the same report, only explicit opening or closing guarantees that<br />

the cursor will be repositioned at the beginning of the file.<br />

A file is not closed implicitly when READ DATASET reaches the endo of a file.<br />

You can use the DELETE DATASET to delete a sequential file explicitly. If this is<br />

successful, SY-SUBRC is set to 0.<br />

You can display the current state of the file in debugging by choosing Goto -> System -> System areas<br />

and then entering (or selecting) DATASETS.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!