2008 May 22 7:18 AM
Hi
I have one question regrading the Field-Symbol to update the database table. I created the internal table using the dynamic method. When all of the information has been stored to internal table than executing the last command - insert. The error would be occur -
Runtime Error - UNICODE_TYPES_NOT_CONVERTIBLE
The types of the operands "dbtab" and "wa" are not mutually convertible.
I checked the internal table and database table structrue. They were same data type and length. Futhermore, I try the other [update to database command ], such as modify and update but still failed. What' happened ? Please get me the detail.
Thanks a lot !
Hi
I have one question regrading the Field-Symbol to update the database table. I created the internal table using the dynamic method. When all of the information has been stored to internal table than executing the last command - insert. The error would be occur -
Runtime Error - UNICODE_TYPES_NOT_CONVERTIBLE
The types of the operands "dbtab" and "wa" are not mutually convertible.
I checked the internal table and database table structrue. They were same data type and length. Futhermore, I try the other [update to database command ], such as modify and update but still failed. What' happened ? Please get me the detail.
Thanks a lot !
2008 May 23 4:23 AM
2008 May 23 4:24 AM
2008 Jun 18 7:22 PM
2008 Jun 24 3:13 AM
Are you used the bulid-in method CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE ?
if yes, the problem is the new structure which does not match your orginal table structure.The error will trigger because the field length size is double. If you want to solve that you must be changed the fields lenght correspondence with the orginal fields.
Here is my source code
Please execute the method CREATE_DYNAMIC_TABLE first !
DATA:IT_STRUCT_INFO TYPE ABAP_COMPDESCR_TAB,
WA_STRUCT_INFO TYPE ABAP_COMPDESCR.
DATA:REF_TABLE_DES TYPE REF TO CL_ABAP_STRUCTDESCR.
DATA:PR_LEN LIKE XFC-INTLEN.
REF_TABLE_DES ?= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_NAME( P_TABLE ).
IT_STRUCT_INFO[] = REF_TABLE_DES->COMPONENTS[].
LOOP AT IT_STRUCT_INFO INTO WA_STRUCT_INFO.
CLEAR XFC.
IF WA_STRUCT_INFO-TYPE_KIND = 'C'.
PR_LEN = WA_STRUCT_INFO-LENGTH / 2.
ENDIF.
XFC-FIELDNAME = WA_STRUCT_INFO-NAME .
XFC-DATATYPE = WA_STRUCT_INFO-TYPE_KIND.
XFC-INTTYPE = WA_STRUCT_INFO-TYPE_KIND.
XFC-INTLEN = PR_LEN.
XFC-DECIMALS = WA_STRUCT_INFO-DECIMALS.
APPEND XFC TO IFC.
ENDLOOP.
FREE: REF_TABLE_DES,IT_STRUCT_INFO,WA_STRUCT_INFO.
CLEAR:REF_TABLE_DES,IT_STRUCT_INFO,WA_STRUCT_INFO.
please reward the points !
2012 Feb 20 1:50 PM
Hello Wong,
Thanks so very much for this solution.
I was able to resolve my problem successfully.
I award you points for this.
Ajeet Phadnis
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |