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

two structures are incompatible Unicode Conversion error

Former Member
0 Likes
551

Hi Experts,

I copying a program from non unicode system to Unicode system.

I need to pass the data from a structure into a I_ERROR-DAT field of length.

I am using the follwoing Methods to pass the structure to field.

But the problem is, all the data is not getting copied.

L_datos is of type structure having 42 fields.

Please help.

The code is:

form rellenar_error tables we structure YYF_ES001_ERR

wx structure YYF_ES001_DEF

using l_cod l_datos.

CLASS ZCL_ABAP_CONTAINER_UTILITIES DEFINITION LOAD.

DATA: LV_TAB(1000) type C.

clear we.

we-cod = l_cod

CALL METHOD CL_ABAP_CONTAINER_UTILITIES=>FILL_CONTAINER_C

EXPORTING

IM_VALUE = l_datos

IMPORTING

EX_CONTAINER = LV_TAB.

CALL METHOD CL_ABAP_CONTAINER_UTILITIES=>READ_CONTAINER_C

EXPORTING

IM_CONTAINER = LV_TAB

IMPORTING

EX_VALUE = WE-DAT.

append we.

read table wx with key cod = l_cod.

if sy-subrc = 0.

add 1 to wx-cont.

modify wx index sy-tabix.

else.

clear wx.

wx-cod = l_cod.

add 1 to wx-cont.

append wx.

endif.

ENDFORM.

3 REPLIES 3
Read only

amit_khare
Active Contributor
0 Likes
512

In unicode systems, you will not able to copy the structures with similar fields but different in numbers.

In that case, either pass one-to-on or use MOVE CORRESPONDING.

Or in Program Attributes, just uncheck the UNICODE CHECK ACTIVE option.

Read only

0 Likes
512

All the data is not getting copied. the data type used in the methods for field symbol is X. but still data is getting truncated.

I can not copy field to field as the subroutine is in a subroutine pool and being called in diff programs, with diff structures for processing error messages.

Read only

Former Member
0 Likes
512

HI,

Use FM HR_99S_COPY_STRUC1_STRUC2 to copy structure to structure.