In Unicode enabled systems its important to use the correct method to add, remove or check control characters that represents Horizontal-Tab, Vertical-Tab, New-Line, Form-Feed etc. This can be achieved using constants defined as attributes of ABAP class cl_abap_char_utilities.
These control characters are required while reading data from a tab delimited format or any file in an ABAP program. Similarly it’s used to export data from an abap program to a file in tab delimited format or any other format.
CLASS cl_abap_char_utilities DEFINITION LOAD.
CONSTANTS: bs(1) TYPE c VALUE cl_abap_char_utilities=>backspace,
cr(1) TYPE c VALUE cl_abap_char_utilities=>cr_lf,
crlf(2) TYPE c VALUE cl_abap_char_utilities=>cr_lf,
ff(1) TYPE c VALUE cl_abap_char_utilities=>form_feed,
ht(1) TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
lf(1) TYPE c VALUE cl_abap_char_utilities=>newline,
vt(1) TYPE c VALUE cl_abap_char_utilities=>vertical_tab,
mn(1) TYPE c VALUE cl_abap_char_utilities=>minchar,
mx(1) TYPE c VALUE cl_abap_char_utilities=>maxchar.
After defining these variables, it can be used along with “concatenate” statement while exporting file from ABAP program. And it can be used with “replace all occurrences of” statement while reading data from an external file in an ABAP program.
Saturday, January 17, 2009
Subscribe to:
Posts (Atom)