SAP UNICODE STRUCTURES

Get Example source ABAP code based on a different SAP table
  


ARTICLE

Structure Enhancements and Unicode Programs
ABAP Dictionary structures and database tables that are delivered by SAP ABAP Code Snippet customizing includes or append structures. These types of changes cause problems in Unicode programs if the enhancements change the Unicode fragment view .
For this reason, the option to classify structures and database tables was introduced, which makes it possible to recognize and handle problems related to structure enhancements. This classification is used during in the program check to create a warning at all points where the program works with structures, and where later structure enhancements can cause syntax errors or changes in program behavior. When you define a structure or a database table in ABAP Dictionary, you can specify the enhancement categories that are displayed in the following table as classification. LevelCategoryMeaning 1UnclassifiedThe structure does not have an enhancement category. 2Cannot be enhancedThe structure must not be enhanced. 3Can be enhanced and character-likeAll structure components and their enhancements must be character-like and flat. 4Can be enhanced and character-like or numericAll structure components and their enhancements must be flat. 5Can be enhanced in any wayAll structure components and their enhancements can have any data type.
The warnings displayed after the program check are classified into three levels from the following table, depending on the consequences of the permitted structure enhacements. LevelType of CheckMeaning ASyntax checkAn enhancement that fully utilizes the enhancement category of the structure in question leads to a syntax error. BExtended checkPermitted enhancements can lead to a syntax errors, but not always. CExtended checkPermitted enhancements cannot lead to syntax errors, although changes to program behavior do result in semantic problems.

Example
If the structure ddic_struc in ABAP Dictionary is defined only with flat components but is classified as Can be enhanced in any way, then the following program section leads to a warning in the syntax check. If the structure were to be enhanced by a deep component after the program was delivered, the program would be syntactically incorrect and no longer executable. This is why in this case you either have to classify the structure ddic_struc in ABAP Dictionary as Can be enhanced and character-like or else you cannot specify the offset/length in the program. DATA: my_struc TYPE ddic_struc,
str TYPE string,
off TYPE i,
len TYPE i.
...
str = my_struc+off(len).