2009 Mar 17 1:39 PM
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
2009 Mar 17 1:41 PM
Hi,
Both of your internal tables should have same structure.
Pranav
2009 Mar 17 1:41 PM
Hi,
Both of your internal tables should have same structure.
Pranav
2009 Mar 17 1:43 PM
2009 Mar 17 1:44 PM
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
2009 Mar 17 1:52 PM
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.
2009 Mar 18 5:06 AM
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[ ].
2009 Mar 18 5:09 AM
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
2009 Mar 18 5:15 AM
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.
endloopRegards,
Siddarth