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: 

Upgrade error : Not mutually convertible

Former Member
0 Kudos

Hi All,

I am doing upgrade from 4.7 to ECC 6.

I got error in one program as shown below.

A line of "IT_PRD_COST" and "L_PRD" are not mutually convertible in aUnicode program. .

Actually declaration for these are shown below.

data:  l_prd(200) type c,

data: begin of it_prd_cost occurs 0,
        matnr type mbew-matnr,
        date(10) type c,
        cost type mbew-verpr,
      end of it_prd_cost.

And code is

insert l_prd into it_prd_cost index 1.

How to rectify this one.

Regards

Jai

1 REPLY 1

Lukas_Weigelt
Active Contributor
0 Kudos

Hi,

Is this a standard program? Using implicit header lines is obsolete, you shouldn't do this. Aside from that you should move a local variable to a work area and append the work area to the itab; not the local variable to the table..

Also the data types are inconvertible. Your try to move a char field into a curr field, this can't really work out

If this is your own program and not sap-standard, better do something like:

TYPES: BEGIN OF ls_prd_cost_type,
             matnr type mbew-matnr,
             date(10) type c,
             cost type mbew-verpr,
             END OF ls_prd_cost_type.
TYPES: lt_prd_cost_type TYPE STANDARD TABLE OF ls_prd_cost_type.

DATA: ls_prd_cost TYPE ls_prd_cost_type.
DATA: lt_prd_cost TYPE lt_prd_cost_type.

DATA: lv_prd(200) TYPE c.

ls_prd_cost-cost = lv_prd. " This will not work with these data-types

APPEND ls_prd_cost TO lt_prd_cost.
CLEAR ls_prd_cost.

Take a look at this document as well: http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b02d3594-ae48-2a10-83a7-89d369b70...

regards,

Lukas

Edited by: Lukas Weigelt on Apr 6, 2011 3:40 PM