SAP IMPORT CONVERSION ABAP Statements



Get Example source ABAP code based on a different SAP table
  


• ACCEPTING PADDING IMPORT cluster
• ACCEPTING TRUNCATION IMPORT cluster
• IGNORING STRUCTURE BOUNDARIES IMPORT cluster
• IGNORING CONVERSION ERRORS IMPORT cluster
• REPLACEMENT CHARACTER IMPORT cluster
• IN CHAR-TO-HEX MODE IMPORT cluster
• CODE PAGE INTO IMPORT cluster
• ENDIAN INTO IMPORT cluster

IMPORT, conversion_options
Short Reference

ABAP_SYNTAX
... ${ ${ ${ ${$[ACCEPTING PADDING$] $[ACCEPTING TRUNCATION$]$}
$| $[IGNORING STRUCTURE BOUNDARIES$] $}
$[IGNORING CONVERSION ERRORS $[REPLACEMENT CHARACTER rc$]$] $}
$| $[IN CHAR-TO-HEX MODE$] $}
$[CODE PAGE INTO cp$]
$[ENDIAN INTO endian$].

ABAP Addition
1 ... ACCEPTING PADDING
2 ... ACCEPTING TRUNCATION
3 ... IGNORING STRUCTURE BOUNDARIES
4 ... IGNORING CONVERSION ERRORS $[REPLACEMENT CHARACTER rc$]
5 ... IN CHAR-TO-HEX MODE
6 ... CODE PAGE INTO cp
7 ... ENDIAN INTO endian

What does it do?
These additions allow the reading of data stored in data clusters into non-type-compliant data objects and define associated conversion rules. The following table shows which of the additions may be used during imports from the various buffers. The column headers are abbreviations for the following storage locations: DATA BUFFER (B ), MEMORY (M), SHARED MEMORY (SM), SHARED BUFFER (SB), DATABASE (DB), and INTERNAL TABLE (IT). Conversion AdditionBM ITDBSMSB ACCEPTING PADDING++++++ ACCEPTING TRUNCATION++++++ IGNORING STRUCTURE BOUNDARIES++++++ IGNORING CONVERSION ERRORS+-++-- REPLACEMENT CHARACTER rc+-++-- IN CHAR-TO-HEX MODE+-++-- CODE PAGE INTO cp+-++-- ENDIAN INTO endian+-++--

ABAP Addition

What does it do?
This addition extends the rules from parameter_list for different data types of source field and target field dobj in the data clusters:
In addition to data objects of the type c, the target field can be longer than the source field for data objects of the type n, p, or x.
Source fields of the type
b can be read into target fields of the types s, i, and int8
s can be read into target fields of the type i and int8 (but negative numbers are handled incorrectly)
i can be read into target fields of the type int8
Source fields of the type c can be exported to target fields of the type string and source fields of the type x can be exported to target fields of the type xstring.
The rules above also apply if the component involved is the last component of a source structure or target structure that is otherwise set up in the same way.
In a target structure, substructures can also have more components than the substructures of the source structure if the structure is otherwise set up in the same way. The surplus components are provided with type-dependent initial values.



Latest notes:

The rule that substructures in a target structure can have more components than the source structure can cause problems in relation to structures defined in the ABAP Dictionary. This is the case if the structure there is marked as extendable. Therefore, this situation raises a warning from the extended program check.
NON_V5_HINTS
ABAP_HINT_END

ABAP_EXAMPLE_VX
Without the addition ACCEPTING PADDING, the structure f1 in the data cluster could not be imported into the structure f2 since a substructure of f2 contains a surplus component.
ABEXA 00317
ABAP_EXAMPLE_END

ABAP_EXAMPLE_V5
Without the addition ACCEPTING PADDING, the structure f1 in the byte string could not be imported into the structure f2 since a substructure of f2 contains a surplus component.
ABEXA 01636
ABAP_EXAMPLE_END

ABAP Addition

What does it do?
This addition expands the rules from parameter_list for different data types of source field in the data cluster and target field dobj in the data cluster. This means that, in the case of structures that otherwise have the same type, if the source structure at the highest level has more components than the target structure in the data cluster, the surplus components are cut off. A substructure of the source structure must not have more components than the corresponding substructure in the target structure.

ABAP_EXAMPLE_VX
Without the addition ACCEPTING TRUNCATION, the structure f1 in the data cluster could not be imported into the structure f2 since f2 contains fewer components.
ABEXA 00318
ABAP_EXAMPLE_END

ABAP_EXAMPLE_V5
Without the addition ACCEPTING TRUNCATION, the structure f1 in the byte string could not be imported into the structure f2 since f2 contains fewer components.
ABEXA 01670
ABAP_EXAMPLE_END

ABAP Addition

What does it do?
This addition expands the rules from parameter_list for different data types of source field in the data cluster and target field dobj in the data cluster. In structures, this produces an insignificantly different setup, with the differences resulting from substructures or from various applied