Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Unicode problem in delete statement

Former Member
0 Kudos

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&regards,

sanjay

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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á

8 REPLIES 8

Former Member
0 Kudos

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á

Former Member
0 Kudos

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

0 Kudos

Hi Karmakar,

I am using 6.10 version plzz get back to me if u hav any solutions.

thanks&regards,

sanjay

0 Kudos

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

0 Kudos

Any solutions frnds.

thanks&regards,

sanjay

0 Kudos

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

rahulkavuri
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi All,

Sorry giving points delayed.

Thank u for ur necessary contributions.

regards,

sanjay