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: 

UNICODE_TYPES_NOT_CONVERTIBLE

Former Member
0 Kudos

hello experts,

i'm having a short dump error Unicode_types_not convetrible.

actually where upgrading from 4.6 to ecc6.

this is the syntax.

data: i_data type standard table of tab512,
         w_data(192) type c.
 
parameters: s_tab(60) type c,
              s_ctab(60) type c.
 
select * from (s_tab) into table i_data.
 
loop at i_data into w_data.
insert into (s_ctab) value w_data.
endloop.

please help.

Thank You.

9 REPLIES 9

Former Member
0 Kudos

SAMPLE:

S_TAB = MARA -


> original table

s_CTAB = ZMARA -


> copy table

deepak_dhamat
Active Contributor
0 Kudos

hi ,

WHat is error and where ?

regards

Deepak

0 Kudos

error is in statement .

example: s_tab = mara

select * from (s_tab) into table i_data.

The types of operands"dbtab" and "itab" are not mutually convertible.

please help

0 Kudos

Hi Bernadette,

what ever you do, please use

select * from (s_tab) into CORRESPONDING FIELDS OF table i_data.

If the database table and the internal table have at least one field of the same name, you will get results following the "works as designed" clause.

Somebody will come and say "CORRESPONDING FIELDS OF" will give lower performance. This is an [urban legend|http://www.google.de/url?sa=t&source=web&cd=1&ved=0CCsQFjAA&url=http%3A%2F%2Fwww.snopes.com%2F&ei=ptT1TePPLsrIswbG252ZBg&usg=AFQjCNGef9g87vH-E1zz3C1QcYgyZiU61Q&sig2=-O0a6c4rMfDJSP316yBP-Q].

Regards,

Clemens

0 Kudos

hi.

i_data doesn't have a same field it is a type standard table of Tab512 which contain only one compnent field WA char type size 512.

0 Kudos

I suppose this data comes from FM RFC_GET_TABLE_ENTRIES ?

You will have to map records of the internal table to records of a structure compatible with the database table using class CL_ABAP_CONTAINER_UTILITIES

CLASS cl_abap_container_utilities DEFINITION LOAD.
DATA dref TYPE REF TO data.
FIELD-SYMBOLS: <wa> TYPE ANY.
CREATE DATA dref TYPE (dbtab).
ASSIGN dref->* TO <wa>.
...
LOOP AT entries INTO tab512.
  CALL METHOD cl_abap_container_utilities=>read_container_c
    EXPORTING
      im_container           = tab512-wa
    IMPORTING
      ex_value               = <wa>
    EXCEPTIONS
      illegal_parameter_type = 1
      OTHERS                 = 2.
  INSERT INTO INTO (dbctab) value <wa>.
ENDLOOP.

Of course you can use some [ASSIGN CASTING|http://help.sap.com/abapdocu_70/en/ABAPASSIGN_CASTING.htm] in your code.

Regards,

Raymond

0 Kudos

Hi,

Can you help me revise my code?

Thank You

0 Kudos

hi experts,

please help me on this i'm getting error Method Create is unknown or protected or private.


 DATA: lo_structtype type ref to cl_abap_structdescr,
        lo_tabletype  type ref to cl_abap_tabledescr,
        lr_structdata type ref to data,
        lr_tabledata   type ref to data.
 
field-symbols: <ls> type any,
               <lt> type standard table.
 
* get the type for the structure
lo_structtype ?= cl_abap_structdescr=>describe_by_name( s_tab ).
* get the type of the table
lo_tabletype = cl_abap_tabledescr=>create( p_line_type = lo_structtype ). ------------------> ERROR

* create the data
create data: lr_structdata type handle lo_structtype,
                    lr_tabledata type handle lo_tabletype.
 
* assign the field symbols
assign lr_structdata->* to <ls>.
assign lr_tabledata->* to <lt>.
 
* select the data
select * from (s_tab) into <ls>.
append <ls> to <lt>.
endselect. 

raymond_giuseppi
Active Contributor
0 Kudos

You must use structure compatible with the database definition, take a look at the sample in [CREATE DATA - TABLE OF|http://help.sap.com/abapdocu_70/en/ABAPCREATE_DATA_ITAB.htm] to get an idea.

FIELD-SYMBOLS: <itab> TYPE ANY TABLE,
               <wa>   TYPE ANY.
CREATE DATA dref TYPE STANDARD TABLE OF (dbtab)
                      WITH NON-UNIQUE DEFAULT KEY.
ASSIGN dref->* TO <itab>.
SELECT *
       FROM (dbtab) UP TO rows ROWS
       INTO TABLE <it>.
LOOP AT <itab> ASSIGNING <wa>.

Regards,

Raymond