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: 

How to equate two different structures in unicode system R/3 4.7 ??

Former Member
0 Kudos

Hi All,

We are undergoing through non-unicode to unicode conversion in 4.7.

While correcting programs i have come across error code MESSAGEG!2 , which says

"RECORD_TAB" and "ZHTLPRJ" are not mutually convertible. In Unicode programs, "RECORD_TAB" must have the same structure layout as "ZHTLPRJ".

In my code I have this statement, RECORD_TAB = ZHTLPRJ.

where RECORD_TAB -> structure (SEAHLPRES)

ZHTLPRJ -> ztable

How to equate two different structures in unicode conversion environment?

Please help me out to resolve this issue..

Many Thanks

Priya

9 REPLIES 9

former_member842213
Participant
0 Kudos

Hi,

Check this it will help you

wa and ext are different structures.

  • ext = wa

the below function module is to assign wa to ext structure, but a constrain is both the structures should not have lraw datas type

CALL METHOD CL_HR_PM_TYPE_CAST=>STRUC_TO_STRUC

EXPORTING

P_SC_STRUC = wa

IMPORTING

P_DEST_STRUC = ext.

Former Member
0 Kudos

Hi,

The thing is one of element is one of structures is not a character it may be of type P, X so see that field and declare as a character

The above solution is valid only if the field is not used for mathematical operations globally i.e., the field should not be used for any addition, subtraction and so on in the entire program.

Thanks.

Former Member
0 Kudos

Hi,

Check this it will help you .

When two structures are incompatible. By using the following Classes we can make it compatible.

*Example*

Error faced while Unicode syntax check :

SRTFDLOW and "XSRTFDLOW" are not mutually convertible in a Unicode

Resolution:

CLASS CL_ABAP_CONTAINER_UTILITIES DEFINITION LOAD.

DATA: LV_TAB(1000) TYPE C.

CALL METHOD

CL_ABAP_CONTAINER_UTILITIES=>FILL_CONTAINER_C

EXPORTING

IM_VALUE = XSRTFDLOW

IMPORTING

EX_CONTAINER = LV_TAB

CALL METHOD CL_ABAP_CONTAINER_UTILITIES=>READ_CONTAINER_C

EXPORTING

IM_CONTAINER = LV_TAB

IMPORTING

EX_VALUE = SRTFDLOW.

Former Member
0 Kudos

Hi,

Check this it will help you .

When two structures are incompatible. By using the following Classes we can make it compatible.

Example

Error faced while Unicode syntax check :

SRTFDLOW and "XSRTFDLOW" are not mutually convertible in a Unicode

Resolution:

CLASS CL_ABAP_CONTAINER_UTILITIES DEFINITION LOAD.

DATA: LV_TAB(1000) TYPE C.

CALL METHOD

CL_ABAP_CONTAINER_UTILITIES=>FILL_CONTAINER_C

EXPORTING

IM_VALUE = XSRTFDLOW

IMPORTING

EX_CONTAINER = LV_TAB

CALL METHOD CL_ABAP_CONTAINER_UTILITIES=>READ_CONTAINER_C

EXPORTING

IM_CONTAINER = LV_TAB

IMPORTING

EX_VALUE = SRTFDLOW.

0 Kudos

To move the contents between two structures, we need to follow the below code.

Before Unicode:

LVBAP[] = ORD_VBAPINFO[].

Resolution:

LOOP AT ORD_VBAPINFO.

MOVE-CORRESPONDING ORD_VBAPINFO TO LVBAP.

APPEND LVBAP.

ENDLOOP.

Former Member
0 Kudos

you need to check the structure and pass field by field.

Example

RECORD_TAB+0(1) = ZHTLPRJ-fieldname1.

RECORD_TAB+1(4) = ZHTLPRJ-fieldname2.

so on till all the fields

Former Member
0 Kudos

Hi Priya,

try this..

FIELD-SYMBOLS: <unicode_x1> TYPE x,

<unicode_x2> TYPE x.

ASSIGN ZHTLPRJ TO <unicode_x1> CASTING.

ASSIGN RECORD_TAB TO <unicode_x2> CASTING.

MOVE <unicode_x1> TO <unicode_x2>.

Former Member
0 Kudos

Hi priya sharma,

above given link will defently work fine.

please make sure to appreciate for the correct answer by rewarding points.

so that the contribution will be good from either of the side.

Thanks

Vinod