‎2011 Jan 21 6:11 AM
Hi all,
Could someone let me know what I am getting this error. How could I solve it? Any ideas are highly appreciated.
Short text
Data objects in Unicode programs cannot be converted.
Error analysis
The statement
"MOVE src TO dst"
requires that the operands "dst" and "src" are convertible.
Since this statement is in a Unicode program, the special conversion
rules for Unicode programs apply.
In this case, these rules were violated.
data: ld_struct type ref to data.
data: lv_fieldname type ztcbi_chkeymap-fromfld.
data: lv_tabname type TABNAME.
data: lv_tabkey type CDTABKEY.
data: lv_bnfpo type BNFPO.
field-symbols: <lf_stru> type any,
<lf_field> type any.
lv_tabname = 'EBKN'.
lv_tabkey = '1000010000041000201'.
lv_fieldname = 'BNFPO'.
create data ld_struct type (lv_tabname).
assign ld_struct->* to <lf_stru>.
<lf_stru> = lv_tabkey.
assign component lv_fieldname of structure <lf_stru> to <lf_field>.
if sy-subrc = 0.
lv_bnfpo = <lf_field>.
else.
lv_bnfpo = 0.
endif.
WRITE:/ lv_bnfpo.
‎2011 Jan 21 6:59 AM
Hello,
This is because you're trying to move a data of TYPE CDTABKEY(CHAR70) to a structure TYPE EKBN. Try to change the data declaration as follows & the code should work:
DATA: lv_fieldname TYPE fieldname.
DATA: lv_tabkey TYPE ebkn.You can read more about the data conversion rules in UC environment on F1 help.
BR,
Suhas
‎2011 Jan 21 6:16 AM
Hi Mr. Wong,
Hopefully you you have to point both "src & dst" to one type of Fileld/Domain.
Please check that once.
Thanks & regards,
Dileep Kumar .C
‎2011 Jan 21 6:20 AM
Hi thanks for replying. I still do not understand and what to be changed.
Please help.
‎2011 Jan 21 6:25 AM
‎2011 Jan 21 6:36 AM
Hi
I have checked you code its perfect.
Just check one point
what is type and length of
data: lv_fieldname type ztcbi_chkeymap-fromfld.
It shoul be character and greater than 6.
Thanks
Dhiraj.
‎2011 Jan 21 6:42 AM
FROMFLD Z_CHFRFLD CHAR 30
CREDATE CREATEDATE DATS 8
CRETIME CREATETIME TIMS 6
CHGDATE CHANGDATE DATS 8
CHGTIME CHANGTIME TIMS 6
‎2011 Jan 21 6:59 AM
Hello,
This is because you're trying to move a data of TYPE CDTABKEY(CHAR70) to a structure TYPE EKBN. Try to change the data declaration as follows & the code should work:
DATA: lv_fieldname TYPE fieldname.
DATA: lv_tabkey TYPE ebkn.You can read more about the data conversion rules in UC environment on F1 help.
BR,
Suhas
‎2011 Jan 21 7:11 AM