04-18-2008 9:10 AM
Hi All,
How to correct type compatibility under Unicode environment
04-18-2008 9:14 AM
Give details on the instance when you got the error. Check the data types of the fields when you move data. Unlike in Non-Unicode systems, we can not move data from one structure to other when the definitions are different.
04-18-2008 9:15 AM
04-18-2008 9:16 AM
hi check this..
In se38 GOTO--> Attributes .. and there is one "Unicode check" check box is there .. just uncheck it and you will be done,.
or given the error what u had we will give the solution..
regards,
venkat.
04-18-2008 9:28 AM
Hi,
Type Checks and Type Compatibility
NUP-NON UNICODE ENABLE PROGRAM
UP- UNICODE ENABLE PROGRAM
NUS-NON UNICODE SYSTEM
US- UNICODE SYSTEM
the types of field symbols and parameters in subroutines or function modules can be defined with the STRUCTURE addition.
__If the types of field symbols are defined with FIELD-SYMBOLS <f> STRUCTURE s DEFAULT wa and they are later assigned a data object wa with ASSIGN wa TO <f> ... , in a NUP both statements are checked to see if wa is at least as long as s and wa satisfies the alignment requirements of s at runtime.
If parameter types in function modules or subroutines are defined with FORM form1 USING/CHANGING arg STRUCTURE s ... or FORM form2 TABLES itab_a STRUCTURE s ... and the parameters are passed actual parameters with PERFORM form1 USING/CHANGING wa or PERFORM form2 USING/CHANGING itab_b, the NUP also only checks if wa or the line type of itab_b is at least as long as s and wa or the line type of itab_b satisfies the alignment requirements of s. The same is true for function module parameters whose types are defined with STRUCTURE.
The following extra rules are checked in a UP after defining the type with STRUCTURE when assigning data objects, that is for the DEFAULT addition in the FIELD-SYMBOLS statement, for ASSIGN, and when passing actual parameters.
1. If wa or the line type of itab_b is a flat or deep structure, the length of s must be the same for the Unicode fragment views of wa or of itab_b and s.
2. If wa is a single field, only the character-types C, N, D or T are allowed and the structure s must be purely character-type.
Checking both these rules requires additional runtime. It is therefore recommended that, if possible, you type the parameters using TYPE, since the test for actual compatibility is much faster.
__If the type of an argument in a function module was defined with ... LIKE struc, where struc is a flat structure, the NUP only checks if the argument is a flat structure with the same length when the parameters are passed. In the UP, it also checks that the fragment views of the current and formal parameters are the same. For performance reasons, it is again recommended that you use TYPE to assign types.
__Furthermore, two structures of which one or both contain Includes, are only compatible if the alignment gaps caused by the Include are the same on all platforms. In the following example, struc1 and struc2 are not compatible because a further alignment gap occurs in the US before the INCLUDE:
BEGIN OF struc1, BEGIN OF struc2, BEGIN OF struc3,
a(1) TYPE X, a(1) TYPE X. b(1) TYPE X,
b(1) TYPE X, INCUDE struc3. c(1) TYPE C,
c(1) TYPE C, END OF struc2. END OF struc3.
END OF struc1.
Since the type compatibility can differ in a UP and an NUP, the type compatibility rules of the calling program are valid in an NUS for checking the parameters. This means that if an NUP calls a UP, the type compatibility is defined as in the NUP. Conversely, the Unicode check is activated if a UP calls an NUP.
reward if useful