05-09-2007 1:11 PM
Hi all,
I have come thru an upgrade error, i m providing details and the error.
There is one Table : zxyz with field "zzabc(type numc length 4)" .
We have one internal table it_tab1 which is having a field "zzabc" which is like "zxyz-zzabc".
So when i have written a statement as
delete it_tab1 from i_index_p where zzabc = zxyz-zzabc.
Its giving error "delete statement may have unicode related error".
Frnds please provide if any solution available to rectify this error.
thanks®ards,
sanjay
05-09-2007 1:18 PM
Hi!
Press F1, when the error message appears to detail message.
You wanted to delete from a given record (FROM index) with a WHERE condition.
The error will surely not appear when you remove the FROM index condition.
Personally I prefer better the exact erasing with the DELETE ... INDEX statement.
Regards
Tamá
05-09-2007 1:18 PM
Hi!
Press F1, when the error message appears to detail message.
You wanted to delete from a given record (FROM index) with a WHERE condition.
The error will surely not appear when you remove the FROM index condition.
Personally I prefer better the exact erasing with the DELETE ... INDEX statement.
Regards
Tamá
05-09-2007 1:27 PM
Hi sanjay,
Kindly let us know which version you are using e.g 6.10 .
Restrictions in Unicode Programs:
SAP have tried to keep the number of restrictions needed for the Unicode environment as low as possible, to minimize the amount of conversion work. However, in some cases, this has led to fairly complex rules - for example, those governing assignments and comparisons between incompatible structures or between structures and single fields.
As per ur requirement:
For Database Operations:
In non-Unicode programs, the following statements transfer the data to the field wa or the table line itab according to the structure of the table work area dbtab without considering the structure of the field or line. Only the length and the alignment are checked.
SELECT * FROM dbtab ... INTO wa ...
SELECT * FROM dbtab ... INTO TABLE itab ...
SELECT * FROM dbtab ... APPENDING TABLE itab ...
FETCH NEXT CURSOR c ... INTO wa.
FETCH NEXT CURSOR c ... INTO TABLE itab.
FETCH NEXT CURSOR c ... APPENDING TABLE itab.
INSERT INTO dbtab ... FROM wa.
INSERT dbtab ... FROM wa.
INSERT dbtab ... FROM TABLE itab.
UPDATE dbtab ... FROM wa.
UPDATE dbtab ... FROM TABLE itab.
MODIFY dbtab ... FROM wa.
MODIFY dbtab ... FROM TABLE itab.
DELETE dbtab FROM wa.
DELETE dbtab FROM TABLE itab.
In Unicode programs the following rules apply:
If the work area or the line of the internal table is a structure, the system also checks whether the fragment views of the work area and the database table are identical with regard to the length of the database table.
If the work area is a single field, the field must be character-type and the database table purely character-type. These requirements are valid for all statements listed above.
If Helpful reward with some points.
Regards,
Pulokesh
05-09-2007 1:37 PM
Hi Karmakar,
I am using 6.10 version plzz get back to me if u hav any solutions.
thanks®ards,
sanjay
05-09-2007 2:01 PM
Hi Sanjay,
Try to transform the numc field of length 4 to a character field of length 4 by using MOVE statement or by direct assignment to a variable using "=", and then execute your program. If Helpful reward with points.
Regards,
Pulokesh
05-09-2007 2:01 PM
05-09-2007 2:15 PM
Dear Sanjay,
In your code that u have posted here that at the "Delete" statement level interpreter is encountering a "numc" field in line of your internal table. But as per constraints provided by SAP that "In Unicode programs the following rules apply:
a.> If the work area or the line of the internal table is a structure, the system also checks whether the fragment views of the work area and the database table are identical with regard to the length of the database table.
b.> If the work area is a single field, the field must be character-type and the database table purely character-type. These requirements are valid for all statements listed above. "
Thats why before triggering the "DELETE" statement you should modify the all contents of ITAB1 to char type.
Hope this will help u to solve your problem.
Reward with points if it is helpful.
Regards,
Pulokesh
05-09-2007 2:09 PM
does it_tab1 and i_index_p have the same structure??
please check that before u carry on further as Database Operations between Incompatible Structures isnt possible in Unicode Systems.
Database Operations with workareas:
SELECT * FROM dbtab INTO wa ...
SELECT * FROM dbtab INTO TABLE wa ...
UPDATA dbtab FROM wa ...
DELETE dbtab FROM wa ...
Here workareas need to be compatible
05-10-2007 4:39 AM
Hi All,
Sorry giving points delayed.
Thank u for ur necessary contributions.
regards,
sanjay