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

Structure1 and Structure2 are not mutually convertible

Former Member
0 Likes
2,598

hi,

im curretly upgrading programs from version 4.7 to 6

im trying to update the WS_upload into GUI_upload. the problem starts when i transfer the value of the internal table to another internal table

the error msg is this:

Structure1 and Structure2 are not mutually convertible. In Unicode programs, Structure1 must have the same structure layout as Structure2, independent of the length of a Unicode character.

this is the code:

CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD

EXPORTING

FILENAME = v_filename

FILETYPE = 'DAT'

CHANGING

DATA_TAB = i_tab

EXCEPTIONS

others = 24.

IF sy-subrc EQ 0.

PI_DATOS[ ] = i_tab[ ].

ENDIF.

thanks

Edited by: audemar ryann on Mar 17, 2009 2:40 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,045

Hi,

Both of your internal tables should have same structure.

Pranav

7 REPLIES 7
Read only

Former Member
0 Likes
2,046

Hi,

Both of your internal tables should have same structure.

Pranav

Read only

Former Member
0 Likes
2,045

Hi,

Check PI_DATOS, i_tab structure are same?.

Read only

faisalatsap
Active Contributor
0 Likes
2,045

Use the following hope will solve out if i_tab is with header line.

DATA_TAB = i_tab[]

Please Reply if any Issue,

Best Regards,

Faisal

Read only

Former Member
0 Likes
2,045

Hi Audemar,

Here it is NOT important if the TYPES of the structures are the same, but it is important, that the TABLE TYPES are the same and that the type of PI_DATOS has a wider or equal width as I_TAB.

Since i see that you use the square brackets [] behind aech table, i asume that you have used an OLD (obsolete) definition for defining the tables (i.e. using "WITH HEADER LINE"). This is NOT allowed.

However is is also good practice to keep both tables identical in definition.

DATA:
  pi_datos  TYPE STANDARD TABLE OF <structure-name>,
  i_tab     TYPE STABDARD TABLE OF <structure-name>.

CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
. . .

IF sy-subrc EQ 0.
  pi_datos = i_tab.
ENDIF.

Regards,

Robbie.

Read only

Former Member
0 Likes
2,045

Is i_tab table with a header line, if it is so then in the changing parameters of GUI_UPLOAD

u shd pass data_tab = i_tab[ ].

Read only

Former Member
0 Likes
2,045

HI,

PI_DATOS[ ] = i_tab[ ].

The above two tables might be incompatiable so use this FM HR_99S_COPY_TABLE1_TABLE2 to copy data from itab to pi_datos.

Use these FM to copy the data in between two different sturcture HR_99S_COPY_STRUC1_STRUC2

to copy the data in between two different internal table HR_99S_COPY_TABLE1_TABLE2

Edited by: Avinash Kodarapu on Mar 18, 2009 10:39 AM

Read only

Former Member
0 Likes
2,045

Hi,

Check the structure of these two internal tables....

PI_DATOS

I_TAB.

if you find any fieldnames which are similar in both...

then use the loop in this way...

loop at itab.
move-corresponding i_tab to pi_datos.
append pi_datos.
endloop.

if you dont find any similar fieldnames in both the tables then check which all fields are same meaning then assign it this way...

loop at i_tab.
  pi_datos-field1  = i_tab-field1.          " if field1 of both the tables give the same meaning
  pi_datos-field3 = i_tab-field2.           " if field2 of I_TAB gives the same meaning to field3 of PI_DATOS
  append pi_datos.
endloop

Regards,

Siddarth