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

... are not mutually convertible in a Unicode program.

Former Member
0 Likes
1,053

when trying to write data to a file, I get this message:

<b>error message:</b>

"H_LINEBUFFER" and "I_YLSRCORD" are not mutually convertible in a Unicode program.

<b>my declaration:</b>

DATA: h_linebuffer TYPE string.

DATA: i_ylsrcord LIKE /bic/aylsrcord00 OCCURS 0 WITH HEADER LINE.

<b>place where I get the error:</b>

loop at i_ylsrcord.

move i_ylsrcord to h_linebuffer.

TRANSFER h_linebuffer to h_file.

endloop.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
959

Do you even need the string?

loop at i_ylsrcord.
*move i_ylsrcord to h_linebuffer.
TRANSFER  i_ylsrcord  to h_file.
endloop.

Regards,

RIch Heilman

7 REPLIES 7
Read only

Former Member
0 Likes
959

<b>DATA: i_ylsrcord LIKE /bic/aylsrcord00 OCCURS 0 WITH HEADER LINE.</b>

It's declared as an Internal Table while

<b>DATA: h_linebuffer TYPE string.</b>

It's declared as a field....That's why you can't assign i_ylsrcord to h_linebuffer. You can pass fields not tables to a field type....

Greetings,

Blag.

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
960

Do you even need the string?

loop at i_ylsrcord.
*move i_ylsrcord to h_linebuffer.
TRANSFER  i_ylsrcord  to h_file.
endloop.

Regards,

RIch Heilman

Read only

0 Likes
959

you were right Rich, I don't even need the string

thanks a lot !

topic can be closed!

Read only

Former Member
0 Likes
959

hi Joris,

loop at i_ylsrcord.

move i_ylsrcord to h_linebuffer. ---><b> You are trying to pass an internal table to a string </b>

TRANSFER h_linebuffer to h_file.

endloop.

Read only

0 Likes
959

<i>move i_ylsrcord to h_linebuffer. <b>---> You are trying to pass an internal table to a string</b></i>

No, he is not, he is passing the header line to the string.

Regards,

Rich Heilman

Read only

0 Likes
959

> <i>move i_ylsrcord to h_linebuffer. <b>---> You are

> trying to pass an internal table to a string</b></i>

>

>

> No, he is not, he is passing the header line to the

> string.

>

> Regards,

> Rich Heilman

-:( Your right....I didn't notice it -:)

Greetings,

Blag.

Read only

Former Member
0 Likes
959

Hi Joris,

Try declaring h_linebuffer as below.

data: h_linebuffer(132).

Hope it helps..

Regards

Sekar