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: 

Cann't move data between two internal table in Unicode program

Former Member
0 Kudos

Hello expert,

I import a program from old sap system to new system, but syntax error occurred --- ' L_T_S776[] = T_DATA_RECORDS[]. ',

it is said ' internal table L_T_S776 and T_DATA_RECORDS are not mutually convertible, in unicode program, two internal tables must have the same structure layout'.

The coding is:

DATA: L_T_S776 LIKE S776 OCCURS 0 WITH HEADER LINE.

DATA: L_T_S777 LIKE S777 OCCURS 0 WITH HEADER LINE.

FIELD-SYMBOLS: <F_S776> TYPE S776.

FIELD-SYMBOLS: <F_S777> TYPE S777.

IF NOT ZCL_USEREXIT=>IS_ACTIVE( PROJN = 11 EXITN = 34 ) IS INITIAL.

CASE I_RMCP2-SCTYP.

WHEN 'Z776'.

L_T_S776[] = T_DATA_RECORDS[].

LOOP AT L_T_S776 ASSIGNING <F_S776>.

<F_S776>-ZZCUSER = SY-UNAME.

<F_S776>-ZZCDATE = SY-DATUM.

<F_S776>-ZZCTIME = SY-TIMLO.

ENDLOOP.

T_DATA_RECORDS[] = L_T_S776[].

WHEN OTHERS.

ENDCASE.

-


internal table T_DATA_RECORDS is defined to like INDX.

this program is in function module EXIT_SAPMMCP6_011, it is a user_exit.

-


I also confuse the meaning of this part of coding, could anybody help me?

reward if got useful reply, thank you.

H.B

4 REPLIES 4

Former Member
0 Kudos

Hi,

the simple solution for this is instead of moving all the data at a time move field by field.

Regards,

Atish

0 Kudos

Thanks for your reply.

but we cann't move data field by field, because the structure of that two internal tables are different,

besides, I don't know the effect of that part of coding.

0 Kudos

Hi,

The structure are different thats why you getting this error. But there must be some fields common to which you want to move data. So you change in that way.

And there will be no impact whatsoever because of such change.

Regards,

Atish

0 Kudos

Hi,

the data moving is not separated by field, but by char length.

So I cann't move data by field, besides, T_DATA_RECORDS doesn't include fields SY-UNAME, SY-DATUM and SY-TIMLO. Please have a look at database INDX. Thank you.