Application Development and Automation 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: 
Read only

Problem with no-unicode structures

Former Member
0 Likes
625

Hi,

I'm writing a test application with the Fly data.

I have a SAP tutorial about this (Programming service provider tutorial) and I have to understand, how this works.

I need the table FLIGHTS and a new structure, a table type with FLIGHTS as row.

I have a method interface with a returning parameter of type "table of flights".

The code:

....

select * from sflight

into table re_flights (<-- this is the DDIC structure)

where ....

By implementing the interface method in a class the ABAP editor says always

"The types of the table and of "RE_FLIGHTS" are not convertible in Unicode"

I know, this kind of applications is bad, but I need only a example.

How can I set the parameters? With a table of string?

Thank you!

Regards

Patrizia

1 ACCEPTED SOLUTION
Read only

harry_dietz
Product and Topic Expert
Product and Topic Expert
0 Likes
596

Did you check, perhaps the structure of SFLIGHT and RE_FLIGHTS is not really the same? Otherwise you could perhaps use "into corresponding fields of table re_flights"

Regards

Harry

4 REPLIES 4
Read only

harry_dietz
Product and Topic Expert
Product and Topic Expert
0 Likes
597

Did you check, perhaps the structure of SFLIGHT and RE_FLIGHTS is not really the same? Otherwise you could perhaps use "into corresponding fields of table re_flights"

Regards

Harry

Read only

0 Likes
596

Hi,

the structure FLIGHTS is a record, the structure RE-FLIGHTS is a table with FLIGHTS as row type.

I solved the problem: I deactivate the Unicode code check.

This is no very fine, but effective

It is only a test program.

Regards

Patrizia

Read only

0 Likes
596

hi Patrizia,

data: begin of re_flights.

include structure flights.

data: end of re_flights.

select * from flights into re_flights..

this will work. In earlier case, fragments might not have matched.

Because of unicode issues, it is not possible to copy one structure to other directly. In an NUS(nonunicode system), a character of this type has a length of 1 byte, and in a US(unicode system) a length corresponding to the length of one character on the relevant platform.

You can check this example how it works.

report ZCH_UNIEXP_1.

types: begin of T_STRUC,

F1 type c,

F2 type c,

F3 type i,

F4 type p,

end of T_STRUC.

  • Before Unicode enabling:

  • data: begin of STRUC1.

  • include type T_STRUC.

  • data: F5 type x.

  • data: end of STRUC1.

  • data: begin of STRUC2.

  • include type T_STRUC.

  • data: F6 type p.

  • data: end of STRUC2.

  • STRUC1 = STRUC2. <---- Unicode error !!

  • After Unicode enabling, if only component F1 to F4 should be moved:

data: begin of STRUC1.

include type T_STRUC as PART1.

data: F5 type x.

data: end of STRUC1.

data: begin of STRUC2.

include type T_STRUC as PART1.

data: F6 type p.

data: end of STRUC2.

STRUC1-PART1 = STRUC2-PART1.

Dont forget to reward points if it helps you.

Regards,

Sailaja.

Message was edited by: Sailaja N.L.

Read only

0 Likes
596

Hi,

thank you for your help. This is very helpfull for me.

Regards

Patrizia