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

Structure layout problem related to UNICODE.

Former Member
0 Likes
1,107

Hello.

I was toying around a bit creating benchmarks with some code that manipulates mainly internal tables.

In attempt to compile it I got this error:

Help for ErrorProgram Z06_TABLE_LINE56Error
"WA_INT-PDAT" and "WA_PA02" are not mutually convertible. In Unicode
programs, "WA_INT-PDAT" must have the same structure layout as
"WA_PA02", independent of the length of a Unicode character.

Which is strange for me, because I just want to copy a structure of table pa0002 into another structure of table pa0002.

So I had to create a rather clumsy workaround.


*-----------------BUGGER ON ----------------------

    wa_int-pdat = wa_pa02. "Here's the Problem!

*-----------------BUGGER OFF----------------------

*---------CLUMSY WORKAROUND ON -------------------

*    wa_int-pdat-vorna = wa_pa02-vorna.

*    wa_int-pdat-nachn = wa_pa02-nachn.

*    wa_int-pdat-gbdat = wa_pa02-gbdat.

*---------CLUMSY WORKAROUND OFF-------------------

where wa_int is defined based on type t_itint.


TYPES: BEGIN OF t_itint,

    rnum TYPE i,

    tstm TYPE i,

    pdat TYPE p0002,

  END OF t_itint.

DATA it_int TYPE TABLE OF t_itintDATA wa_int TYPE t_itint.

and wa_pa02 is defined as a structure like the table header of the dictionary table pa0002.


DATA: it_pa02 TYPE TABLE OF pa0002,

      wa_pa02 TYPE pa0002.

The clumsy workaround works. [Code block 1 lines 7 to 9]

Copying seemingly identical typed variables does not work. [Code block 1 line 2]

I am definitely missing something, just cannot see what.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
983

Hi,

the structure of Pa0002 is different from P0002.

Please check once.

P0002 has two include structures  PSHDR ans PS0002.

Pa0002 has 3 include structures PAKEY,PSHD1,PS0002

4 REPLIES 4
Read only

FredericGirod
Active Contributor
0 Likes
983

Hi,

didn't you try to put a structure into a variable ?

regards

Fred

Read only

0 Likes
983

Hi Frédéric,

in my eyes not.

wa_pa02 should be a structure.

wa_int-pdat should be a stucture within the deep structure defined by t_itint.

So

wa_int-pdat = wa_pa02.


should copy a structure into another stucture that is part of a deep structure.


Read only

Former Member
0 Likes
984

Hi,

the structure of Pa0002 is different from P0002.

Please check once.

P0002 has two include structures  PSHDR ans PS0002.

Pa0002 has 3 include structures PAKEY,PSHD1,PS0002

Read only

0 Likes
983

Oh my!

It was a simple typo!

Indeed p0002 is different from pa0002.

It simply didn't see it.

Thanks Gowtham!

I apologize for this.

Should have seen it, but ever after some hours didn't.