SAP Note 11999 - OPEN DATASET / CLOSE DATASET with FILTER addition

Component : Syntax, Compiler, Runtime -

Solution : https://service.sap.com/sap/support/notes/11999 (SAP Service marketplace login required)

Summary :
The issue described involves the OPEN DATASET command with the FILTER addition in SAP, which returns SY-SUBRC = 0 even if the file does not exist or cannot be written to. When using CLOSE DATASET on such files, SY-SUBRC may reflect values like -1, 256, or others not ordinarily set by the filter. When OPEN DATASET ... FILTER is used, a pipe and an additional process execute the filter command, but this subprocess may terminate early, leading to SY-SUBRC inconsistencies. Solutions include verification of SY-SUBRC upon CLOSE DATASET and adhering to guidelines for exit codes and EOF handling for reliable command execution.

Key words :
addition filter returns sy-subrc = 0, command open dataset file filter command, operating system function pclose, executed pipe command reliably, addition filter opens, operating system opens, uix operating systemreports, abap file interface, write problems occurred, exit code > 255 means

Related Notes :

27Recommendations for the ABAP file interface