SAP TRUNCATE ABAP Statements
Get Example source ABAP code based on a different SAP table
Standard SAP Help for TRUNCATE
TRUNCATE DATASET
• TRUNCATE DATASET ABAP Statement
• AT TRUNCATE DATASET
ABAP Syntax
ABAP Addition
1
2
What does it do? This statement sets the end of file of the file specified in
The statement always sets
Latest notes:The
• CURRENT POSITION TRUNCATE DATASET
ABAP Addition
What does it do? The
• POSITION TRUNCATE DATASET
ABAP Addition
What does it do? The
Example ABAP Coding
After the first
hex TYPE xstring.
hex = 'FFFF'.
OPEN DATASET name FOR OUTPUT IN BINARY MODE.
TRANSFER hex TO name.
SET DATASET name POSITION 0.
READ DATASET name INTO hex.
TRUNCATE DATASET name AT POSITION 1.
SET DATASET name POSITION 0.
READ DATASET name INTO hex.
TRUNCATE DATASET name AT POSITION 2.
SET DATASET name POSITION 0.
READ DATASET name INTO hex.
CLOSE DATASET name.
Runtime Exceptions
Catchable Exceptions
Reason for error:
The file is not open. Runtime error:
Reason for error:
The file is only open for reading. Runtime error:
Reason for error:
No authorization for access to file Runtime error:
Reason for error:
Invalid position specified. Runtime error:
Reason for error:
The operating system could not change the size of the file. Runtime error:
Reason for error:
An attempt was made to change the size of a file opened using the Runtime error:
Non-catchable Exceptions
Reason for error:
Internal error when emptying the file buffer, determining the current file position, or restoring the file when rolling in the internal session. Runtime error:
Return to menu