Application Development and Automation 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: 
Read only

Runtime error UC_OBJECTS_NOT_CHARLIKE

Former Member
0 Likes
1,613

Hi ,

I am getting error UC_OBJECTS_NOT_CHARLIKE in Unicode program for statement

TRANSFER ls_text TO ls_file.

I checked the error and found ls_text has 4 fields with CURR17.

How to solve this Unicode issue with minimal code changes?

Thanks,

6 REPLIES 6
Read only

Former Member
0 Likes
868

how are you filling ls_text?

I would suppose that's where the problem is and not in the transfer.

Also post how are you delcaring ls_text.

Read only

0 Likes
868

ls_text is declared as :

DATA: BEGIN OF ls_text OCCURS 0,

xblnr(16), .

belnr(10),

...........

.........

wrbtr LIKE /bic/azo_gl01c00-deb_cre_lc "Currency CURR17

END OF ls_text.

The way I am assigning the data is

ls_Text- xblnr = wa_text-xblnr.

ls_Text- wrbtr = /BIC/AZO_GL01C00- DEB_CRE_LC.

TRANSFER ls_text TO ls_file.

Read only

0 Likes
868

I tought ls_text was a string...

You need to pass and string to the file.

In unicode it should be done like this, and by the way you should avoid using the header line


ls_string(1000). "depends how big your structure is.
call method CL_ABAP_CONTAINER_UTILITIES =>FILL_CONTAINER_C
  exporting  IM_VALUE               = ls_text
  importing  EX_CONTAINER           = ls_String
  exceptions ILLEGAL_PARAMETER_TYPE = 1
             others                 = 2.
transfer ls_String to ls_file.

By the way, you need to loop trough the table to transfer each line to the file

Read only

0 Likes
868

ok, just want to clarify this code is in the subroutine which is called in the loop. so I am passing each record to below code.

Also ls_file is char60.....so shall I create ls_string as char60 and pass to the method CL_ABAP_CONTAINER_UTILITIES =>FILL_CONTAINER_C?

Any other code is required to call this method?

Thanks a lot in!

*******************************************************************

ls_text is declared as :

DATA: BEGIN OF ls_text OCCURS 0,

xblnr(16), .

belnr(10),

...........

.........

wrbtr LIKE /bic/azo_gl01c00-deb_cre_lc "Currency CURR17

END OF ls_text.

The way I am assigning the data is

ls_Text- xblnr = wa_text-xblnr.

ls_Text- wrbtr = /BIC/AZO_GL01C00- DEB_CRE_LC.

TRANSFER ls_text TO ls_file.

Read only

0 Likes
868

just declare it with enough lenght to put all the fields in the structure.

If the method doesn't work it should need:


class CL_ABAP_CONTAINER_UTILITIES definition load.

Read only

0 Likes
868

let me change the code to solve the issue. I get back soon.

Thank you so much!