‎2009 Jan 09 5:03 PM
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.
‎2009 Jan 09 5:48 PM
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.
‎2009 Jan 10 10:59 AM
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.
‎2009 Jan 10 3:45 AM
HI,
Use FM HR_99S_COPY_STRUC1_STRUC2 to copy structure to structure.