Skip to Content
0
Former Member
Oct 06, 2005 at 04:12 AM

Unicode structure problem

32 Views

Hello

I was hoping someone could help me with this Unicode problem.

In the non-unicode system we have the following ABAP:

FIELD-SYMBOLS: <RECORD_STRUCTURE>.

DATA: P_IT_RAW(1000).

F_RECORD_TYPE = ‘HDR’.

ASSIGN (F_RECORD_TYPE) TO <RECORD_STRUCTURE>

P_IT_RAW = <RECORD_STRUCTURE>. <== Unicode runtime error

Basically the structure of HDR is all different types of fields, such as CHAR, DATS, INT4, NUMC etc…

Whats the recommend way to copy "CHAR, DATS, INT4, NUMC" fields “in” and “out” of character structures in a Unicode system.

This is the code that fails when we try to copy a character field over a field that contains CHAR, DATS, INT4, NUMC…

<RECORD_STRUCTURE> = P_IT_RAW. <== Unicode runtime error

Thanks in advance

Peter

PS: To replace the:

P_IT_RAW = <RECORD_STRUCTURE>.

I have been using the follow code:

data: f_compcnt TYPE i,

f_comptype(1) TYPE c,

f_field_len type i,

f_total_write_len type i,

f_temp_str(1000) type c,

f_compcnt2 TYPE i,

f_comptype2(1) TYPE c.

field-symbols : <comp> TYPE ANY.

clear: f_field_len.

f_total_write_len = 0.

DESCRIBE FIELD <RECORD_STRUCTURE> TYPE f_comptype COMPONENTS f_compcnt.

DO f_compcnt TIMES.

ASSIGN COMPONENT sy-index OF STRUCTURE <RECORD_STRUCTURE> TO <comp>.

P_IT_RAW+f_total_write_len = <comp>.

describe field <comp> output-length f_field_len.

f_total_write_len = f_total_write_len + f_field_len.

ENDDO.

But how do I get data back out of the P_IT_RAW field into a structured field?